

if (document.images) {
	button_a = new Image
	button_a_roll = new Image
	button_b = new Image
	button_b_roll = new Image
	button_c = new Image
	button_c_roll = new Image
	button_d = new Image
	button_d_roll = new Image
	button_e = new Image
	button_e_roll = new Image
	button_f = new Image
	button_f_roll = new Image
	button_g = new Image
	button_g_roll = new Image
	button_aa = new Image
	button_aa_roll = new Image
	button_bb = new Image
	button_bb_roll = new Image
	button_cc = new Image
	button_cc_roll = new Image
	button_dd = new Image
	button_dd_roll = new Image
	button_ee = new Image
	button_ee_roll = new Image
	button_ff = new Image
	button_ff_roll = new Image
	button_gg = new Image
	button_gg_roll = new Image
	main = new Image
	main_roll = new Image



	

	button_a.src = "images/button_a.jpg"
	button_a_roll.src = "images/button_a_roll.jpg"
	button_b.src = "images/button_b.jpg"
	button_b_roll.src = "images/button_b_roll.jpg"
	button_c.src = "images/button_c.jpg"
	button_c_roll.src = "images/button_c_roll.jpg"
	button_d.src = "images/button_d.jpg"
	button_d_roll.src = "images/button_d_roll.jpg"
	button_e.src = "images/button_e.gif"
	button_e_roll.src = "images/button_e_roll.gif"
	button_f.src = "images/button_f.gif"
	button_f_roll.src = "images/button_f_roll.gif"
	button_g.src = "images/button_g.gif"
	button_g_roll.src = "images/button_g_roll.gif"
	button_aa.src = "images/button_aa.jpg"
	button_aa_roll.src = "images/button_aa_roll.jpg"
	button_bb.src = "images/button_bb.jpg"
	button_bb_roll.src = "images/button_bb_roll.jpg"
	button_cc.src = "images/button_cc.jpg"
	button_cc_roll.src = "images/button_cc_roll.jpg"
	button_dd.src = "images/button_dd.jpg"
	button_dd_roll.src = "images/button_dd_roll.jpg"
	button_ee.src = "images/button_ee.gif"
	button_ee_roll.src = "images/button_ee_roll.gif"
	button_ff.src = "images/button_ff.gif"
	button_ff_roll.src = "images/button_ff_roll.gif"
	button_gg.src = "images/button_gg.gif"
	button_gg_roll.src = "images/button_gg_roll.gif"
	main.src = "images/main_logo.jpg"
	main_roll.src = "images/main_logo2.jpg"



} else {
	button_a = ""
	button_a_roll = ""
	button_b = ""
	button_b_roll = ""
	button_c = ""
	button_c_roll = ""
	button_d = ""
	button_d_roll = ""
	button_e = ""
	button_e_roll = ""
	button_f = ""
	button_f_roll = ""
	button_g = ""
	button_g_roll = ""
	button_aa = ""
	button_aa_roll = ""
	button_bb = ""
	button_bb_roll = ""
	button_cc = ""
	button_cc_roll = ""
	button_dd = ""
	button_dd_roll = ""
	button_ee = ""
	button_ee_roll = ""
	button_ff = ""
	button_ff_roll = ""
	button_gg = ""
	button_gg_roll = ""
	main = ""
	main_roll = ""
}
	

 
function isDefined(variable) {
	return (typeof(window[variable]) == "undefined")?  false: true;
}

var hashMenuState = new Array();
var arrMenus = new Array();

function setToggleState() {

	// automatically parse the menu divs and make an array.
	var menuNum;
	var thisDivId;
	var allDivs = document.getElementsByTagName('div');
	var divCount=allDivs.length;
	//alert ("there are " + divCount + " menu divs");
	for (var i=0;i<divCount;i++) {
		thisDivId=allDivs[i].id;
		//alert ("this one is called " + thisDivId.substr(0,4));
		if (thisDivId.substr(0,4)=="menu") {
			//alert ("adding " + thisDivId.substr(4));
			menuNum=thisDivId.substr(4);
			arrMenus.push(menuNum);
		}
	}

	// Initialize menu state array
	for (x=0;x<arrMenus.length;x++) {
		hashMenuState[arrMenus[x]]="}";
	}
	// if there is a URL string, parse it
	if (window.location.search.length>0) {
		var arrPairs = window.location.search.substr(1).split("&");
		// iterate through URL string
		for (i=0;i<arrPairs.length;i++) {
			arrPairs[i]=arrPairs[i].split("=");
			if (arrPairs[i][1]=="{") {
		// toggle DIVs (and that'll set the state, too)
				toggleLayer("menu" + arrPairs[i][0]);
			}
			if (arrPairs[i][0]=="products") {
				var jumpTo=arrPairs[i][1];
			}
		}
	
	}
	window.location="#"+jumpTo;
}

function loadProduct(strProductName, intTitle, intSubTitle) {
	var strUrlString="";
	for (x=0;x<arrMenus.length;x++) {
		strUrlString += "&" + arrMenus[x] + "=" + hashMenuState[arrMenus[x]];
	}
	window.location="products2.asp?products=" + strProductName + "&title=" + intTitle + "&subTitle=" + intSubTitle + "&pageFrom=" + strPageFrom + strUrlString;
	
}

function toggleLayer(whichLayer)
{
	var style2;
	if (document.getElementById)
	{
		// this is the way the standards work
		style2 = document.getElementById(whichLayer).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		style2 = document.all[whichLayer].style;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		style2 = document.layers[whichLayer].style;
	}
	
	var menuId=whichLayer.substr(4);
	
	if (style2.display=="") {
		style2.display="block";
		hashMenuState[menuId]="{";
	} else {
		style2.display="";
		hashMenuState[menuId]="}";
	}
}

function toggleLayer2(whichLayer)
{
	var style2;
	if (document.getElementById)
	{
		// this is the way the standards work
		style2 = document.getElementById(whichLayer).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		style2 = document.all[whichLayer].style;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		style2 = document.layers[whichLayer].style;
	}
	
	style2.display=style2.display=="none"?"block":"none";
}