var rollEn=0;
var currentLocation=document.location;
var rolPause;var thePause=80;
var oopsPause=100;
var stringWrapLength=25;
var currentLayer="none";
var mouseOverMenu=0;
var timerID;
var numDHTMLimages=5;
var DimgLoded=0;
var initial=0;
var dinitial=0;
 
function beginCachingDHTML(){
	var topBorder=new Image();
	var rightBorder=new Image();
	var rightBorder2=new Image();
	var leftBorder=new Image();
	var spacer=new Image();
	topBorder.onload=countDHTMLimages;
	topBorder.src="images/g_mnu_top.gif";
	rightBorder.onload=countDHTMLimages;
	rightBorder.src="images/g_mnu_mid.gif";
	rightBorder2.onload=countDHTMLimages;
	rightBorder2.src="images/g_mnu_mid.gif";
	leftBorder.onload=countDHTMLimages;
	leftBorder.src="images/g_mnu_btm.gif";
	spacer.onload=countDHTMLimages;
	spacer.src="images/g_pxl_whi.gif";
	if ((navigator.appName.indexOf("Netscape") != -1)&& (navigator.appVersion.indexOf("4.") != -1))loadN4DHTMLCacheLayer();
	}

function countDHTMLimages(){
	++DimgLoded;
	if(DimgLoded==numDHTMLimages){
		DHTMLen=1;
		beginCachingRollovers();
		}
	}

function loadN4DHTMLCacheLayer(){
	dinitial=1;
	document.main.document.dhtmlcacher.src='scripts/dhtml.htm';
	}

function checkN4DHTMLCacheLayer(){
	if (document.main.document.dhtmlcacher.img_counter==numDHTMLimages){
		DHTMLen=1;beginCachingRollovers();
		}
	else timevar=setTimeout("checkN4DHTMLCacheLayer()", 50);
	}

function openMenu(whichMenu){
	clearTimeout(timerID);
	var whatLayer=menuList[whichMenu];
	if(currentLayer!=whatLayer){
		closeMenu();showLayer(whatLayer);
		currentLayer=whatLayer;
		}
	}

function timeOutMenu(){
	clearTimeout(timerID);timerID=setTimeout("if(!mouseOverMenu)closeMenu();",thePause);
	}

function closeMenu(){
	if(currentLayer!="none" && menuList[curNav]!=currentLayer){
		hideLayer(currentLayer);currentLayer="none";
		}
	}

function createMenu(menuName,originX,originY,height){
	var loopCounter=1;
	var ast;
	var thisItem="";
	var thisLink="";
	var tV1="";
	var tV2="";
	var dummyContent = '<IMG SRC="images/g_spcr_whi.gif" WIDTH=175 HEIGHT=' + height + '>';

	ast = '<TABLE WIDTH="169" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD WIDTH="169" COLSPAN="3"><IMG SRC="images/g_mnu_top.gif" WIDTH="169" HEIGHT="9" BORDER="0" HSPACE="0" VSPACE="0"></TD></TR>';
	if((eval(menuName+"Menu['I1href']")=="null")&&(eval(menuName+"Menu['numItems']")==1)){
		var itemHeight=eval(menuName+"Menu['I1height']");
		ast+='<TR><TD WIDTH="10" BGCOLOR="#FFFFFF" ROWSPAN="'+itemHeight+'"><IMG SRC="images/g_pxl_whi.gif" WIDTH="10" HEIGHT="1" BORDER="0"></TD><TD VALIGN="MIDDLE" WIDTH="147" BGCOLOR="#FFFFFF" ROWSPAN="'+itemHeight+'"><FONT FACE="ARIAL,HELVETICA" SIZE="2" COLOR="#000000">';
		thisItem=eval(menuName+"Menu['I1']");
		ast+=thisItem+'</FONT></TD><TD BACKGROUND="images/g_mnu_mid.gif" WIDTH="12"><IMG SRC="images/g_pxl_tran.gif" WIDTH="12" HEIGHT="26" BORDER="0"></TD></TR>';
		for(loopCounter=1;
		loopCounter<itemHeight;
		++loopCounter){
			ast+='<TR><TD BACKGROUND="images/g_mnu_mid.gif" WIDTH="12"><IMG SRC="images/g_pxl_tran.gif" WIDTH="12" HEIGHT="26" BORDER="0"></TD></TR>';
			}
		}
	else{
		for(loopCounter=1;
		loopCounter<=eval(menuName+"Menu['numItems']");
		++loopCounter){
			thisItem=eval(menuName+"Menu['I"+loopCounter+"']");
			thisLink=eval(menuName+"Menu['I"+loopCounter+"href']");
			ast+='<TR><TD WIDTH="10" BGCOLOR="#FFFFFF"><IMG SRC="images/g_pxl_whi.gif" WIDTH="10" HEIGHT="1" BORDER="0"></TD><TD VALIGN="MIDDLE" WIDTH="147" BGCOLOR="#FFFFFF"><FONT FACE="ARIAL,HELVETICA" SIZE="2" COLOR="#000000"><A HREF="'+thisLink+'"><FONT FACE="ARIAL,HELVETICA" SIZE="2" COLOR="#000000">'+thisItem+'</FONT></A></FONT></TD>';
			if(thisItem.length > stringWrapLength)ast+='<TD BACKGROUND="images/g_mnu_mid2.gif" WIDTH="12"><IMG SRC="images/g_pxl_tran.gif" WIDTH="12" HEIGHT="41" BORDER="0"></TD>';
			else ast+='<TD BACKGROUND="images/g_mnu_mid.gif" WIDTH="12"><IMG SRC="images/g_pxl_tran.gif" WIDTH="12" HEIGHT="26" BORDER="0"></TD>';
			ast+='</TR>';
			}
		}
		ast+='<TR><TD WIDTH="169" COLSPAN="3"><IMG SRC="images/g_mnu_btm.gif" WIDTH="169" HEIGHT="9" BORDER="0"></TD></TR><TR><TD WIDTH="10"><IMG SRC="images/g_pxl_tran.gif" WIDTH="10" HEIGHT="1" BORDER="0"></TD><TD WIDTH="147"><IMG SRC="images/g_pxl_tran.gif" WIDTH="147" HEIGHT="1" BORDER="0"></TD><TD WIDTH="12"><IMG SRC="images/g_pxl_tran.gif" WIDTH="12" HEIGHT="1" BORDER="0"></TD></TR></TABLE>';
		eval (menuName + '_content = ast;');
		createLayer(menuName, originX, originY, 175, height, 0, dummyContent);
	}

var layerList=new Array();

function createLayer(name, left, top, width, height, visible, content){
	var z=layerList.length;var layer;
	layerList[z]=name;
	if (document.layers){
		if(document.location==currentLocation)document.writeln('<layer name="'+name+'" left='+left+' top='+top+' width='+width+' height='+height+ ' visibility='+(visible ? '"show"' : '"hide"')+' z-index='+z+' onMouseOver="mouseOverLayer(\''+name+'\');" onMouseOut="mouseOutLayer(\''+name+'\');">');
		if(document.location==currentLocation)document.writeln(content);
		if(document.location==currentLocation)document.writeln('</layer>');
		layer=getLayer(name);
		layer.width=width;
		layer.height=height;
		}
	else if (document.all){
		if(document.location==currentLocation)document.writeln('<div id="'+name+'" style="position:absolute; overflow:none; left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px;'+' visibility:'+(visible ? 'visible;' : 'hidden;')+' z-index:'+z+'" onMouseOver="mouseOverLayer(\''+name+'\');" onMouseOut="mouseOutLayer(\''+name+'\');">');
		if(document.location==currentLocation)document.writeln(content);
		if(document.location==currentLocation)document.writeln('</div>');
		}
	clipLayer(name, 0, 0, width, height);
	}

function mouseOverLayer(name){
	if(rollEn)clearTimeout(rolloverTimer);
	mouseOverMenu=1;
	clearTimeout(timerID);
	}

function mouseOutLayer(name){
	setTimeout("rolloverMenuOut()",oopsPause);
	mouseOverMenu=0;
	timeOutMenu();
	}


function hideLayer(name){
	var layer=getLayer(name);
	if (document.layers)layer.visibility="hide";
	if (document.all)layer.visibility="hidden";
	}

function showLayer(name){
	var layer=getLayer(name);
	if (document.layers)layer.visibility="show";
	if (document.all)layer.visibility="visible";
	}

function isVisible(name){
	var layer=getLayer(name);
	if (document.layers && layer.visibility=="show")return(true);
	if (document.all && layer.visibility=="visible")return(true);
	return(false);
	}

function clipLayer(name, clipleft, cliptop, clipright, clipbottom){
	var layer=getLayer(name);
	if (document.layers){
		layer.clip.left =clipleft;
		layer.clip.top  =cliptop;
		layer.clip.right=clipright;
		layer.clip.bottom=clipbottom;
		}
	if (document.all)layer.clip='rect('+cliptop+' '+ clipright+' '+clipbottom+' '+clipleft +')';
	}

function getLayer(name){
	if (document.layers)return(document.layers[name]);
	else if (document.all){
		var layer = eval('document.all.'+name+'.style');
		return(layer);
		}
	else return(null);
	}

function replaceContent(name, content){
	if (document.layers){
		var layer = getLayer(name);
		layer.document.open();
		layer.document.writeln(content);
		layer.document.close();
		}
	else if (document.all){
		var str = "document.all." + name + ".innerHTML = '" + content + "'";eval(str);
		}
	}

