var theFade;


/////////// BROWSER DETECTION ///////////
var theBrowser;
detectBrowser();
function detectBrowser()
{
	//NN4 ONLY
	if (document.layers) {
		theBrowser = "nn4";
	}
	//NN6 or IE6
	else if (document.getElementById) {
		if(navigator.appName == 'Microsoft Internet Explorer')
		{
			theBrowser = "ie4";
		}
		if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 5))
		{
			theBrowser = "nn6";
		} 
	}
		//IE4 OR HIGHER
	else if (document.all) {
		theBrowser = "ie4";
	}
	//alert("This browser is: " + navigator.appName + ", version: " + navigator.appVersion);
}


//THIS IS THE ONLY EDITABLE PART OF THE JAVASCRIPT; JUST ADD THE CATEGORY NAME HERE
theMenues = new Array("Conference","Expo","Event_Details","Registration");


/////////// TIMEOUT/VISIBILITY FUNCTION ///////////
var checkDivStatus;
var theTimeOut;

function placeDivs(categoryName, categoryHeight)
{
     var menucheck = false;

     for(i = 0; i < theMenues.length; i++)
     {
         if(theMenues[i] == categoryName)
         {
             menucheck = true;
         }
     }

     if(menucheck == true)
     {
         clearTimeout(theTimeOut);
         if(categoryHeight == undefined)
         {
             categoryHeight = 0;
         }


         for(i=0; i < theMenues.length; i++)
         {
             if(theMenues[i] != categoryName)
             {
                 categoryNameHide = theMenues[i];
                 checktheDivState();
             }
         }

         if(theBrowser == "nn4")
         {
             theHeight = eval(categoryHeight);
             eval("document." + categoryName +  
"Children.style.visibility = 'visible'");
         }
         else if(theBrowser == "ie4")
         {
             theHeight = eval(categoryHeight);
             eval("document.all." + categoryName +  
"Children.style.visibility = 'visible'");
         }
         else if(theBrowser == "nn6")
         {
             theHeight = eval(categoryHeight) + "px";
             document.getElementById(categoryName +  
"Children").style.opacity = .98;
             eval("document.getElementById('" + categoryName +  
"Children" + "').style.visibility = 'visible'");
         }
     }

}

/////////// HIDE DIVS FUNCTION ///////////
var timeOutLength = 600;
var categoryNameHide;
var categoryNameHide;

function hideDivs(categoryName)
{
     var menucheck = false;

     for(i = 0; i < theMenues.length; i++)
     {
         if(theMenues[i] == categoryName)
         {
             menucheck = true;
         }
     }

     if(menucheck == true)
     {
     checkDivStatus = "hide";
     categoryNameHide = categoryName;
     theTimeOut = setTimeout(checktheDivState, timeOutLength);
     }
}






/////////// CHECK DIV STATUS ///////////
function checktheDivState()
{
	if(checkDivStatus == "hide")
	{
		if(theBrowser == "nn4")
		{
			eval("document." + categoryNameHide + "Children.style.visibility = 'hidden'");
		}
		else if(theBrowser == "ie4")
		{
			eval("document.all." + categoryNameHide + "Children.style.visibility = 'hidden'");
		}
		else if(theBrowser == "nn6")
		{
			eval("document.getElementById('" + categoryNameHide + "Children').style.visibility = 'hidden'");
		}
	}
}