var n4 = (document.layers) ? 1:0
var ie = (document.all) ? 1:0
var dom = (document.getElementById && !document.all) ? 1:0

// Preload Images
aboutus=new Image(); aboutus.src="images/nav_aboutus.gif"
aboutusOv=new Image(); aboutusOv.src="images/nav_aboutus_ov.gif"
locationsNav=new Image(); locationsNav.src="images/nav_locations.gif"
locationsNavOv=new Image(); locationsNavOv.src="images/nav_locations_ov.gif"
menus=new Image(); menus.src="images/nav_menus.gif"
menusOv=new Image(); menusOv.src="images/nav_menus_ov.gif"
promos=new Image(); promos.src="images/nav_promos.gif"
promosOv=new Image(); promosOv.src="images/nav_promos_ov.gif"
giftcard=new Image(); giftcard.src="images/nav_giftcard.gif"
giftcardOv=new Image(); giftcardOv.src="images/nav_giftcard_ov.gif"
togo=new Image(); togo.src="images/nav_togo.gif"
togoOv=new Image(); togoOv.src="images/nav_togo_ov.gif"
club=new Image(); club.src="images/nav_club.gif"
clubOv=new Image(); clubOv.src="images/nav_club_ov.gif"

// Image Rollover
function iC(imageID,which){
	if(which==1){
		document.images[imageID+"Img"].src = eval(imageID+"Ov.src");
	} else {
		document.images[imageID+"Img"].src = eval(imageID+".src");
	}
}


function launchNutrition(which){
	window.open('menus_nutrional.cfm?Item_ID='+which,'nutrition','width=450,height=675,menubar=0,status=1,location=0,resizable=0,scrollbar=1,toolbar=0')
}


// Promos Search *****************************************
function findIt(which){
	for(i=0;i<states.length;i++){
		if(which == states[i]){
			return i;
		}
	}
}
var whichState; var whichCity; var whichCityNum;
function gotState(whichpage){
	d = document.lookup
	if(d.state.value != ""){
		whichState = findIt(d.state.value); // Gives State's # in Array
		if(cities[whichState].length > 0){
			d.city.length = 0;
			if (whichpage != "locations") {
				d.location.length = 0;
			}
			d.city.options[d.city.options.length] = new Option("Choose a city","")
			for(x=0;x<cities[whichState].length;x++){
				if (whichpage == "locations") {
				value = cities[whichState][x]
				} else {
				value = x
				}
				d.city.options[d.city.options.length] = new Option(cities[whichState][x],value)
			}
			//d.city.disabled = false;
		}
	}
}
function gotCity(whichpage){
	d = document.lookup
	if(d.city.value != ""){
		whichCityNum = d.city.value
		whichCity = cities[whichState][d.city.value]
		d.location.length = 0;
		d.location.options[d.location.options.length] = new Option("Choose a location","")
		for(a=0;a<locations[whichState][d.city.value].length;a++){
			if (whichpage == "menus") {
			value = locations[whichState][d.city.value][a]
			} else {
			value = a
			}
			d.location.options[d.location.options.length] = new Option(locations[whichState][d.city.value][a],value)
		}
		//d.location.disabled = false;
		if(locations[whichState][d.city.value].length == 1){
			d.location.options[1].selected = true;
			//alert(locations[whichState][whichCityNum][d.location.value])
			if (whichpage == null) {
				location.href='promos.cfm?Location=' + locations[whichState][whichCityNum][d.location.value]
			}
		}
	}
}
function gotoLocation(){
	d = document.lookup
	if(d.location.value != ""){
		//alert(locations[whichState][whichCityNum][d.location.value])
		location.href='promos.cfm?Location=' + locations[whichState][whichCityNum][d.location.value]
		//document.getElementById('submitButton').className = 'visible';
	}
}
// Menu search *************************************************************
