//Global variables
var b;  //Browser type (Netscape = N, MSIE = I, Macintosh = M, Other = O)
var v;	//Browser version (Netscape & IE versions 4.X = 1, IE 5.X = 2, all others = 0)
var dd; //If clients browser supports Drop Down Menus dd = TRUE, otherwise dd = FALSE

var vNumMenus = 5; //Number of drop down menus created
getBrowserInfo();

if (b == "N") {
//  Initialize position variables according to the users screen resolution
if (screen.height == 768 && screen.width == 1024) {
	// 1024 x 768
	var vMainMenuTop = 150; //Screen position of top of Main Menu Bar
	var vMainMenuBot = 200; //Screen position of Bottom of Main Menu Bar
	var vNGet = 150; //Value sent to Netscape GetY() function
	var vIGet = 158; //Value sent to Internet Exporer GetY() function
	if (v == 4.5) {
		var vNDDTop = 80; 
		//Value of the Drop Down Menu Tops for Netscape browsers
	}else 
		var vNDDTop = 80; 
		//Value of the Drop Down Menu Tops for Netscape browsers
	}
else if (screen.height == 480 && screen.width == 640) {
	// 640 x 480
	var vMainMenuTop = 100; //Screen position of top of Main Menu Bar
	var vMainMenuBot = 200; //Screen position of Bottom of Main Menu Bar
	var vNGet = 132; //Value sent to Netscape GetY() function
	var vIGet = 158; //Value sent to Internet Exporer GetY() function
	if (v == 4.5) {
		var vNDDTop = 80; 
		//Value of the Drop Down Menu Tops for Netscape browsers
	}else 
		var vNDDTop = 80; 
		//Value of the Drop Down Menu Tops for Netscape browsers
	}
else {
	// 800 x 600
	var vMainMenuTop = 300; //Screen position of top of Main Menu Bar
	var vMainMenuBot = 400; //Screen position of Bottom of Main Menu Bar
	var vNGet = 132; //Value sent to Netscape GetY() function
	var vIGet = 158; //Value sent to Internet Exporer GetY() function
	if (v == 4.5) {
		var vNDDTop = 80; 
		//Value of the Drop Down Menu Tops for Netscape browsers
	}else 
		var vNDDTop = 80; 
		//Value of the Drop Down Menu Tops for Netscape browsers
	}
}

if (b == "I") {
//  Initialize position variables according to the users screen resolution
if (screen.height == 768 && screen.width == 1024) {
	// 1024 x 768
	var vMainMenuTop = 150; //Screen position of top of Main Menu Bar
	var vMainMenuBot = 200; //Screen position of Bottom of Main Menu Bar
	var vNGet = 150; //Value sent to Netscape GetY() function
	var vIGet = 158; //Value sent to Internet Exporer GetY() function
	var vIE4DDTop = 80;	//Value of the Drop Down Menu Tops for IE 4.X
	var vIE5DDTop = 80; //Value of the Drop Down Menu Tops for IE 5.X
}
else if (screen.height == 480 && screen.width == 640) {
	// 640 x 480
	var vMainMenuTop = 100; //Screen position of top of Main Menu Bar
	var vMainMenuBot = 200; //Screen position of Bottom of Main Menu Bar
	var vNGet = 132; //Value sent to Netscape GetY() function
	var vIGet = 158; //Value sent to Internet Exporer GetY() function
	var vIE4DDTop = 80;	//Value of the Drop Down Menu Tops for IE 4.X
	var vIE5DDTop = 80; //Value of the Drop Down Menu Tops for IE 5.X
}
else {
	// 800 x 600
	var vMainMenuTop = 300; //Screen position of top of Main Menu Bar
	var vMainMenuBot = 400; //Screen position of Bottom of Main Menu Bar
	var vNGet = 132; //Value sent to Netscape GetY() function
	var vIGet = 158; //Value sent to Internet Exporer GetY() function
	var vIE4DDTop = 80;	//Value of the Drop Down Menu Tops for IE 4.X
	var vIE5DDTop = 80; //Value of the Drop Down Menu Tops for IE 5.X
}
}

//Hide all Drop Down Menus
function hideAllDD() {

	var myObj, myItem, vArgs, vNum;  
   
	//browser supports Drop Down Menus
	if (dd == true) {
	
		//Internet Explorer
		if (b == "I") {
	
			//Loop through and hide all Drop Down Menus
			for (x = 0; x < vNumMenus; x++) {
					myItem = ("IEDiv" + x);  
				// All Div's should be named IEDiv0, IEDiv1, ...
					myObj = document.all.item(myItem);
					myObj.style.visibility = 'hidden';
			}		
		}
		
		//Netscape
		if (b == "N") {
	
			//Loop through and hide all Drop Down Menus
			for (x = 0; x < vNumMenus; x++) {
				myObj = document.layers[x];
				myObj.visibility = 'hide';
			}			
		}		 
	}
	
	return;
}

//Show a specific Drop Down Menu
function showDD() {

	var args, myObj, vNum;
    
	//Browser supports Drop Down Menus
	if (dd == true) {
		
		//Internet Explorer
		if (b == "I") {
		
			//Get parameters
    	    args = showDD.arguments; 
        	myObj = eval(args[0]);	//Name of Div to show
        	
			//Hide all Div's 
			hideAllDD();
		
			//Show the Div that is sent as first parameter
    	    if (myObj.style.visibility == 'hidden') {
        		myObj.style.visibility = 'visible';
	        }
		}
		
		//Netscape
		if (b == "N") {
		
			//Get parameters
    	    args = showDD.arguments; 
        	myObj = eval(args[1]);	//Name of Layer to show
        
			//Hide all Layers's that are currently showing
			hideAllDD();
		
			//Show the Layer that is sent as second parameter
    	    myObj.visibility = 'show';
		}
		
	}
	
	return;
}

//Hide a specific Drop Down Menu
function hideDD () {

	var args, myObj;
	var vTop, vBot, vLeft, vRight;
	var vX, vY, vEvent, vOnMenu;
	var vOnLayer, vOutput;
	
	//Browser supports Drop Down Menus
	if (dd == true) {
	
		//Internet Explorer
		if (b == "I") {
		
			//Get parameters
    	    args = hideDD.arguments;
        	myObj= eval(args[0]);	//Name of Div to Hide
			
			vOnLayer = true;
			
			// if mouse is not over layer, set vOnLayer to false
			if ( window.event.offsetY <= 0 || window.event.offsetY >= myObj.clientHeight || window.event.offsetX <= 0 || window.event.offsetX >= myObj.clientWidth) {vOnLayer = false;}
        
			//Hide the Div that is sent as first parameter
    	    if (myObj.style.visibility == 'visible' && vOnLayer == false) {
        		myObj.style.visibility = 'hidden';
	        }
		}
		
		//Netscape
		else if (b == "N") {
		
			//Get parameters
    	    args = hideDD.arguments;
        	myObj= eval(args[1]);	//Name of Layer to hide
			vEvent = args[2];		//MouseOut event
			
			//Get the mouse pointer position
			vX = vEvent.pageX;
			vY = vEvent.pageY;
			
			vOnMenu = true;
			if (vY > vMainMenuBot || vY < vMainMenuTop) {vOnMenu = false};
        
			//Hide the Layer that is sent as second parameter
    	    if (myObj.visibility == 'show' && vOnMenu == false) {
        		myObj.visibility = 'hide';
	        }
			
		}
		
	}
        
	return;
        
}

//Dertermine the Y coordinate of the mouse position & 
//hide divs if mouse is above menu
function getY() {
	
	var vArgs;
	var vEvent;
	var vPosition;
	
	//Get arguments
	vArgs = getY.arguments;
	vEvent = vArgs[0];	//Mouse Out Event
	vPosition = vArgs[1];	//Lowest position of mouse to hide all Drop Down Menus
	
	//User is on a microsoft browser
	if (b == "I" ) {
		
		//if mouse position is above Main Menu, hide all drop down menus.
		if (window.event.offsetY <= vPosition) {hideAllDD();}
	}
	
	//User is on a Netscape browser
	else if (b == "N") {
	
		//if mouse position is above Main Menu, hide all drop down menus.
		if (vEvent.pageY <= vPosition) {hideAllDD();}
	
	}
	
	return;
}

//Determine the Clients browser type and version
function getBrowserInfo() {

	var vBrowser, vVersion, vMSIE;
	
	if (navigator.appName == 'Netscape' && document.layers != null) {
		//Client is using a Netscape Browser
		vBrowser = "N";
		
		//Print style description used only in Netscape Drop Down Menus
		document.write("<style type=\"text/javascript\">");
		document.write("	classes.NLink1.a.textDecoration=\"none\";");
		document.write("	classes.NLink1.a.color=\"white\";");
		document.write("</style>");
		
		//Test if it is on a Macintosh
		if (navigator.platform.indexOf("Win") < 0) {
			vBrowser = "M";
		}
		
		//Get Browser Version
		vVersion = navigator.appVersion.charAt(0);
	}
	else if (navigator.appName == 'Microsoft Internet Explorer' && document.all != null) {
		//Client is using a Microsoft Browser
		vBrowser = "I";
		
		//Get Browser Version
		vMSIE = navigator.appVersion.indexOf("MSIE");
		vVersion = parseInt(navigator.appVersion.substring(vMSIE + 5, vMSIE + 6));
	}
	else {
		//Client is using an unknown browser
		vBrowser = "O";		
		vVersion = 0;
	}
	
	//alert (vBrowser + " " + vVersion);
	
	//Assign values to global variables
	b = vBrowser;
	if ((vBrowser == "I" || vBrowser == "N") && vVersion == 4){v = 1;}
	else if (vBrowser == "I" && vVersion == 5) {v = 2;}
	
	if ((vBrowser != "O")&&(vVersion >= 4)){
		dd = true;
	}   
	else {
		dd = false;
	}	
	//alert ("Browser:" + b + "  Version:" + vVersion + " Drop Downs Enabled:" + dd + " V:" + v);
	
	return;
}

//Highlights the layer the mouse is over in Netscape
function nHighlight() {

	var vArgs, vName;
	
	vArgs = nHighlight.arguments;
	vName = eval(vArgs[0]);			//Layer mouse is over
	
	//Change the background color
	vName.bgColor = "gray";
	
	return;
}

//Unhighlights the layer the mouse went off of in Netscape
function nUnhighlight() {

	var vArgs, vName;
	
	vArgs = nUnhighlight.arguments;
	vName = eval(vArgs[0]);			//Layer mouse went off of
	
	//Change the background color
	vName.bgColor = "#070a5c";

	return;
}

//Highlights the Division the mouse went over in IE
function iHighlight() {

	var vArgs, vName;
	
	vArgs = iHighlight.arguments;
	vName = eval(vArgs[0]);		//Division mouse went over
	
	//Change the background color	
	vName.style.backgroundColor = "gray";

	return;
}

//Unhighlights the Division the mouse went off of in IE
function iUnhighlight() {

	var vArgs, vName;
	
	vArgs = iUnhighlight.arguments;
	vName = eval(vArgs[0]);		//Division mouse went off of
	
	//Change the background color
	vName.style.backgroundColor = "#070a5c";

	return;
}

//Build Netscape (Windows) Drop Down Menus
function buildNDD () {

	var vArgs = buildNDD.arguments;
	var vTitle = vArgs[0];	// Name of Layer
	var vX = vArgs[1];	// X value in vMenu[][][] 
	var vLeft = vArgs[2];	// X Position of the Layer
	var vTop = vArgs[3];	// Y Position of the Layer
	var vWide = vArgs[4];	// Width of the layer
	
	var vItemTop = 0;	
	var vLayer = "";
	
	//Create the outermost Layer for the Drop Down Menu
	vLayer = "<Layer id=\"" + vTitle + "\" Width=" + vWide + " Left=" + vLeft + " top=" + vTop;
	vLayer += " z-index=2 visibility=\"hide\" bgcolor=\"#070a5c\"";
	vLayer += " onMouseOver=\"showDD('','document.layers[\\'" + vTitle;
	vLayer += "\\']');\" onMouseOut=\"hideDD('','document.layers[\\'" + vTitle + "\\']',event);\">";
	
	//Create a Layer for each item on the Drop Down Menu
	for (x = 0; x < 20; x++) {
		if (vMenu[vX][x][0] != null) {		
			vLayer += "<layer id=\"" + vTitle + x + "\" bgcolor=\"#070a5c\" ";
			vLayer += "clip=\"0, 0, " + vWide + ", 20\" z-index=5 ";
			vLayer += "width=" + vWide + " top=" + vItemTop + " height=20  ";
			vLayer += "onMouseOver=\"nHighlight('document.layers[\\'" + vTitle + "\\'].layers[\\'" + vTitle + x + "\\']');\" ";
			vLayer += "onMouseOut=\"nUnhighlight('document.layers[\\'" + vTitle + "\\'].layers[\\'" + vTitle + x + "\\']');\" >";
			vLayer += "<a class=\"NLink1\" href=\"" + vMenu[vX][x][1] + "\"><b><font size=\"1\" face=\"Arial, Helvetica, sans-serif\"" 
			vLayer += ">&nbsp;&nbsp;" + vMenu[vX][x][0] + "</font></b></a>";
			vLayer += "</layer>";
			
			vItemTop += 20;
		}
	}
	
	//Close the outermost Layer
	vLayer += "</Layer>";

	document.write(vLayer);
	
	//alert (vLayer);
	
	return;
}

//Build Internet Explorer Drop Down Menus
function buildIDD () {

	var vArgs = buildIDD.arguments;	//Arguments passed to function
	var vTitle = vArgs[0];		//Title of menu
	var vX = vArgs[1];		//X value in data array
	var vLeft = vArgs[2];		//Left Coordinate on screen for menu
	var vTop = vArgs[3];		//Top Coordinate on screen for menu
	var vWide = vArgs[4];		//Width of the Drop Down Menu
	
	vDiv = "";
	

	
	//Create outermost DIV tag for the drop down menu
	
	vDiv = "<Div id=\"" + vTitle + "\" style=\"position:absolute; width:" + vWide + "px; z-index:1; ";
	vDiv += "left: " + vLeft + "px; top: " + vTop + "px; visibility: hidden; background-color: #070a5c; padding-left:1;";
	vDiv += "padding-right:1;textdecoration:none;\" "
	vDiv += "onmouseover=\"showDD('document.all[\\'" + vTitle + "\\']');\"";
	vDiv += " onmouseout=\"hideDD('document.all[\\'" + vTitle + "\\']');\"";
	vDiv += ">";
	
	vDiv += ("<style type=\"text/css\">");
	vDiv += ("	A {text-decoration: \"underline\"}");
	vDiv += ("  #AMenu {text-decoration: \"none\"}");
	vDiv += ("  A.#AMenu {text-decoration: \"none\"}");
	vDiv += ("</style>");
	
	
	//Create links for each entry in the Drop down menu
	
	for (x = 0; x < 20; x++) {
		if (vMenu[vX][x][0] != null) {
			vDiv += "<div id=\"" + vTitle + x + "\" style=\"position:relative; background-color: #070a5c;\" ";
			vDiv += "onMouseOver=\"iHighlight('document.all[\\'" + vTitle + "\\'].all[\\'" + vTitle + x + "\\']');\" ";
			vDiv += "onMouseOut=\"iUnhighlight('document.all[\\'" + vTitle + "\\'].all[\\'" + vTitle + x + "\\']');\">";
			vDiv += "<span > <a href=\"" + vMenu[vX][x][1] + "\" ID=\"AMenu\">";
			vDiv += "<b><font size=\"1\" face=\"Arial, Helvetica, sans-serif\" color=\"#FFFFFF\">&nbsp;&nbsp;";
			vDiv += vMenu[vX][x][0] + "</font></b></a></span> </div>";
		}
	}
	
	//Close outermost DIV tag
	vDiv += "</Div>";	
	
	//Print Div
	document.write(vDiv);
	
	return;
}

//Build Netscape (Macs) Drop Down Menus
function buildMDD () {
	return;
}

//Build main menu, from which Drop Down Menus are selected.
function buildMainMenu() {

	var vMenu;
	var vTop;

	//Show image
	
	//vMenu = "<table width=\"100%\" border=\"0\">";
	//vMenu += "<tr><td bgcolor=\"#567490\" >" 

	vMenu = "<img src=\"images/header.gif\" usemap=\"#TopNav\" border=0>";
	
	//If Drop down menus are enabled, build image map with mouse events
	if (dd == true) {
		
		if (b == "N") {
			vTop = vNGet;
		}else {
			vTop = vIGet;
		}
				
		vMenu += "<map name=\"TopNav\">";
		vMenu += "<area shape=\"rect\" coords=\"0,0,200,80\" href=\"index.htm\" onmouseover=\"hideAllDD();\" onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"200,50,304,80\" href=\"index.htm\" onmouseover=\"showDD('document.all[\\'IEDiv0\\']', 'document.layers[\\'NLayer0\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"304,50,395,80\" href=\"index.htm\" onmouseover=\"showDD('document.all[\\'IEDiv1\\']', 'document.layers[\\'NLayer1\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"395,50,466,80\" href=\"index.htm\" onmouseover=\"showDD('document.all[\\'IEDiv2\\']', 'document.layers[\\'NLayer2\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"466,50,550,80\" href=\"index.htm\" onmouseover=\"showDD('document.all[\\'IEDiv3\\']', 'document.layers[\\'NLayer3\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"550,50,640,80\" href=\"index.htm\" onmouseover=\"showDD('document.all[\\'IEDiv4\\']', 'document.layers[\\'NLayer4\\']');\" onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "</map>";
	}
	
	//if Drop Down Menus are disabled, build image map w/out mouse events
	else {
				
		vMenu += "<map name=\"TopNav\">";
		vMenu += "<area shape=\"rect\" coords=\"0,0,80,23\" href=\"index.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"81,0,160,23\" href=\"SalesDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"161,0,322,23\" href=\"TeamSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"323,0,453,23\" href=\"RacquetSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"454,0,610,23\" href=\"MartialArtsSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"611,0,702,23\" href=\"ApparelSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"703,0,710,23\" href=\"ApparelSports.cfm\">";
		vMenu += "</map>";
		
	}
	
	//write the menu out 
	document.write(vMenu);
	
	return;
}
 
function buildMainMenuDisabled() {

	var vMenu;
	var vTop;

	//Show image
	
	vMenu = "<table width=\"100%\" border=\"0\">";
	vMenu += "<tr bgcolor=\"#567490\">" 
	//vMenu += "<td><small><b><img src=\"images/menubar.GIF\" width=\"684\" ";
	vMenu += "<small><b><img src=\"images/website/menubar.GIF\" width=\"100%\" ";
	vMenu += "height=\"23\" border=\"0\" usemap=\"#TopNav\"></b></small> </tr> </table>";
	
	//If Drop down menus are enabled, build image map with mouse events
	if (dd == true) {
		if (b == "N") {vTop = vNGet;}
		else {vTop = vIGet;}
		/* //This is the Area Object when the Golf Department is listed
		vMenu += "<map name=\"TopNav\">";
		vMenu += "<area shape=\"rect\" coords=\"0,0,70,23\" href=\"http://www.savealotsports.com/index.cfm\" onmouseover=\"hideAllDD();\" onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"71,0,139,23\" href=\"http://www.savealotsports.com/SalesDepartment.cfm\" onmouseover=\"hideAllDD();\" onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"140,0,260,23\" href=\"http://www.savealotsports.com/Sport_Baseball_Softball.cfm\" onmouseover=\"showDD('document.all[\\'IEDiv0\\']', 'document.layers[\\'NLayer0\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"261,0,360,23\" href=\"http://www.savealotsports.com/Sport_Racquet.cfm\" onmouseover=\"showDD('document.all[\\'IEDiv1\\']', 'document.layers[\\'NLayer1\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"361,0,488,23\" href=\"http://www.savealotsports.com/MartialArtsSports.cfm\" onmouseover=\"showDD('document.all[\\'IEDiv2\\']', 'document.layers[\\'NLayer2\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"489,0,580,23\" href=\"http://www.savealotsports.com/Golf_Item2.cfm\" onmouseover=\"showDD('document.all[\\'IEDiv3\\']', 'document.layers[\\'NLayer3\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"581,0,655,23\" href=\"http://www.savealotsports.com/ApparelSports.cfm\" onmouseover=\"showDD('document.all[\\'IEDiv4\\']', 'document.layers[\\'NLayer4\\']');\"  onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "<area shape=\"rect\" coords=\"656,0,683,23\" href=\"http://www.savealotsports.com/ApparelSports.cfm\" onmouseover=\"hideAllDD();\" onMouseOut=\"getY(event," + vTop + ");\">";
		vMenu += "</map>";
		*/
		
		//This is the Area Object without the Golf Department Listed
		vMenu += "<map name=\"TopNav\">";
		vMenu += "<area shape=\"rect\" coords=\"0,0,80,23\" href=\"index.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"81,0,160,23\" href=\"SalesDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"161,0,322,23\" href=\"Sport_Baseball_Softball.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"323,0,453,23\" href=\"Sport_Racquet.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"454,0,610,23\" href=\"MartialArtsSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"611,0,702,23\" href=\"ApparelSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"703,0,710,23\" href=\"ApparelSports.cfm\">";
		vMenu += "</map>";
	}
	
	//if Drop Down Menus are disabled, build image map w/out mouse events
	else {
		/* //This is the Disabled Drop Down to use if Golf is a department
		vMenu += "<map name=\"TopNav\">";
		vMenu += "<area shape=\"rect\" coords=\"0,0,70,23\" href=\"http://www.savealotsports.com/index.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"71,0,139,23\" href=\"http://www.savealotsports.com/SalesDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"140,0,252,23\" href=\"http://www.savealotsports.com/TSDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"254,0,270,23\">";
		vMenu += "<area shape=\"rect\" coords=\"271,0,355,23\" href=\"http://www.savealotsports.com/RacquetDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"356,0,373,23\">";
		vMenu += "<area shape=\"rect\" coords=\"374,0,488,23\" href=\"http://www.savealotsports.com/MartialArtsSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"489,0,497,23\">";
		vMenu += "<area shape=\"rect\" coords=\"498,0,583,23\" href=\"http://www.savealotsports.com/GolfDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"583,0,590,23\">";
		vMenu += "<area shape=\"rect\" coords=\"591,0,672,23\" href=\"http://www.savealotsports.com/ApparelSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"674,0,683,23\">";
		vMenu += "</map>";
		*/
		
		//This is the Disabled Drop Down to use if Golf is not a department
		vMenu += "<map name=\"TopNav\">";
		vMenu += "<area shape=\"rect\" coords=\"0,0,80,23\" href=\"index.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"81,0,160,23\" href=\"SalesDepartment.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"161,0,322,23\" href=\"Sport_Baseball_Softball.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"323,0,453,23\" href=\"Sport_Racquet.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"454,0,610,23\" href=\"MartialArtsSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"611,0,702,23\" href=\"ApparelSports.cfm\">";
		vMenu += "<area shape=\"rect\" coords=\"703,0,710,23\" href=\"ApparelSports.cfm\">";
		vMenu += "</map>";
		
	}
	
	//write the menu out to the cfm page
	document.write(vMenu);
	
	return;
}

//Call correct function to build the drop down menus
function buildMenus() {

	var vTop;
	
	if (dd == true) {
	
		//Build Netscape Layers
		if (b == "N") {
			buildNDD("NLayer0", 0, 200, vNDDTop, 100);
			buildNDD("NLayer1", 1, 304, vNDDTop, 90);
			buildNDD("NLayer2", 2, 395, vNDDTop, 90);
			buildNDD("NLayer3", 3, 466, vNDDTop, 90);
			buildNDD("NLayer4", 4, 550, vNDDTop, 100);
		}
		
		//Build Internet Explorer DIVs
		else if (b == "I") {
		
			if (v == 1) {vTop = vIE4DDTop;}
			else if (v == 2) {vTop = vIE5DDTop;}
			
			buildIDD("IEDiv0", 0, 200, vTop, 100);
			buildIDD("IEDiv1", 1, 304, vTop, 90);
			buildIDD("IEDiv2", 2, 395, vTop, 90);
			buildIDD("IEDiv3", 3, 466, vTop, 90);
			buildIDD("IEDiv4", 4, 550, vTop, 100);
		}
		
		//Build Netscape Layer's for Macintosh
		else if (b == "M") {
			buildMDD();
		}
	}
	
	return;
}       

// This function generates a random number between 1 and 50
function Random50() {

	var vTemp;
	
	vTemp = Math.random();
	vTemp = Math.round(vTemp * 100);
	if (vTemp > 50) {vTemp -= 50;}
	if (vTemp == 0) {vTemp = 1;}
	
	return vTemp;
}

// This function builds the beginning of the HTML body
function buildMainBody() {

	var vLinkNumber = 0;
    document.write ("<body border=\"0\" leftmargin=\"0\" topmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\" marginheight=\"0\" bgcolor=\"#FFFFFF\" link=\"blue\" vlink=\"purple\">");
    document.write ("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">");
    //document.write ("<tr>");
	
	// Display the Savealotsports.com animated logo
	document.write ("<td bgcolor=\"#FFFFFF\" colspan=\"0\" align=\"left\" width=\"67%\">");
    document.write ("<img src=\"images/website/savealotsportsimage.gif\" width=\"160\" height=\"72\" border=\"0\" usemap=\"#TitleNav\">");
    document.write ("</td>");
	
	var banner = 1;
	
	if (location.pathname == "/testsas/Purchase.cfm") banner = 0;
	if (location.pathname == "/testsas/Purchase1.cfm") banner = 0;
	if (location.pathname == "/testsas/Purchase2.cfm") banner = 0;
	if (location.pathname == "/testsas/Confirm.cfm") banner = 0;
	if (location.pathname == "/testsas/Receipt.cfm") banner = 0; 
	
	if (banner == 0) {
	}
	else {
	// Display the Link Exchange banner
	vLinkNumber = Random50();
    document.write ("     <td bgcolor=\"#FFFFFF\" align=\"left\" width=\"33%\">");
    document.write ("        <font size=\"4\">");
	if (b == "N") {
	document.write ("			  <iframe src=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/showiframe?\" width=468 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>");
	document.write ("	            <a href=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/clickle\" target=\"_window\">");
	document.write ("     	    <img width=468 height=0 border=0 ismap alt=\"\" src=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/showle?\">");
	document.write ("           </iframe>");
	}
	else {
	
	document.write ("			  <iframe src=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/showiframe?\" width=468 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>");
	document.write ("	            <a href=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/clickle\" target=\"_window\">");
	document.write ("     	    <img width=468 height=0 border=0 ismap alt=\"\" src=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/showle?\">");
	document.write ("           </iframe>");
	}
	
	if (b == "I" && v == 1) {	
	document.write ("			  <br><a href=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/clicklogo\" target=\"_window\">");
	document.write ("			  <img src=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/showlogo?\" width=468 height=16 border=0 ismap alt=\"\"></a>");
	}
	else {
	document.write ("			  <a href=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/clicklogo\" target=\"_window\">");
	document.write ("			  <img src=\"http://leader.linkexchange.com/" + vLinkNumber + "/X1438170/showlogo?\" width=468 height=16 border=0 ismap alt=\"\"></a><br>");
	}							
	document.writeln ("			  </font></td>");
	}
	// close table
	document.write ("<td bgcolor=\"#FFFFFF\" colspan=\"0\" align=\"center\" width=\"67%\">");
    	
	document.writeln ("</tr></table>");
	
	// Start building search form
	document.writeln ("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"top\">");
	document.writeln ("  <td valign=\"top\" colspan=\"0\">");
	document.writeln ("    <form method=\"POST\" action=\"SearchPage.cfm\" name=\"SASSearch\">");
	document.writeln ("        <div align=\"right\">");
	document.writeln ("           <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"right\">");
	document.writeln ("             <td>");
	
	// Build "Search-By" drop down menu
	document.writeln ("				  <div align = \"left\"><b><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Browse By:</font></b>");
	document.writeln ("                 <select size=\"1\" name=\"cat_sel\">");
	document.writeln ("	                   <option selected>Sport</option>");
	document.writeln ("             	   <option>Manufacturer</option>");
	document.writeln ("                    <option>Product Category</option>");
	document.writeln ("                    <option>Product Name</option>");
	document.writeln ("                    <option>Professional Team</option>");
	document.writeln ("                </select>");

	// Build "Search-For" text box and search button
	document.writeln ("              <b><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">Search for:</font></b>");
	document.writeln ("              <input type=\"text\" name=\"T1\" size=\"20\">");
	document.writeln ("              <input type=\"image\" border=0 src=\"images/website/go-button-gateway.gif\" width=\"21\" height=\"21\">");

	//Build Links under link Exchange banner
	document.writeln ("	             <font color=\"#000099\">");
	if (location.href != "http://www.savealotsports.com/ShoppingCart.cfm") {
		document.writeln('               <a href=\"ShoppingCart.cfm\"><img src=\"images/website/shopcart.GIF\" width=\"24\" border=\"0\"></a></font></b><font size=\"1\">')
		document.writeln('               <font color=\"#000000\"><a href=\"ShoppingCart.cfm\"><font face=\"Arial, Helvetica, sans-serif\" size=\"1\">view shopping cart</font></a><font face=\"Arial, Helvetica, sans-serif\" size=\"1\"> |')
	}	
	document.writeln ("              <font size=\"1\">");
	document.writeln ("              <a href=\"CustomerService.cfm\">customer service</a> | <a href=\"Security.cfm\">security</a></font>");
	document.writeln ("</td>");
	document.writeln ("</table>");
	document.writeln ("</form>");

	//Close table
	document.writeln ("</td>");    
	document.writeln ("</table>");
	
	// Build area maps
	document.writeln ("<map name=\"OffNav\">");
 	document.writeln ("  <area shape=\"rect\" coords=\"0,0,684,4\" onmouseover=\"hideAllDD();\">");
	document.writeln ("</map> ");
	
	document.writeln ("<map name=\"TitleNav\">");
    document.writeln ("  <area shape=\"rect\" coords=\"0,0,474,786\" onmouseover=\"hideAllDD();\">");
	document.writeln ("</map>");

	document.writeln ("<map name=\"CyberNav\">");
    document.writeln ("  <area shape=\"rect\" coords=\"0,0,87,30\" href=\"Security.htm\">");
	document.writeln ("</map>");
	
	return;

}
/*
function buildBottomBar() {

	document.writeln ("<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" align=\"center\">");

	document.writeln ("<tr>");
    document.writeln ("<td width=\"100%\" colspan=\"2\"><img border=\"0\" src=\"images/website/blue_line.gif\" width=\"100%\" height=\"4\"></td>");
	document.writeln ("</tr>");

	document.writeln ("<td>");
	document.writeln ("<img src=\"images/website/amexp_logo.gif\" width=\"60\" height=\"40\">");
	document.writeln ("<img src=\"images/website/Visa.gif\" width=\"40\" height=\"35\" border=\"0\">&nbsp;");
	document.writeln ("<img src=\"images/website/MasterCard.gif\" width=\"55\" height=\"40\" border=\"0\">");
	document.writeln ("<img src=\"images/website/ccpaylogo1.gif\" width=\"85\" height=\"40\" border=\"0\" usemap=\"#CyberNav\"></font>");
	document.writeln ("</td>");
	document.writeln ("<td align=\"center\">");
	document.writeln ("<Font face=arial size=4 color=##FF0000><Strong>");
	
	document.writeln ("</Strong></Font></td>");
  
	document.writeln ("<tr>");
    document.writeln ("<td width=\"100%\" colspan=\"2\"><img border=\"0\" src=\"images/website/blue_line.gif\" width=\"100%\" height=\"4\"></td>");
    document.writeln ("</tr>");
    document.writeln ("</table>");

	return;
}
*/

// This function is used to make sure the product is available before the user
//is allowed to add it to their shopping cart.
function checkQuantity() {

	var vSubmit = false;
	var vMessage = "This product is currently unavailable.\nPlease try again at a later time.";
	var vForm = document.forms[1];
	vQuantity = vForm.elements.ProdQuant.value;
	if (vQuantity > 0) {vSubmit = true;}
	else {alert(vMessage);}
	
	return vSubmit;
	
}
