//
// If you want ROLLOVERS for Hovering, then include these images.
//


window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var vendor = navigator.vendor;
 var agt=navigator.userAgent.toLowerCase();
 
 if (agt.indexOf('firefox')!=-1)
 {
 var FF1=true;
 }
 else
 {
 var FF1=false;
 }

 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4); 
 var menuActive = 0;
 var menuOn = 0;
 var onLayer;
 var timeOn = null   ; // LAYER SWITCHING CODE
if (NS4 || IE4) {
 if (navigator.appName == "Netscape" && ! FF1) {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{  
 layerStyleRef="layer.style.";
 layerRef="document.getElementById";
 styleSwitch=".style";
 }
}
 
// SHOW MENU
function showLayer(layerName){
	
if (NS4 || IE4) {	
 if (timeOn != null) {
 clearTimeout(timeOn)
 hideLayer(onLayer)
 }
 if (NS4 || IE4) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="visible"');
 }
 
 if (IE4) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.display="block"');
 } 
 
 onLayer = layerName
 }
}

// HIDE MENU
function hideLayer(layerName){

 if (menuActive == 0) {
 if (NS4) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="hidden"');
 }
 if (IE4) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.display="none"');
 }
 }
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000)
}



// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}

// MENU MOUSE OVER 
function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
 //setTimeout("hideLayer(itemName)",1000)
}

// MENU MOUSE OUT 
function menuOut(itemName) {
 pausecomp(100)
 menuActive = 0 
 timeOn = setTimeout("hideLayer(onLayer)", 100)
 }
 
 function pausecomp(millis) 
{
var date = new Date();
var curDate = null;

do { curDate = new Date(); } 
while(curDate-date < millis);
} 
