



//Browser Check

var browser;

browser=document.all?"ie":document.layers?"n4":"n6"



ie=document.all?1:0



var timeoutCount = 0;

hovering = false;



//How many menus do you have? start @ 0.

var numberOfMenus=4

//The width on the menus. Now done individually

//var mwidth=62

//The first menus left position - was 100

var fromLeft=300

//The top position of the menus

var fromTop=20

//The bgColor of the bottom mouseover div

var bgColor='#ffffff'

//The bgColor to change to

var bgColorChangeTo='#ffffff'



//Object constructor (make a new menu)

function makeNewsMenu(obj,nest) {



        nest=(!nest) ? '':'document.'+nest+'.'                              



        switch(browser){

           case 'ie':

              this.css=eval("document.all."+obj+".style");

              this.scrollHeight=eval('document.all.'+obj+'.offsetHeight');

           break;

           case 'n4':

              this.css=eval(nest+"document."+obj);

              this.scrollHeight=this.css.document.height;

           break;

           case 'n6':

              this.css=eval("document.getElementById('"+obj+"').style");

              this.scrollHeight=this.css.height;

           break;

        }



        this.moveIt=b_moveIt;this.bgChange=b_bgChange;

	this.obj = obj + "Object";  eval(this.obj + "=this")                

}



//Objects methods

function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}

function b_bgChange(color) {

   switch(browser){

      case 'ie':

         this.css.backgroundColor=color

      break;

      case 'n4':

         this.css.bgColor=color

      break;

      case 'n6':

         this.css.backgroundColor=color

      break;

   }

}



//Initiating the page, making cross-browser objects

function newsMenuInit(){



   oTopMenu=new Array()

   for(i=0;i<=numberOfMenus;i++){

		

      if (i==0) {mwidth=1}  // these numbers represent the spacing of the menu graphics - was 10,90, 112, 97, 110

      if (i==1) {mwidth=105}

      if (i==2) {mwidth=132}

      if (i==3) {mwidth=126}

      if (i==4) {mwidth=112}



      oTopMenu[i]=new Array()

      oTopMenu[i][0]=new makeNewsMenu('divTopMenu'+i)

      oTopMenu[i][2]=new makeNewsMenu('divTopMenuText'+i,'divTopMenu'+i)

      oTopMenu[i][0].moveIt(i*mwidth+fromLeft,fromTop)		    

      oTopMenu[i][0].css.visibility="visible"

      oTopMenu[i][2].css.visibility="hidden"

   }

}

//Moves the menu

function topMenu(num, noVis){



        hideMenus = true;

        if (noVis==1) {

		     timeoutCount=timeoutCount-1;

			 if (timeoutCount<0)

			      timeoutCount=0;

		     if (hovering==true | timeoutCount>0)

			      hideMenus = false;

			 if (browser=='n4')

			      hideMenus = false;

	    }

  

	    if (hideMenus == true) {

		     for(counter=0; counter<=numberOfMenus; counter++) {

                  oTopMenu[counter][2].css.visibility="hidden";

		     }

		}

		

		if (noVis!=1) {

		     hovering=true;

		     oTopMenu[num][2].css.visibility="visible";

        }

}



function pauseUp(num) {

   timeoutCount++;

   hovering=false;

   setTimeout('topMenu(' + num + ', 1)',500);

}



//Calls the init function onload

onload=newsMenuInit;






