var cLastColor=""
var colormenuoff = '#A2BAD7'
var colormenuon = '#FFD11C'
var colormenuactive = 'white'
var colormenuselected = '#CCCCCC'

function menumain(cMenuId,cMenuName){
	document.write('<td id='+cMenuId+' onclick="window.location='+"this.id+'.htm'"+'" onmouseover="col1(this);" onmouseout="col0(this,cPage);">',
				'<P align=center><A HREF="'+cMenuId+'.htm"><b>'+cMenuName+'</b></A></p></td>')
}

function menusub1(cMenuId,cMenuName){
	document.write('<TR  class="colormenuoff" >',
		'<td id='+cMenuId+' colspan=2 onclick="window.location='+"this.id+'.htm'"+'"  onmouseover="col1(this);" onmouseout="col0(this,cSubPage);" >',
			'<A HREF="'+cMenuId+'.htm"><img id='+cMenuId+' border="0" src="images/rightarrow.gif"><b>'+cMenuName+'</b></A></td></tr>')
}

function menusub2(cMenuId,cMenuName){
	document.write('<tr>',
		'<td  > &nbsp;</td>',
		'<td id='+cMenuId+' class="colormenuoff"  onclick="window.location='+"this.id+'.htm'"+'"  onmouseover="col1(this);" onmouseout="col0(this,cSubSubPage);"  >',
			'<A HREF="'+cMenuId+'.htm">'+cMenuName+'<img id='+cMenuId+' style="VISIBILITY:hidden" border="0" src="images/rightarrow.gif"></A></td></tr>')
}

function menusublast(cMenuId,cMenuName){
	document.write('<TR class="colormenuoff" >',
		'<td id='+cMenuId+'  colspan=2 onclick="window.location='+"this.id+'.htm'"+'"  onmouseover="col1(this);" onmouseout="col0(this,cSubPage);" >',
			'<img id='+cMenuId+'2   border="0" src="images/rightarrow.gif"><A HREF="'+cMenuId+'.htm"><b>'+cMenuName+'</b><img id='+cMenuId+' style="VISIBILITY:hidden" border="0" src="images/rightarrow.gif"></A></td></tr>')

}


function col0(oElement,cCurrentPg){
	if (cCurrentPg == oElement.id)	{
		oElement.style.backgroundColor = cLastColor
	}
	else	{
		oElement.style.backgroundColor = colormenuoff 
	}
}

function col1(oElement){
	cLastColor = oElement.style.backgroundColor
	oElement.style.backgroundColor=colormenuon;
}

function refreshMain(cCurrentPg,cCurrentSubPg,cCurrentSubSubPg){
	var oElements = document.getElementsByTagName("TD");
	for (i=1; i < oElements.length; i++)
	{
		if (oElements.item(i).id==cCurrentPg){
			if (cCurrentSubPg=="none"  || cCurrentSubSubPg=="never" )
				oElements.item(i).style.backgroundColor= colormenuactive
			else
				oElements.item(i).style.backgroundColor=colormenuselected
			}
		if (oElements.item(i).id==cCurrentSubPg ){
			if (cCurrentSubSubPg=="none" || cCurrentSubSubPg=="never" )
				oElements.item(i).style.backgroundColor=colormenuactive
			else
				oElements.item(i).style.backgroundColor=colormenuselected
			}
			
		if (oElements.item(i).id==cCurrentSubSubPg){
			oElements.item(i).style.backgroundColor=colormenuactive;
			}
	}
	var oElements = document.getElementsByTagName("IMG")
	for (i=1; i < oElements.length; i++)
	{
		if (oElements.item(i).id==cCurrentSubSubPg){
			oElements.item(i).style.visibility="visible";
			}

		if (oElements.item(i).id==cCurrentSubPg+"2"){
			oElements.item(i).style.visibility="hidden";
			}


		if (oElements.item(i).id==cCurrentSubPg){
			oElements.item(i).style.visibility="visible";
			if (cCurrentSubSubPg !="never" )
				{				
				oElements.item(i).src="images/downarrow.gif"

				}
			}
	}
}

