
var LastEvent;
var LastEvent2;
var TimeoutID;
var TimeoutID2;
var MainOverImage="url(images/topnav_blank_downx.gif)";
var MainOutImage="url(images/topnav_blank_overx.gif)";
var MainOverTxtColor = "#396228";
var MainOutTxtColor = "";
var MainSelectedDiv = "";

function Do_OutDelay()
{
	var varFunc;
		
	varFunc = "MM_Out_showHideLayers(";
	
	for(i=0;i<Do_OutDelay.arguments.length;++i)
	{
		if(i > 0)
			varFunc += ",";
			
		varFunc += "'"+ Do_OutDelay.arguments[i] +"'";
	}
	
	varFunc += ")";
	
	LastEvent = "mouseout";
	
	TimeoutID = setTimeout(varFunc,500);
}

function Do_OverDelay()
{
	if(LastEvent == "mouseout" && TimeoutID != ""){
		window.clearTimeout(TimeoutID)
		
		TimeoutID = "";
	}
	
	LastEvent = "mouseover";
	
	var varFunc;
	
	varFunc = "MM_showHideLayers(";
	
	for(i=0;i<Do_OverDelay.arguments.length;++i)
	{
		if(i > 0)
			varFunc += ",";
			
		varFunc += "'"+ Do_OverDelay.arguments[i] +"'";
	}
	
	varFunc += ")";
	
	setTimeout(varFunc,1);
}




function Do_OutDelay2()
{
	var varFunc;
		
	varFunc = "MM_Out_showHideLayers(";
	
	for(i=0;i<Do_OutDelay2.arguments.length;++i)
	{
		if(i > 0)
			varFunc += ",";
			
		varFunc += "'"+ Do_OutDelay2.arguments[i] +"'";
	}
	
	varFunc += ")";
	
	LastEvent2 = "mouseout";
	
	TimeoutID2 = setTimeout(varFunc,500);
}

function Do_OverDelay2()
{
	if(LastEvent2 == "mouseout" && TimeoutID2 != ""){
		window.clearTimeout(TimeoutID2)
		
		TimeoutID2 = "";
	}
	
	LastEvent2 = "mouseover";
	
	var varFunc;
	
	varFunc = "MM_showHideLayers(";
	
	for(i=0;i<Do_OverDelay2.arguments.length;++i)
	{
		if(i > 0)
			varFunc += ",";
			
		varFunc += "'"+ Do_OverDelay2.arguments[i] +"'";
	}
	
	varFunc += ")";
	
	setTimeout(varFunc,1);
}

function MM_openBrWindow(theURL,winName) { //v2.0
  
  if(theURL != "doFlip()")
  	window.open(theURL,winName);
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() 
{ 
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	
	for (i=0; i<(args.length-2); i+=3)
	{ 
		if ((obj=MM_findObj(args[i]))!=null) 
		{ 
			v=args[i+2];

			if (args[i].indexOf("Option1_") > -1)
			{
				if (MainSelectedDiv != "Main_"+ args[i])
				{
					var objTD = MM_findObj("Main_"+ args[i]);
					
					if (v == "show")
					{			
						objTD.style.backgroundImage = MainOverImage;
						objTD.style.color = MainOverTxtColor;
					}	
					else
					{
						objTD.style.backgroundImage = MainOutImage;
						objTD.style.color = MainOutTxtColor;
					}
				}		
			}
			
			if (obj.style) 
			{ 
				obj=obj.style; 
				
				if (v == "show")
				{
					obj.visibility = "visible";
					obj.display = "";
				}
				else
				{
					obj.visibility = "hidden";
					obj.display = "none";
				}
			}
		}
	}	
}

function MM_Out_showHideLayers() 
{
	var i,p,v,obj,args=MM_Out_showHideLayers.arguments;
	
	for (i=0; i<(args.length-2); i+=3)
	{
	 	if ((obj=MM_findObj(args[i]))!=null) 
		{
			v=args[i+2];

			if (args[i].indexOf("Option1_") > -1)
			{
				if (MainSelectedDiv != "Main_"+ args[i])
				{
					var objTD = MM_findObj("Main_"+ args[i]);
					
					if (v == "show")
					{			
						objTD.style.backgroundImage = MainOverImage;
						objTD.style.color = MainOverTxtColor;
					}	
					else
					{
						objTD.style.backgroundImage = MainOutImage;
						objTD.style.color = MainOutTxtColor;
					}
				}		
			}
			
			if (obj.style) 
			{ 
				obj=obj.style; 
				
				if (v == "show")
				{
					obj.visibility = "visible";
					obj.display = "";
				}
				else
				{
					obj.visibility = "hidden";
					obj.display = "none";
				}
			}
		}
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function ChangeBG(obj,varBGColor,varTxtColor)
{
	obj.style.backgroundColor 	= varBGColor;
	obj.style.color 			= varTxtColor;
}

function ChangeBorder(obj,varTop,varRight,varBottom,varLeft)
{
	obj.style.borderColor = varTop +" "+ varRight +" "+ varBottom +" "+ varLeft;
}

function Diary_BGColor(varDiv, varColor)
{
	if (MM_findObj(varDiv) != null)
		MM_findObj(varDiv).style.backgroundColor = varColor;
}

function SetSelectedMenu(varDiv)
{
	MainSelectedDiv = varDiv;

	var objTD = MM_findObj(MainSelectedDiv);
	
	if (objTD != null)
	{			
		objTD.style.backgroundImage = MainOverImage;
		objTD.style.color = MainOverTxtColor;	
	}	
}

