<!--
//JavaScript for this site carefully hand-coded by absoluteTHINKING.com

//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;

//define global portfolio section var
var portfolioSelectionClicked = "empty"

mainPortfolioImageNames = new Array();
mainPortfolioImageNames[1] = "commercial"
mainPortfolioImageNames[2] = "portrait"
mainPortfolioImageNames[3] = "showcase"

//this var need to be altered should the most sub menu choices increase (interface allows for 10 max)
var mostSubSectionChoices = 6

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] = "rollover"
	selectionStates[3] = "on"

	//main portfolio menu items dir
	imagePrefixURL = "../images/interface/menu_items/portfolio/"

	for (var x=1; x<mainPortfolioImageNames.length; x++){
		for (var y=1; y<selectionStates.length; y++){
			eval(mainPortfolioImageNames[x] + "_" + selectionStates[y] + " = new Image()");
			eval(mainPortfolioImageNames[x] + "_" + selectionStates[y]).src = imagePrefixURL + selectionStates[y] + "/" + mainPortfolioImageNames[x] + ".gif"
		}
	}

	//portfolio's titles
	imagePrefixURL = "../images/interface/menu_items/portfolio/submenus/titles/"
	
	for (var x=1; x<mainPortfolioImageNames.length; x++){
		eval(mainPortfolioImageNames[x] + "_title = new Image()");
		eval(mainPortfolioImageNames[x] + "_title").src = imagePrefixURL + mainPortfolioImageNames[x] + ".gif"

	}
		
	//empty submenu
	imagePrefixURL = "../images/interface/menu_items/portfolio/submenus/" 

	//before preloading, loop through the empty submenu choices and set image size to 0/0
	//however, only higher end browsers (IE4+ and NS 6+) can redraw an image without reload so we get a false rollover in lower end browsers
	for (var x=1; x<=mostSubSectionChoices; x++){
		document.images["submenu_choice" + x].width = 0	
		document.images["submenu_choice" + x].height = 0	
	}

	for (var x=1; x<(mostSubSectionChoices+1); x++){
		
		for (var y=1; y<(selectionStates.length - 1); y++){
			eval("empty_submenu_choice" + x + "_" + selectionStates[y] + " = new Image()");
			eval("empty_submenu_choice" + x + "_" + selectionStates[y]).src = imagePrefixURL + "empty_placeholder.gif"
		}
		
	}

	//dotted down menu arrow
	dotted_down_menu_arrow = new Image(36,14); 
	dotted_down_menu_arrow.src = imagePrefixURL + "dotted_down_arrow.gif";	

	//define portfolio submenu choices arrays for each main section

	commercialSubMenuChoices = new Array();
	commercialSubMenuChoices[1] = "advertising"
	commercialSubMenuChoices[2] = "editorial"
	commercialSubMenuChoices[3] = "celebrity"
	commercialSubMenuChoices[4] = "performing_arts"
	commercialSubMenuChoices[5] = "fashion_modeling"
	commercialSubMenuChoices[6] = "professional"
	
	portraitSubMenuChoices = new Array();
	portraitSubMenuChoices[1] = "relationships"
	portraitSubMenuChoices[2] = "love_story"
	portraitSubMenuChoices[3] = "graduate"
	portraitSubMenuChoices[4] = "beginnings"
	portraitSubMenuChoices[5] = "none"
	portraitSubMenuChoices[6] = "none"
	
	showcaseSubMenuChoices = new Array();
	showcaseSubMenuChoices[1] = "fine_art"
	showcaseSubMenuChoices[2] = "award_winners"
	showcaseSubMenuChoices[3] = "celebrity"
	showcaseSubMenuChoices[4] = "none"
	showcaseSubMenuChoices[5] = "none"
	showcaseSubMenuChoices[6] = "none"

	//define default lead image rollover image
	lead_image_rollover_off = new Image();
	lead_image_rollover_off.src = imagePrefixURL + "default_lead_image_rollover.jpg";

	//load all portfolio submenu items for both "off" state and "rollover" state as well as the lead image rollover state
	for (var x=1; x<mainPortfolioImageNames.length; x++){
		for (var y=1; y<(mostSubSectionChoices+1); y++){
			for (var z=1; z<(selectionStates.length - 1); z++){
				eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_" + selectionStates[z] + " = new Image()");

				//write a catch for a "none" subMenuChoice - and point the src to the empty placeholder
				if (eval(mainPortfolioImageNames[x] + "SubMenuChoices")[y] == "none"){
					
					//"none" IS present - write special empty link
					eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_" + selectionStates[z]).src = imagePrefixURL + "empty_placeholder.gif"
					//preload the lead image rollover links when we hit an empty rollover
					if (selectionStates[z] == "rollover"){
						eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_lead_image_rollover = new Image()");
						eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_lead_image_rollover").src = imagePrefixURL + "default_lead_image_rollover.jpg";
					}

				}else{

					//"none" IS NOT present - write link as normal
					eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_" + selectionStates[z]).src = imagePrefixURL + mainPortfolioImageNames[x] + "/" + selectionStates[z] + "/" + eval(mainPortfolioImageNames[x] + "SubMenuChoices")[y] + ".gif"

					//preload the lead image rollover links when we hit the rollover state
					if (selectionStates[z] == "rollover"){
						eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_lead_image_rollover = new Image()");
						eval(mainPortfolioImageNames[x] + "_submenu_choice" + [y] + "_lead_image_rollover").src = imagePrefixURL + mainPortfolioImageNames[x] + "/rollover/" + eval(mainPortfolioImageNames[x] + "SubMenuChoices")[y] + "_lead_image_rollover.jpg"
					}
				}
			}
		}
	}

	//now - preload all main menu images

	mainMenuImageNames = new Array();
	mainMenuImageNames[1] = "profile"
	mainMenuImageNames[2] = "events"
	mainMenuImageNames[3] = "essentials"
	mainMenuImageNames[4] = "exhibitions"
	mainMenuImageNames[5] = "contact"
	mainMenuImageNames[6] = "site_map"
	
	for (var x=1; x<mainMenuImageNames.length; x++){
		for (var y=1; y<(selectionStates.length - 1); 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 == "profile"){	
		profileImageNames = new Array();
		profileImageNames[1] = "philosophy"
		profileImageNames[2] = "the_artist"
		profileImageNames[3] = "the_studio"
		profileImageNames[4] = "the_region"
	}else if (currentSection == "essentials"){
		essentialsImageNames = new Array();
		essentialsImageNames[1] = "concept"
		essentialsImageNames[2] = "implementation"
		essentialsImageNames[3] = "presentation"
	}else if (currentSection == "exhibitions"){
		exhibitionsImageNames = new Array();
		exhibitionsImageNames[1] = "g_wenzel"
		exhibitionsImageNames[2] = "gallery_288"
	}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 - 1); y++){
				imagePrefixURL = "../images/interface/menu_items/" + currentSection + "/submenu/" + 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"
			}
		}
	}

	//finally, preload the paging icons in case we use them (loop 5 times - the greatest number of pages)
	var pagingIconsImagePrefixURL = "../images/interface/paging_icons/"

	for (var x=1; x<=5; x++){
		for (var y=1; y<(selectionStates.length - 1); y++){
			eval("paging_icon" + [x] + "_" + selectionStates[y] + " = new Image()");
			eval("paging_icon" + [x] + "_" + selectionStates[y]).src = pagingIconsImagePrefixURL  + selectionStates[y] + "/" + [x] + ".gif"
		}
	}

	preloadsComplete = true
}

}

// -->