//Establish Browser Version
var n = (navigator.appName == "Netscape")
var n4 = (document.layers) ? 1:0
var ie = (navigator.appName == "Microsoft Internet Explorer")
var ie4 = (document.all) ? 1:0
var browserName = navigator.appName;

var rolloversOK = 0;
browserVer = parseInt(navigator.appVersion);
if (n && browserVer >= 3) rolloversOK = 1;
else if (ie && browserVer >= 4) rolloversOK = 1;

if (n4)
{
	// Test for Unix NS4 version and don't allow DHTML elements in it
	if (navigator.appVersion.indexOf("X11") >= 0)
	{
		n4 = 0;
	}
}
else if (ie4)
{
	// Test for Mac IE4 version and don't allow DHTML elements in it
 	if ((navigator.appVersion.indexOf("Macintosh") >= 0) || (navigator.appVersion.indexOf("Mac_") >= 0))
 	{
		ie4 = 0;
	}
}

//More Variables
var theTimeout = setTimeout("","1");
var version = "no";
var top_adjust = 0;
var offset;
var browserWidth;
var browserOffset;
var pageWidth = 800;

if (n4)
{
	version = "ok";
	top_adjust = 4;
}

else if (ie4)
{
        version = "ok";
        top_adjust = 5;
}

// The Popup Menu Variables
var totalMenus = 6;
var menuPosX = 195;
var menuPosY = new Array(totalMenus);
var itemsOnMenu = new Array(totalMenus);
var menuItems = new Array(totalMenus);
var urlLinks = new Array(totalMenus);
var lastMenu = -99;
var lastHotItem = -99;
var moveOver = 0;
var bgHot = "#FFB871";

//The Above color is different for each Nav Bar
var bgNormal = "#ffffff";


// MENU 1: Liz Match
// Y coordinate of the popup menu
menuPosY[1] = 480  + top_adjust;
itemsOnMenu[1] = 4; //number of menu items

menuItems[1] = new Array(itemsOnMenu[1]);
urlLinks[1] = new Array(itemsOnMenu[1]);

menuItems[1][0] = "Metros";
urlLinks[1][0] = "http://www.thenewspapertoday.com/city/index.shtml?\" target=\"_parent";

menuItems[1][1] = "Delhi";
urlLinks[1][1] = "http://www.thenewspapertoday.com/city/delhi.phtml?\" target=\"_parent";

menuItems[1][2] = "Bombay";
urlLinks[1][2] = "http://www.thenewspapertoday.com/city/mumbai.phtml?\" target=\"_parent";

menuItems[1][3] = "Bangalore";
urlLinks[1][3] = "http://www.thenewspapertoday.com/city/bangalore.phtml?\" target=\"_parent";

//Menu 12
menuPosY[12] = 140  + top_adjust;
itemsOnMenu[12] = 1; //number of menu items

menuItems[12] = new Array(itemsOnMenu[1]);
urlLinks[12] = new Array(itemsOnMenu[1]);


menuItems[12][0] = "Political Buzz";
urlLinks[12][0] = "http://www.thenewspapertoday.com/india/peep.phtml?PEEP=PEEP/PEEP \" target=\"_parent";


//Menu 2
menuPosY[2] = 252  + top_adjust;
itemsOnMenu[2] = 5; //number of menu items

menuItems[2] = new Array(itemsOnMenu[4]);
urlLinks[2] = new Array(itemsOnMenu[4]);

menuItems[2][0] = "Rebuilding Afghanistan";
urlLinks[2][0] = "http://www.thenewspapertoday.com/specials/index.phtml?SPECIALS=AFGAN/AFGAN\" target=\"_parent";

menuItems[2][1] = "State of Kashmir";
urlLinks[2][1] = "http://www.thenewspapertoday.com/specials/index.phtml?SPECIALS=KASHMIR/KASHMIR \" target=\"_parent";

menuItems[2][2] = "Northeast Knot";
urlLinks[2][2] = "http://www.thenewspapertoday.com/specials/index.phtml?SPECIALS=NORTHEAST/NORTHEAST \" target=\"_parent";

menuItems[2][3] = "Inside Parliament";
urlLinks[2][3] = "http://www.thenewspapertoday.com/specials/index.phtml?SPECIALS=PARLIAMENT/PARLIAMENT&<?=session_name()?>=<?=session_id()?> \" target=\"_parent";

menuItems[2][4] = "Archives";
urlLinks[2][4] = "http://www.thenewspapertoday.com/specials/index.phtml?SPECIALS=SP_ARCHIVES&<?=session_name()?>=<?=session_id()?> \" target=\"_parent";


menuPosY[3] = 460  + top_adjust;
itemsOnMenu[3] = 7; //number of menu items

menuItems[3] = new Array(itemsOnMenu[4]);
urlLinks[3] = new Array(itemsOnMenu[4]);

menuItems[3][0] = "Sports";
urlLinks[3][0] = "http://www.thenewspapertoday.com/sports/";
menuItems[3][1] = "War Games";
urlLinks[3][1] = "http://www.thenewspapertoday.com/sports/sports.phtml?SPORTS=WARGAMES/INDEX\" target=\"_parent";
menuItems[3][2] = "Aussies in India";
urlLinks[3][2] = "http://www.thenewspapertoday.com/sports/sports.phtml" ;
menuItems[3][3] = "Wills Open Golf";
urlLinks[3][3] = "http://www.thenewspapertoday.com/sports/golf/golf.phtml";
menuItems[3][4] = "India in Zimbabwe";
urlLinks[3][4] = "http://www.thenewspapertoday.com/sports/sports.phtml?SPORTS=ZIMBABWE/INDEX";
menuItems[3][5] = "India in Sri Lanka";
urlLinks[3][5] = "http://www.thenewspapertoday.com/sports/sports.phtml?SPORTS=LANKA/INDEX\" target=\"_parent";
menuItems[3][6] = "Lions in Winter";
urlLinks[3][6] = "http://www.thenewspapertoday.com/sports/sports.phtml?SPORTS=ENGLAND/INDEX\" target=\"_parent";


//menu 4 budget
menuPosY[4] = 253  + top_adjust;
itemsOnMenu[4] = 11; //number of menu items

menuItems[4] = new Array(itemsOnMenu[4]);
urlLinks[4] = new Array(itemsOnMenu[4]);


menuItems[4][0] = "The Budget 2001";
urlLinks[4][0] = "http://www.thenewspapertoday.com/index.htmlason010301";

menuItems[4][1] = "The Railway Budget 2001";
urlLinks[4][1] = "/budget/budget.phtml?BGT=INDX/RAILWAYNEWS";

menuItems[4][2] = "The Eco Survey";
urlLinks[4][2] = "/budget/budget.phtml?BGT=INDX/SURVEYINDEX";

menuItems[4][3] = "The Scoops";
urlLinks[4][3] = "/budget/";

menuItems[4][4] = "The Analyses";
urlLinks[4][4] = "/budget/budget.phtml?BGT=INDX/ANALYSES";

menuItems[4][5] = "The Sinha Budgets";
urlLinks[4][5] = "/budget/budget.phtml?BGT=INDX/SINHAINDEX";

menuItems[4][6] = "The Wishlists ";
urlLinks[4][6] = "/budget/budget.phtml?BGT=INDX/WISHLISTS";

menuItems[4][7] = "The Credit Policy ";
urlLinks[4][7] = "/budget/budget.phtml?BGT=INDX/CPOLICY";

menuItems[4][8] = "The Polls ";
urlLinks[4][8] = "/budget/budget.phtml?BGT=INDX/POLLS";

menuItems[4][9] = "Your Budget ";
urlLinks[4][9] = "javascript:wall('YourBudget')";

menuItems[4][10] = "The Glossary ";
urlLinks[4][10] = "/budget/budget.phtml?BGT=INDX/GLOSSARY";

//My Tools
menuPosY[5] = 75  + top_adjust;
itemsOnMenu[5] = 4; //number of menu items

menuItems[5] = new Array(itemsOnMenu[3]);
urlLinks[5] = new Array(itemsOnMenu[3]);

menuItems[5][0] = "My e-mail";
urlLinks[5][0] = "http://www.thenewspapertoday.com/mye-mail/\" target=\"_parent";
menuItems[5][1] = "My e-cards  ";
urlLinks[5][1] = "http://ntecards.thenewspapertoday.com\" target=\"_parent" ;
menuItems[5][2] = "My tax planner";
urlLinks[5][2] = "http://www.thenewspapertoday.com/taxcalc\" target=\"_parent" ;
menuItems[5][3] = "My portfolio tracker";
urlLinks[5][3] = "http://www.thenewspapertoday.com/tracker\" target=\"_parent" ;


//Menu 6
menuPosY[6] = 180  + top_adjust;
itemsOnMenu[6] = 4; //number of menu items

menuItems[6] = new Array(itemsOnMenu[2]);
urlLinks[6] = new Array(itemsOnMenu[2]);

menuItems[6][0] = "Nepal"; 
urlLinks[6][0] = "http://www.thenewspapertoday.com/salive/index.phtml?SALIVE=NEPAL\" target=\"_parent";
menuItems[6][1] = "Pakistan";
urlLinks[6][1] = "http://www.thenewspapertoday.com/salive/index.phtml?SALIVE=PAKISTAN\" target=\"_parent";
menuItems[6][2] = "Sri Lanka"; 
urlLinks[6][2] = "http://www.thenewspapertoday.com/salive/index.phtml?SALIVE=SRILANKA\" target=\"_parent";
menuItems[6][3] = "Bangladesh"; 
urlLinks[6][3] = "http://www.thenewspapertoday.com/salive/index.phtml?SALIVE=BANGLADESH\" target=\"_parent";


//My Tools
menuPosY[7] = 180  + top_adjust;
itemsOnMenu[7] = 5; //number of menu items

menuItems[7] = new Array(itemsOnMenu[3]);
urlLinks[7] = new Array(itemsOnMenu[3]);

menuItems[7][0] = "Assam";
urlLinks[7][0] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PARTIES_ASSAM\" target=\"_parent";
menuItems[7][1] = "Kerala";
urlLinks[7][1] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PARTIES_KERALA\" target=\"_parent" ;
menuItems[7][2] = "Pondicherry";
urlLinks[7][2] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PARTIES_PONDY\" target=\"_parent" ;
menuItems[7][3] = "Tamil Nadu";
urlLinks[7][3] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PARTIES_TAMILNADU\" target=\"_parent" ;
menuItems[7][4] = "West Bengal";
urlLinks[7][4] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PARTIES_BENGAL\" target=\"_parent" ;


//My Tools
menuPosY[8] = 180  + top_adjust;
itemsOnMenu[8] = 5; //number of menu items

menuItems[8] = new Array(itemsOnMenu[3]);
urlLinks[8] = new Array(itemsOnMenu[3]);

menuItems[8][0] = "Assam";
urlLinks[8][0] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=FRINGE_ASSAM\" target=\"_parent";
menuItems[8][1] = "Kerala";
urlLinks[8][1] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=FRINGE_KERALA\" target=\"_parent" ;
menuItems[8][2] = "Pondicherry";
urlLinks[8][2] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=FRINGE_PONDY\" target=\"_parent" ;
menuItems[8][3] = "Tamil Nadu";
urlLinks[8][3] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=FRINGE_TAMILNADU\" target=\"_parent" ;
menuItems[8][4] = "West Bengal";
urlLinks[8][4] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=FRINGE_BENGAL\" target=\"_parent" ;



//My Tools
menuPosY[9] = 180+ top_adjust;
itemsOnMenu[9] = 5; //number of menu items

menuItems[9] = new Array(itemsOnMenu[3]);
urlLinks[9] = new Array(itemsOnMenu[3]);

menuItems[9][0] = "Assam";
urlLinks[9][0] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PROFILES_ASSAM\" target=\"_parent";
menuItems[9][1] = "Kerala";
urlLinks[9][1] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PROFILES_KERALA\" target=\"_parent" ;
menuItems[9][2] = "Pondicherry";
urlLinks[9][2] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PROFILES_PONDY\" target=\"_parent" ;
menuItems[9][3] = "Tamil Nadu";
urlLinks[9][3] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PROFILES_TAMILNADU\" target=\"_parent" ;
menuItems[9][4] = "West Bengal";
urlLinks[9][4] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=PROFILES_BENGAL\" target=\"_parent" ;


//My Tools
menuPosY[10] = 180+ top_adjust;
itemsOnMenu[10] = 5; //number of menu items

menuItems[10] = new Array(itemsOnMenu[3]);
urlLinks[10] = new Array(itemsOnMenu[3]);

menuItems[10][0] = "Assam";
urlLinks[10][0] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=ANALYSYS_ASSAM\" target=\"_parent";
menuItems[10][1] = "Kerala";
urlLinks[10][1] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=ANALYSYS_KERALA\" target=\"_parent" ;
menuItems[10][2] = "Pondicherry";
urlLinks[10][2] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=ANALYSYS_PONDY\" target=\"_parent" ;
menuItems[10][3] = "Tamil Nadu";
urlLinks[10][3] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=ANALYSYS_TAMILNADU\" target=\"_parent" ;
menuItems[10][4] = "West Bengal";
urlLinks[10][4] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=ANALYSYS_BENGAL\" target=\"_parent" ;

 
//My Tools
menuPosY[11] = 180+ top_adjust;
itemsOnMenu[11] = 5; //number of menu items

menuItems[11] = new Array(itemsOnMenu[3]);
urlLinks[11] = new Array(itemsOnMenu[3]);

menuItems[11][0] = "Assam";
urlLinks[11][0] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=HOTSEATS_ASSAM\" target=\"_parent";
menuItems[11][1] = "Kerala";
urlLinks[11][1] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=HOTSEATS_KERALA\" target=\"_parent" ;
menuItems[11][2] = "Pondicherry";
urlLinks[11][2] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=HOTSEATS_PONDY\" target=\"_parent" ;
menuItems[11][3] = "Tamil Nadu";
urlLinks[11][3] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=HOTSEATS_TAMILNADU\" target=\"_parent" ;
menuItems[11][4] = "West Bengal";
urlLinks[11][4] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=HOTSEATS_BENGAL\" target=\"_parent" ;



//My Tools
menuPosY[13] = 180  + top_adjust;
itemsOnMenu[13] = 5; //number of menu items

menuItems[13] = new Array(itemsOnMenu[3]);
urlLinks[13] = new Array(itemsOnMenu[3]);

menuItems[13][0] = "Assam";
urlLinks[13][0] = "javascript:wall('assam')";
menuItems[13][1] = "Kerala";
urlLinks[13][1] = "javascript:wall('kerala')";
menuItems[13][2] = "Pondicherry";
urlLinks[13][2] = "javascript:wall('pondicherry')" ;
menuItems[13][3] = "Tamil Nadu";
urlLinks[13][3] = "javascript:wall('tamilnadu')" ;
menuItems[13][4] = "West Bengal";
urlLinks[13][4] = "javascript:wall('bengal')" ;



//My Tools
menuPosY[14] = 180  + top_adjust;
itemsOnMenu[14] = 5; //number of menu items

menuItems[14] = new Array(itemsOnMenu[3]);
urlLinks[14] = new Array(itemsOnMenu[3]);

menuItems[14][0] = "Assam";
urlLinks[14][0] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=INDEX_ASSAM\" target=\"_parent";
menuItems[14][1] = "Kerala";
urlLinks[14][1] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=INDEX_KERALA\" target=\"_parent";
menuItems[14][2] = "Pondicherry";
urlLinks[14][2] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=INDEX_PONDY\" target=\"_parent" ;
menuItems[14][3] = "Tamil Nadu";
urlLinks[14][3] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=INDEX_TAMILNADU\" target=\"_parent" ;
menuItems[14][4] = "West Bengal";
urlLinks[14][4] = "http://www.thenewspapertoday.com/election01/index.phtml?ELECTION01=INDEX_BENGAL\" target=\"_parent" ;


menuPosY[16] = 180  + top_adjust;
itemsOnMenu[16] = 6; //number of menu items

menuItems[16] = new Array(itemsOnMenu[3]);
urlLinks[16] = new Array(itemsOnMenu[3]);

menuItems[16][0] = "Shankar Aiyar";
urlLinks[16][0] = "http://www.thenewspapertoday.com/column/index.phtml?COLUMN=COLUMNIST_SAIYAR\" target=\"_parent";
menuItems[16][1] = "Tavleen Singh";
urlLinks[16][1] = "http://www.thenewspapertoday.com/column/index.phtml?COLUMN=COLUMNIST_TAVLEEN\" target=\"_parent";
menuItems[16][2] = "P. Chidambaram";
urlLinks[16][2] = "http://www.thenewspapertoday.com/column/index.phtml?COLUMN=COLUMNIST_CHIDAMBARAM\" target=\"_parent" ;
menuItems[16][3] = "Sanjoy Narayan";
urlLinks[16][3] = "http://www.thenewspapertoday.com/column/index.phtml?COLUMN=COLUMNIST_SNARAYAN\" target=\"_parent" ;
menuItems[16][4] = "Jairam Ramesh";
urlLinks[16][4] = "http://www.thenewspapertoday.com/column/index.phtml?COLUMN=COLUMNIST_JAIRAM\" target=\"_parent" ;
menuItems[16][5] = "Prabhu Chawla";
urlLinks[16][5] = "http://www.thenewspapertoday.com/column/index.phtml?COLUMN=COLUMNIST_PRABHU\" target=\"_parent" ;



menuPosY[17] = 210  + top_adjust;
itemsOnMenu[17] = 3; //number of menu items

menuItems[17] = new Array(itemsOnMenu[2]);
urlLinks[17] = new Array(itemsOnMenu[2]);

menuItems[17][0] = "Political buzz";
urlLinks[17][0] = "http://www.thenewspapertoday.com/buzz/index.phtml?BUZZ=POLITICAL\" target=\"_parent";
menuItems[17][1] = "Society buzz";
urlLinks[17][1] = "http://www.thenewspapertoday.com/buzz/index.phtml?BUZZ=SOCIAL\" target=\"_parent";
menuItems[17][2] = "Business buzz";
urlLinks[17][2] = "http://www.thenewspapertoday.com/buzz/index.phtml?BUZZ=BUSINESS\" target=\"_parent";







//Menu 15
menuPosY[15] = 560  + top_adjust;
itemsOnMenu[15] = 1; //number of menu items

menuItems[15] = new Array(itemsOnMenu[1]);
urlLinks[15] = new Array(itemsOnMenu[1]);

menuItems[15][0] = "Wimbledon 2001";
urlLinks[15][0] = "http://www.thenewspapertoday.com/wsports/wimble.phtml?WSPORTS=WIMBLEDON/WIMBLEDON";

// POPUP MENU FUNCTIONS
function doPopup (whichMenu, whichHotItem)
{
        if (version != "ok")
        {return}

		//Moves menu over from left of window
      if (whichMenu == 5)
        	{ moveOver = 524; }
        	 if (whichMenu == 6)
        	{ moveOver = 420; }
        if (whichMenu == 1)
	        { moveOver = 448; }
        	else if (whichMenu == 2)
        		{ moveOver = 395; }
        		else if (whichMenu == 3)
        		{ moveOver = 420; }
			        else if (whichMenu == 4)
			        	{ moveOver = 382; }
			else if (whichMenu == 7)
			        	{ moveOver = 133; }
			else if (whichMenu == 8)
			        	{ moveOver = 195; }
			else if (whichMenu == 9)
			        	{ moveOver = 260; }
			else if (whichMenu == 10)
			        	{ moveOver = 315; }
			else if (whichMenu == 11)
			        	{ moveOver = 375; }
			else if (whichMenu == 13)
			        	{ moveOver = 490; }
			else if (whichMenu == 14)
			        	{ moveOver = 78; }
			else if (whichMenu == 15)
			        	{ moveOver = 418; }			        	
			else if (whichMenu == 12)
			        	{ moveOver = 423; }			 	
			else if (whichMenu == 16)
			        	{ moveOver = 423; }			 	
			else if (whichMenu == 17)
			        	{ moveOver = 405; }			 	


	//Clears the HidePopup timeout
        clearTimeout(theTimeout);

	// DO WE HAVE TO RE-DRAW THE MENU?
        newMenu = 0

        if (whichMenu != lastMenu)
        {
                lastMenu = whichMenu
                newMenu = 1
        }
        else if (whichHotItem != lastHotItem)
        {
                newMenu = 1
        }

	// RE-DO THE POPUP TABLE, IF NECESSARY
        if (newMenu)
        {
                lastHotItem = whichHotItem
                popupWidth = "100";
                insideWidth = "98";

			//Adjusts the size of each of the popup menus according to the size of text
                 if ((whichMenu == 5))
	                     { popupWidth = "98"; insideWidth = "96"; bgHot = "#FFFFFF";}

	 if ((whichMenu == 7))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 8))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 9))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 10))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 11))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 13))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 14))
               { popupWidth = "72"; insideWidth = "70"; bgHot = "#CCCCCC";}
               if ((whichMenu == 15))
               { popupWidth = "98"; insideWidth = "96"; bgHot = "#99cc33";}
               if ((whichMenu == 12)) //sahara
	       { popupWidth = "84"; insideWidth = "82"; bgHot = "#99CC99";}
		  if ((whichMenu == 16)) //sahara
	       { popupWidth = "90"; insideWidth = "88 "; bgHot = "#FF0000";}
		  if ((whichMenu == 17)) //TNT Buzz
	       { popupWidth = "110"; insideWidth = "108 "; bgHot = "#8A418A";}

  	 if ((whichMenu == 6))
               { popupWidth = "92"; insideWidth = "90"; bgHot = "#336699";}
               if ((whichMenu == 2)) //sports
               { popupWidth = "122"; insideWidth = "120"; bgHot = "#99CC99";}

               if ((whichMenu == 3)) //sahara
               { popupWidth = "92"; insideWidth = "90"; bgHot = "#99cc33";}

		if ((whichMenu == 1) )
		{ popupWidth = "67"; insideWidth = "65"; bgHot = "#FFB871";}

		if ((whichMenu == 4)) //sahara
               { popupWidth = "132"; insideWidth = "130"; bgHot = "#FBD7B4";}

			//the size of the height of each tr (leave alone)
                popupHeight = (itemsOnMenu[whichMenu] * 16)

			//theTable is a variable that holds the string of the entire table of the Popups

                theTable  = '<table width=' + popupWidth + ' height=' + (popupHeight + 3) + ' bgcolor=#000000 cellpadding=0 cellspacing=0 border=0><tr><td>\n'

                theTable += '<table align="center" valign="center" width=' + insideWidth + ' height=' + popupHeight + ' bgcolor=' + bgNormal + ' cellspacing=0 cellpadding=0 border=0>\n'

            theTable += '<tr bgcolor=#000000><td width="100%" height=1></td></tr>\n'

            for (x = 0;x<itemsOnMenu[whichMenu];x++)
            {
                        bg2Use = bgNormal; class2Use = "notHot";
                        if (x == whichHotItem)
                        { bg2Use = bgHot; class2Use = "notHot"; }

                        theTable += '<tr bgcolor=' + bg2Use + '><td height=15><a href="' + urlLinks[whichMenu][x] + '" class="' + class2Use + '" onMouseOver="doPopup(' + whichMenu + ',' + x + ');" onMouseOut="hideTime();">&nbsp;' + menuItems[whichMenu][x] + '</a></td></tr>\n'

                        if (x != itemsOnMenu[whichMenu])
                        { theTable += '<tr bgcolor=#000000><td width="100%" height=1></td></tr>\n' }
           }
                theTable += '</table>\n</td></tr></table>\n'

			//Check for N4 and writes to the Layer tag
              if (n4)
                {
                        browserWidth = window.innerWidth;
                        browserOffset = 20;

        	             offset = (browserWidth - pageWidth)/2 + moveOver - 2;

				       	menuPosX = 177 + moveOver;

                        whichLayer = "nsPopup"
                        document.layers[whichLayer].visibility = 'hide'
                        document.layers[whichLayer].document.write(theTable)
                        document.layers[whichLayer].document.close()

                        if (whichHotItem == -1)
                        {
                                document.layers["nsBuffer"].visibility = 'hide'
                                document.layers["nsBuffer"].document.write(theTable)
                                document.layers["nsBuffer"].document.close()
                                document.layers["nsBuffer"].moveTo(menuPosX, menuPosY[whichMenu])
                                document.layers["nsBuffer"].visibility = 'show'
                        }

                        document.layers[whichLayer].moveTo(menuPosX, menuPosY[whichMenu])
                        document.layers[whichLayer].visibility = 'show'
                }

					//Checks for IE4 and writes to the Div tag
                else if (ie4)
                {
                        browserWidth = parseInt(document.body.offsetWidth);
                        browserOffset = 20;

					offset = (browserWidth - pageWidth)/2 + moveOver;

				//X coordinate of the popup menu
				        menuPosX = 157 + moveOver;

                        whichLayer = "iePopup"
                        document.all[whichLayer].innerHTML = theTable
                        document.all[whichLayer].style.posLeft = menuPosX
                        document.all[whichLayer].style.posTop = menuPosY[whichMenu]
                        document.all[whichLayer].style.visibility = 'visible'
                }
        }
}

function hideTime()
{
        theTimeout = setTimeout("hidePopups()", "500");
}

function hidePopups ()
{
  if (version != "ok")
  {return}

  lastMenu = -99
  lastHotItem = -99
  if (n4)
  {
       document.layers["nsPopup"].visibility = "hide";
        document.layers["nsBuffer"].visibility = "hide";
  }
  else if (ie4)
  {
        document.all["iePopup"].style.visibility = 'hidden';
  }
}

