var aarrows = new Array();

aarrows["basic"] = new Image(9,9);
aarrows["basic"].src = "h-images/white_arrow.gif";
aarrows["down"] = new Image(9,9);
aarrows["down"].src = "h-images/white_arrow_down.gif";

var l_subpage = 1;

function setcolorsubpage(i) { l_subpage=i; }

function highlightMenu(button, state) {
	if (state) {
		document.getElementById(button).className="menustyleHighlighted";
	} else {
		document.getElementById(button).className="menustyle";
	}
}

var l_curmenu='';


function highlightSection(section, state) {
	sectionBg=String(section+"bg");
	sectionImg=String(section+"-largeimage");
	if (state) {
		l_curmenu=section;
		//CHANGE BACKGROUND OF SECTION BUTTON
		document.getElementById(sectionBg).style.opacity=0.3; //STANDARDS-COMPLIANT
		document.getElementById(sectionBg).style.filter="alpha(opacity=30)"; //IE
		//Show the appropriate div tag:
		document.getElementById(sectionImg).style.visibility = "visible";
		//point the arrow down
		if (document.getElementById(section+'-arrow')) { document.getElementById(section+'-arrow').src = aarrows["down"].src; }
		ie_iframehack(1);
	} 
	else if (l_curmenu!=section) {
		//UNDO ALL CHANGES
		document.getElementById(sectionImg).style.visibility = "hidden";
		l_curmenu='';
		l_turningoff='';
	}
}

function ie_iframehack(onoff) {
 if (document.all && document.getElementById("iframehack")) {
  if (onoff) { document.getElementById("iframehack").style.visibility="visible"; }
  else { document.getElementById("iframehack").style.visibility="hidden"; }
 }
}

l_turningoff=0;
function delayed_dehighlight(section) {
 l_curmenu='';
 /*sectionBg=String(section+"bg");
 document.getElementById(sectionBg).style.opacity=0.7; //STANDARDS-COMPLIANT
 document.getElementById(sectionBg).style.filter="alpha(opacity=70)"; //IE
 l_turningoff=section;
 setTimeout("if (l_curmenu != l_turningoff) { highlightSection(l_turningoff,false); }",10);*/
 l_turningoff++;
 setTimeout("dehighlight_all("+l_turningoff+");",5);
}

function dehighlight_all(whichcall) {
 if (whichcall!=l_turningoff) { return; }
 for (var i=1;i<5;i++) {
  if (l_curmenu != 'section'+i) {
   if (!l_subpage) {
    document.getElementById('section'+i+'bg').style.opacity=0.7; //STANDARDS-COMPLIANT
    document.getElementById('section'+i+'bg').style.filter="alpha(opacity=70)"; //IE
   }
   else {
    document.getElementById('section'+i+'bg').style.opacity=1.0; //STANDARDS-COMPLIANT
    document.getElementById('section'+i+'bg').style.filter="alpha(opacity=100)"; //IE
   }
   document.getElementById('section'+i+'-largeimage').style.visibility="hidden";
   if (document.getElementById('section'+i+'-arrow')) { document.getElementById('section'+i+'-arrow').src = aarrows["basic"].src; }
  }
 }
 if (!l_curmenu) { ie_iframehack(0); }
}

