// global variables

var objTimeOut=1;



//browser sniffer

var agt=navigator.userAgent.toLowerCase();

var is_mac    = (agt.indexOf("mac")!=-1);

var is_major  = parseInt(navigator.appVersion);

var is_minor = parseFloat(navigator.appVersion);

var msie_vers_start = agt.indexOf("msie")+5;

var msie_real_vers = parseFloat(agt.substring(msie_vers_start, msie_vers_start+3));

var is_linux  = (agt.indexOf("inux")!=-1);

var is_nav    = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));

var is_nav6   = (is_nav && (agt.indexOf('netscape6') != -1));

var is_nav41up = (is_nav && (is_minor >= 4.1));

var is_ie     = (agt.indexOf("msie") != -1);

var is_ie3    = (is_ie && (is_major < 4));

var is_ie4    = (is_ie && (is_major == 4) && (msie_real_vers < 5));

var is_ie4up  = (is_ie  && (is_major >= 4));

var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);

var is_aol    = (agt.indexOf("aol") != -1);

var is_aol4   = (is_aol && is_ie3);







function show(id) {

    if (document.all){

        document.all[id].style.visibility='visible';}

    else if (document.layers){

        document.layers[id].visibility='show';}

    else

        document.getElementById(id).style.visibility='visible';

}



function hide(id) {

    if (document.all)

        document.all[id].style.visibility='hidden';

    else if (document.layers)

        document.layers[id].visibility='hide';

    else

        document.getElementById(id).style.visibility='hidden';

}



function bgChange(id, color)

{

    if (document.all)

    {

    document.all[id].style.backgroundColor=color;

    }

    else if (document.layers)

    {

    document.layers[id].bgColor=color;

    }
    else
        document.getElementById(id).style.backgroundColor=color;
}





function toggleOption(state){

    if(state){

        if (document.all){

            if(document.all.contactForm)

                {

                hide('contactForm');

                }

        }

        else if (document.layers) {

            if(document.contactForm)

                {

                hide('contactForm');

                }

        }

    }

    else {

        if (document.all){

            if(document.all.contactForm)

                {

                show('contactForm');

                }

        }

        else if (document.layers) {

            if(document.contactForm)

                {

                show('contactForm');

                }

        }

    }



}



function doMenu(state,imgName){



divName = imgName.substring(4);



layerName = divName.substring(3);

layerName = layerName.toLowerCase();









if(state){

    if(document.layers){

            if (objTimeOut) {clearTimeout(objTimeOut);

            toggleOption(1);

            }



        }

    show(divName);



}else{



    hide(divName);

        if(document.layers){

            objTimeOut = setTimeout("toggleOption(0)",900);

        }

}

    return true;

}





function doInit(){

 //does all initialization for menuing system

 //


	//alert("doc.all title = " + document.all.menu1.title);
	var jg = 0;
	if(document.getElementById("menu1").title == "director")
	{
		jg = 13;
	}
	else
	{
		jg = 13;
	}
    for(j=1; j<=jg; j++){

        var color = ((Math.floor(j/2))==(Math.ceil(j/2))) ? '003366':'003366';

    

        if(document.layers){

            // hook functions to mouse events for NS Nav

        	eval("document.menu"+j+".onmouseover=new Function(\"bgChange('menu"+j+		 "','006699');doMenu(1,'img_subMenu"+j+"');\")");

        	eval("document.subMenu"+j+".onmouseover=new Function(\"bgChange('menu"+j+		 "','006699');doMenu(1,'img_subMenu"+j+"')\")");

            eval("document.menu"+j+".onmouseout=new Function(\"bgChange('menu"+j+		 "','#"+color+"');doMenu(0,'img_subMenu"+j+"')\")");

        	eval("document.subMenu"+j+".onmouseout=new Function(\"bgChange('menu"+j+		 "','#"+color+"');doMenu(0,'img_subMenu"+j+"')\")");

            // set bg color for NS Nav here

            eval("document.menu"+j+".bgColor='#"+color+"'");

            eval("document.subMenu"+j+".bgColor='#FFFFFF'");

    

        } else if(document.all){

            // set bg color for IE here
			//alert("next " + j);
            eval("document.all.menu"+j+".style.backgroundColor='#"+color+"';");
			if(j < 13)
            eval("document.all.subMenu"+j+".style.backgroundColor='#FFFFFF';");
			//alert("after " + j);

        } else {
            // set bg color for other browsers that follow HTML standards here
            eval("document.getElementById('menu"+j+"').style.backgroundColor='#"+color+"';");
            if(jg < 13)
            eval("document.getElementById('subMenu"+j+"').style.backgroundColor='#FFFFFF';");
        }

    }



}







// The following functions were copied from the ones above and

//   "Static" added to their names, because the search results and

//   "email complete" web pages need static image addresses.



function doMenuStatic(state,imgName){

divName = imgName.substring(4);

layerName = divName.substring(3);

layerName = layerName.toLowerCase();









if(state){

    if(document.layers){

            if (objTimeOut) {clearTimeout(objTimeOut);

            toggleOption(1);

            }



        }

    show(divName);



}else{



    hide(divName);

        if(document.layers){

            objTimeOut = setTimeout("toggleOption(0)",900);

        }

}

    return true;

}







function doInitStatic(){

 //does all initialization for menuing system

 
	var jg = 0;
	if(document.all.menu1.title == "director")
	{
		jg = 13;
	}
	else
	{
		jg = 13;
	}
    for(j=1; j<=jg; j++){

    var color = ((Math.floor(j/2))==(Math.ceil(j/2))) ? '003366':'003366';



    if(document.layers){

    // hook functions to mouse events for NS Nav

    eval("document.menu"+j+".onmouseover=new Function(\"bgChange('menu"+j+       "','006699');doMenuStatic(1,'img_subMenu"+j+"');\")");

    eval("document.subMenu"+j+".onmouseover=new Function(\"bgChange('menu"+j+        "','006699');doMenuStatic(1,'img_subMenu"+j+"')\")");

eval("document.menu"+j+".onmouseout=new Function(\"bgChange('menu"+j+        "','#"+color+"');doMenuStatic(0,'img_subMenu"+j+"')\")");

    eval("document.subMenu"+j+".onmouseout=new Function(\"bgChange('menu"+j+         "','#"+color+"');doMenuStatic(0,'img_subMenu"+j+"')\")");

        // set bg color for NS Nav here

eval("document.menu"+j+".bgColor='#"+color+"'");

eval("document.subMenu"+j+".bgColor='#FFFFFF'");



        } else if(document.all){

        // set bg color for IE here



eval("document.all.menu"+j+".style.backgroundColor='#"+color+"';");
if(j < jg)
eval("document.all.subMenu"+j+".style.backgroundColor='#FFFFFF';");



        }

        }



}




