
var toggleswitch=0;
var Mac  =  (navigator.userAgent.indexOf("mac")!=-1)  || (navigator.userAgent.indexOf("Mac")!=-1);
var opnew = (navigator.userAgent.indexOf('Opera 7')!=-1);
var opold = (navigator.userAgent.indexOf('Opera')!=-1);
var msie  =  (navigator.userAgent.indexOf('MSIE')!=-1);
var moz  =  (navigator.userAgent.indexOf('Gecko')!=-1);
var NS6  =  (navigator.userAgent.indexOf('Netscape')!=-1 && navigator.userAgent.indexOf('Gecko')!=-1);
var Nav4  = (document.layers); 
var konq = (navigator.userAgent.indexOf('Konqueror')!=-1); 
if (opold && msie || opold){var opold=1; msie=0;} 
if (msie && !opold){msie=1;}
if(opnew && opold){opold=0;}
if(msie || moz || opnew){var dom = 1;}
var stopshow=0;
var noway=0;

if(konq){noway=1}

var timerID=null
var timerID2=null
var stopclose=1;
var whatsopen = "none";
var operaload=0;
var isform="no";
var menutop=0;
var menuleft=0;
var nsmenutop=0;
var nsmenuleft=0;

if (Nav4) {
    window.captureEvents(Event.MOUSEMOVE);
    window.onmousemove=move;
}
function move(e) {
nsmenuleft=e.pageX;
nsmenutop=e.pageY;
nsmenuleft1-=0;
nsmenutop-=0;
}

//###################################################
function startup(){
if(noway){return;}
if (msie && !Mac)
        {       
for(var i = 0 ; i <= howmanymenus ; i++){
toggle2(menunames[i]);}
        }
 else
       {return false;}
}
//End Startup function
//###################################################


//###################################################
function toggle(whatmenu,isMain){
if(noway){return;}
getpositions(); 
if (isMain==1){

	if(timerID){clearTimeout(timerID);}
	
	if (whatsopen == "none"){
	toggle2(whatmenu);
	
	isMain=0;
	}

	if(whatsopen == whatmenu){
	isMain=0;
	}

	if(whatsopen != whatmenu && whatsopen != "none"){
	toggle2(whatsopen);
	toggle2(whatmenu);
	isMain=0;
	}
if(timerID2){clearTimeout(timerID2)}
timerID2=setTimeout("toggle2('"+whatmenu+"');",30000);
return;
}
if(isMain==0){
	if(whatsopen != "none" && isMain!=1){
	toggle2(whatmenu);
	}
}
}
//###################################################


//###################################################

function toggle2(whatmenu)
{
if(noway){return;}

//================================================
        if (msie)
        {       
                if(effectopen != -1 && effectclose != -1){      
                eval(whatmenu+".filters(0).Apply();");
                }
				
                if (eval(whatmenu+".style.visibility") == 'hidden')
                {
         	               eval(whatmenu+".style.visibility='visible';");                        
                        eval(whatmenu+".filters[0].transition=effectopen");                        
                        whatsopen=whatmenu;                     
                }
                else
                {
				
                        eval(whatmenu+".style.visibility = 'hidden';");
                        
                        eval(whatmenu+".filters[0].transition=effectclose");
                        
                        whatsopen="none";
                }       
            if(effectopen != -1 && effectclose != -1){    
            eval(whatmenu+".filters(0).Play();");
       		 }
        }
//================================================


//================================================      
if (opold)
{
if (toggleswitch==0)
  {
			eval(whatmenu+".style.visibility='visible';");
			toggleswitch=1;
			whatsopen=whatmenu;
			return;
		}
			if (toggleswitch==1)
			{
			 eval(whatmenu+".style.visibility = 'hidden';");
			 toggleswitch=0;
			 whatsopen="none";
			 return;
   	}               
        
}
//================================================


//================================================
if(Nav4){

if (toggleswitch==0){

eval("document['"+whatmenu+"'].top="+nsmenutop);
eval("document['"+whatmenu+"'].left="+nsmenuleft+"+20");

document.layers[whatmenu].visibility='visible';           
toggleswitch=1;
whatsopen=whatmenu;
return;
}
		if (toggleswitch==1){
		document.layers[whatmenu].visibility='hidden';              
		toggleswitch=0;
		whatsopen="none";
		return;
		}
}
//================================================


//================================================
if (moz || opnew)
        {
        if(toggleswitch == 0){
					eval("document.getElementById('"+whatmenu+"').style.visibility = 'visible';");
					toggleswitch=1;
					whatsopen=whatmenu;
					return;}
    if(toggleswitch == 1){
			eval("document.getElementById('"+whatmenu+"').style.visibility = 'hidden';");toggleswitch=0;whatsopen="none";return;}
     }
//================================================
}



//###################################################
function goSub(where,what,tgt)
{
stopshow=-1;
clearTimeout(timerID);
clearTimeout(timerID2);
   
if(effectopen!=-1 || effectclose!=-1){toggle2(what);}        
        if(tgt == ''){whereto= "location.href='"+where+"'";}    
        if(tgt == 'new'){whereto= "window.open('"+where+"','"+tgt+"');";}       
        if(tgt != 'new' && tgt != ''){whereto= "parent."+tgt+".location.href='"+where+"'";}
        setTimeout("eval(whereto)",550);
}
//###################################################



//###################################################
function getpositions(){
if(noway){return;}
if (Nav4 || NS6){
docwidth = window.innerWidth;docwidth-=0; }
if(msie || (moz && !NS6) || konq || opold || opnew ){
docwidth = document.body.clientWidth;
docwidth-=0;
}

//================================================      
if (dom){
var menutop = document.getElementById('navbar').offsetTop;
var menuleft = document.getElementById('navbar').offsetLeft;
var menuheight = document.getElementById('navbar').offsetHeight;

menuleft += navwidth[0]+5;menutop += cellpad;
      
for(var i = 0 ; i <= howmanymenus ; i++){
	
	eval("document.getElementById('"+menunames[i]+"').style.left="+menuleft);
	eval("document.getElementById('"+menunames[i]+"').style.top="+menutop);  
	
	menutop += buttonheight+cellpad+cellpad;
	if(moz){menutop += cellpad;}
}
//================================================

//###################################################
}
}

function killMenu(whatwait){
if(noway){return;}
if(stopshow==-1){return;}
if(timerID){clearTimeout(timerID)}
if(timerID2){clearTimeout(timerID2)}
timerID=setTimeout("toggle2('"+whatwait+"');",500);
}
function checkMenu(){
if(noway){return;}
if(stopshow==-1){return;}
if(timerID){clearTimeout(timerID)}
if(timerID2){clearTimeout(timerID2)}
}

//End of Script
// Get updates and fixes @ http://www.dropmenu.co.uk
//Please leave these comments intact
