//this function creates new image objects

function create_rollover_images(image_name, off_image_source, on_image_source) {

	//create the new off image

	window[image_name + "_off"] = new Image();

	

	//assign the off image source

	window[image_name + "_off"].src = off_image_source;

	

	//create the new on image

	window[image_name + "_on"] = new Image();

	

	//assign the on image source

	window[image_name + "_on"].src = on_image_source;

}



//this function rolls the image on

function image_over(image_name) {

	if (document.images[image_name] && window[image_name + "_on"]) {

		document.images[image_name].src = window[image_name + "_on"].src;

	}

}



//this function rolls the image off

function image_out(image_name) {

	if (document.images[image_name] && window[image_name + "_off"]) {

		document.images[image_name].src = window[image_name + "_off"].src;

	}

}



//this shows the left and right nav pipes for the current main section

function set_main_section(image_name) {

	//show the left nav pipe

	if (document.images["left_pipe"] && window["left_pipe_on"]) {

		document.images["left_pipe"].src = window["left_pipe_on"].src;

	}

	

	//show the right nav pipe

	if (document.images["right_pipe_" + image_name] && window["right_pipe_on"]) {

		document.images["right_pipe_" + image_name].src = window["right_pipe_on"].src;

	}

}



//this function rolls over the current sub section and keeps it on (active)

function set_sub_section(image_name) {

	//set the off image source to the on image source

	if (window[image_name + "_off"] && window[image_name + "_on"]) {

		window[image_name + "_off"].src = window[image_name + "_on"].src;

	}

	

	//roll over the image

	image_over(image_name);

}



//this is called to preload the main navigation images

function preload_main_nav(image_name) {

	//load the main nav images

	create_rollover_images("smith", "/images/smith_off.gif", "/images/smith_on.gif");

	create_rollover_images("services", "/images/services_off.gif", "/images/services_on.gif");

	create_rollover_images("principals", "/images/principals_off.gif", "/images/principals_on.gif");

	create_rollover_images("awards", "/images/awards_off.gif", "/images/awards_on.gif");

	create_rollover_images("experience", "/images/experience_off.gif", "/images/experience_on.gif");

	create_rollover_images("clients", "/images/clients_off.gif", "/images/clients_on.gif");

	create_rollover_images("contact", "/images/contact_off.gif", "/images/contact_on.gif");

	

	//load the left and right nav pipes for the given section

	if (typeof(image_name) != "undefined") {

		//create the left pipe image

		window["left_pipe_on"] = new Image();

		

		//assign the left pipe source

		window["left_pipe_on"].src = "/images/" + image_name + "_left_pipe.gif";

		

		//create the right pipe image

		window["right_pipe_on"] = new Image();

		

		//assign the right pipe source

		window["right_pipe_on"].src = "/images/" + image_name + "_right_pipe.gif";

	}

}



//this is called to preload the sub navigation images for the given section

function preload_sub_nav(section_name) {

	switch(section_name) {

		case "smith":

			//load the images for "About Smith & Co."

			create_rollover_images("aboutus", "/images/aboutus_off.gif", "/images/aboutus_on.gif");

			create_rollover_images("whatclientssay", "/images/whatclientssay_off.gif", "/images/whatclientssay_on.gif");



			break;

		case "services":

			//load the images for "services"

			create_rollover_images("account", "/images/account_off.gif", "/images/account_on.gif");

			create_rollover_images("qualitative", "/images/qualitative_off.gif", "/images/qualitative_on.gif");

			create_rollover_images("ethnographic", "/images/ethnographic_off.gif", "/images/ethnographic_on.gif");

			create_rollover_images("business", "/images/business_off.gif", "/images/business_on.gif");

			create_rollover_images("quantitative", "/images/quantitative_off.gif", "/images/quantitative_on.gif");

			create_rollover_images("secondary", "/images/secondary_off.gif", "/images/secondary_on.gif");

			

			break;

		case "principals":

			//load the images for "about the principals"

			create_rollover_images("sue", "/images/sue_off.gif", "/images/sue_on.gif");

			create_rollover_images("rich", "/images/rich_off.gif", "/images/rich_on.gif");

			create_rollover_images("strategic", "/images/strategic_off.gif", "/images/strategic_on.gif");

			

			break;

		case "awards":

			//load the images for "awards and publications"

			create_rollover_images("awards_sub", "/images/awards_sub_off.gif", "/images/awards_sub_on.gif");

			create_rollover_images("publications", "/images/publications_off.gif", "/images/publications_on.gif");

			

			break;

		case "experience":

			//load the images for "selected experience"

			create_rollover_images("advertising", "/images/advertising_off.gif", "/images/advertising_on.gif");

			create_rollover_images("apparel", "/images/apparel_off.gif", "/images/apparel_on.gif");

			create_rollover_images("automotive", "/images/automotive_off.gif", "/images/automotive_on.gif");

			create_rollover_images("banking", "/images/banking_off.gif", "/images/banking_on.gif");

			create_rollover_images("entertainment", "/images/entertainment_off.gif", "/images/entertainment_on.gif");

			create_rollover_images("food", "/images/food_off.gif", "/images/food_on.gif");

			create_rollover_images("forest", "/images/forest_off.gif", "/images/forest_on.gif");

			create_rollover_images("healthcare", "/images/healthcare_off.gif", "/images/healthcare_on.gif");

			create_rollover_images("luxury", "/images/luxury_off.gif", "/images/luxury_on.gif");

			create_rollover_images("publishing", "/images/publishing_off.gif", "/images/publishing_on.gif");

			create_rollover_images("retail", "/images/retail_off.gif", "/images/retail_on.gif");

			create_rollover_images("state", "/images/state_off.gif", "/images/state_on.gif");

			create_rollover_images("telecomm", "/images/telecomm_off.gif", "/images/telecomm_on.gif");

			create_rollover_images("technology", "/images/technology_off.gif", "/images/technology_on.gif");

			

			break;

	}

}