var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;


if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}

function rightShow(issue){
	clearAll();
	noClassAll();
	setClass('r9', 'tenreasons2')
	myID = "r" + issue;
	if(issue > 1){	
		upperID = "r" + (issue - 1);
		setClass(upperID, 'lessOne');
		if (upperID == 'r9'){setClass(upperID, 'lessOne tenreasons2');}
	}
	if (issue >0){
	setClass(myID, 'active');
	if (issue == 9){setClass(myID, 'active tenreasons2');}
	}
	issue = 'reason' + issue;
	ShowHide(issue, '', 'show');
}
function clearAll(){
ShowHide('reason0','', 'hide', 'reason1','','hide', 'reason2','','hide', 'reason3','','hide', 'reason4','','hide','reason5','','hide');
ShowHide('reason6','', 'hide', 'reason7','','hide', 'reason8','','hide', 'reason9','','hide', 'reason10','','hide');
   }

function setClass(objectID,newClass) {
	//var object = document.getElementById(objectID);
	//object.className = newClass;
	var dom =findDOM(objectID, 0);
	dom.className = newClass;
}
function noClassAll(){
for(i=1; i<=10; i++){
	id = 'r'+i;
	setClass(id, null);
	}
}


function ShowHide()
{ 
  var i, visStr, obj, args = ShowHide.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

