<!--
//JavaScript for this site carefully hand-coded by absoluteTHINKING.com

//main menu rollover images

//set var to track if the image preloads are complete - this makes sure there are no errors if the rollovers aren't yet loaded
var preloadsComplete = false

//get browser name, version, and agent
var browserName = navigator.appName;
var browserVersion = parseInt(navigator.appVersion);
var browserAgent = navigator.userAgent;

function preLoadImages(){
	//preload all necessary menu images - start with portfolio items
	if (document.images){
		//define image prefix URL
		var imagePrefixURL
	
		selectionStates = new Array();
		selectionStates[1] = "off"
		selectionStates[2] = "on"
	
		//preload all main menu images
		mainMenuImageNames = new Array();
		mainMenuImageNames[1] = "about_us"
		mainMenuImageNames[2] = "jewelry_services"
		mainMenuImageNames[3] = "jewelry_showcase"
		mainMenuImageNames[4] = "contact_us"
		
		for (var x=1; x<mainMenuImageNames.length; x++){
			for (var y=1; y<selectionStates.length; y++){
				imagePrefixURL = "../images/interface/menu_items/" + mainMenuImageNames[x] + "/" + selectionStates[y] + "/"
				
				eval("main_menu_choice" + x + "_" + selectionStates[y] + " = new Image()");
				eval("main_menu_choice" + x + "_" + selectionStates[y]).src = imagePrefixURL + mainMenuImageNames[x] + ".gif"
			}
		}
	
		//now preload the current section images
	
		//first, grab current section from URL
		var currentURL = location.href
	
		//loop through mainMenuImageNames array and find current section	
		for (var x=1; x<mainMenuImageNames.length; x++){
			if (currentURL.indexOf(mainMenuImageNames[x]) >= 0){
				var currentSection = mainMenuImageNames[x]
				x = mainMenuImageNames.length
			}
		}
	
		//preload the current section images based on var above - ONLY check sections with multiple subsections
		var subSections = true
	
		if (currentSection == "about_us"){	
			about_usImageNames = new Array();
			about_usImageNames[1] = "overview"
			about_usImageNames[2] = "area_info"
	
		}else if (currentSection == "jewelry_services"){
			jewelry_servicesImageNames = new Array();
			jewelry_servicesImageNames[1] = "custom_design"
			jewelry_servicesImageNames[2] = "repair"
	
		}else if (currentSection == "jewelry_showcase"){
			jewelry_showcaseImageNames = new Array();
			jewelry_showcaseImageNames[1] = "rings"
			jewelry_showcaseImageNames[2] = "earrings"
			jewelry_showcaseImageNames[3] = "necklaces"
			jewelry_showcaseImageNames[4] = "pins"
			jewelry_showcaseImageNames[5] = "bracelets"
			jewelry_showcaseImageNames[6] = "watches"
			jewelry_showcaseImageNames[7] = "etc"
	
		}else if (currentSection == "contact_us"){
			contact_usImageNames = new Array();
			contact_usImageNames[1] = "contact_info"
			contact_usImageNames[2] = "driving_directions"
		}else{
			//there are no subsections - set var to false so we don't try to preload images
			subSections = false
		}
		
		//if there are any subsections, define the images to preload
		if (subSections == true){
			for (var x=1; x<eval(currentSection + "ImageNames").length; x++){
				for (var y=1; y<selectionStates.length; y++){
					imagePrefixURL = "../images/interface/menu_items/" + currentSection + "/" + selectionStates[y] + "/"
	
					eval(currentSection + "_submenu_choice" + x + "_" + selectionStates[y] + " = new Image()");
					eval(currentSection + "_submenu_choice" + x + "_" + selectionStates[y]).src = imagePrefixURL + eval(currentSection + "ImageNames")[x] + ".gif"
				}
			}
		}
	
		preloadsComplete = true
	
	}
}

// -->