/*	(c) Copyright 2003-2005 Studio Prima Inc.
	1108 19th Ave. East
	Seattle, WA 98112
	206 325-9037
	info@studioprima.com
	http://studioprima.com/
*/

var preloadFlag = false;
function preLoad_home() 
	{
	if (document.images) 
		{ 
		img1on  = new Image();img1on.src =  "images/home/btn_com_on.gif";
		img1off = new Image();img1off.src = "images/home/btn_com_off.gif";
		img2on  = new Image();img2on.src =  "images/home/btn_con_on.gif";
		img2off = new Image();img2off.src = "images/home/btn_con_off.gif";
		img3on  = new Image();img3on.src =  "images/home/btn_dif_on.gif";
		img3off = new Image();img3off.src = "images/home/btn_dif_off.gif";
		img4on  = new Image();img4on.src =  "images/home/btn_wha_on.gif";
		img4off = new Image();img4off.src = "images/home/btn_wha_off.gif";
		img5on  = new Image();img5on.src =  "images/home/btn_rea_on.gif";
		img5off = new Image();img5off.src = "images/home/btn_rea_off.gif";
		img6on  = new Image();img6on.src =  "images/home/btn_joi_on.gif";
		img6off = new Image();img6off.src = "images/home/btn_joi_off.gif";
		img7on  = new Image();img7on.src =  "images/home/btn_lan_on.gif";
		img7off = new Image();img7off.src = "images/home/btn_lan_off.gif";
		img8on  = new Image();img8on.src =  "images/home/btn_ear_on.gif";
		img8off = new Image();img8off.src = "images/home/btn_ear_off.gif";
		img10on  = new Image();img10on.src =  "images/home/btn_myc_on.gif";
		img10off = new Image();img10off.src = "images/home/btn_myc_off.gif";
		img12on  = new Image();img12on.src =  "images/home/btn_cus_on.gif";
		img12off = new Image();img12off.src = "images/home/btn_cus_off.gif";
		img13on  = new Image();img13on.src = "images/home/btn_han_on.gif";
		img13off = new Image();img13off.src = "images/home/btn_han_off.gif";
		
		common  = new Image();common.src =  "images/home/btn_comm_on.gif";
		commoff = new Image();commoff.src = "images/home/btn_comm_off.gif";
		earthon  = new Image();earthon.src =  "images/home/btn_earth_on.gif";
		earthoff = new Image();earthoff.src = "images/home/btn_earth_off.gif";
		abouton  = new Image();abouton.src =  "images/home/btn_about_on.gif";
		aboutoff = new Image();aboutoff.src = "images/home/btn_about_off.gif";
		newson  = new Image();newson.src =  "images/home/btn_news_on.gif";
		newsoff = new Image();newsoff.src = "images/home/btn_news_off.gif";
		joinon  = new Image();joinon.src =  "images/home/btn_join_on.gif";
		joinoff = new Image();joinoff.src = "images/home/btn_join_off.gif";
		landon  = new Image();landon.src =  "images/home/btn_land_on.gif";
		landoff = new Image();landoff.src = "images/home/btn_land_off.gif";
		contacton  = new Image();contacton.src =  "images/home/btn_contact_on.gif";
		contactoff = new Image();contactoff.src = "images/home/btn_contact_off.gif";
		myconneron  = new Image();myconneron.src =  "images/home/btn_myconner_on.gif";
		myconneroff = new Image();myconneroff.src = "images/home/btn_myconner_off.gif";
		customon  = new Image();customon.src =  "images/home/btn_custom_on.gif";
		customoff = new Image();customoff.src = "images/home/btn_custom_off.gif";		
		handymanon  = new Image();handymanon.src =  "images/home/btn_handyman_on.gif";
		handymanoff = new Image();handymanoff.src = "images/home/btn_handyman_off.gif";
		preloadFlag = true;
		}
	}

function preLoad() 
	{
	if (document.images) 
		{ 
		img1on  = new Image();img1on.src =  "images/btn_communities_on.gif";
		img1off = new Image();img1off.src = "images/btn_communities_off.gif";
		img2on  = new Image();img2on.src =  "images/btn_contact_on.gif";
		img2off = new Image();img2off.src = "images/btn_contact_off.gif";
		img3on  = new Image();img3on.src =  "images/btn_connerdifference_on.gif";
		img3off = new Image();img3off.src = "images/btn_connerdifference_off.gif";
		img4on  = new Image();img4on.src =  "images/btn_whatsnew_on.gif";
		img4off = new Image();img4off.src = "images/btn_whatsnew_off.gif";
		img5on  = new Image();img5on.src =  "images/btn_realtors_on.gif";
		img5off = new Image();img5off.src = "images/btn_realtors_off.gif";
		img6on  = new Image();img6on.src =  "images/btn_joinconner_on.gif";
		img6off = new Image();img6off.src = "images/btn_joinconner_off.gif";
		img7on  = new Image();img7on.src =  "images/btn_land_on.gif";
		img7off = new Image();img7off.src = "images/btn_land_off.gif";
		img8on  = new Image();img8on.src =  "images/btn_earthsense_on.gif";
		img8off = new Image();img8off.src = "images/btn_earthsense_off.gif";
		img9on  = new Image();img9on.src =  "images/btn_home_on.gif";
		img9off = new Image();img9off.src = "images/btn_home_off.gif";
		img10on  = new Image();img10on.src =  "images/btn_myconnerhome_on.gif";
		img10off = new Image();img10off.src = "images/btn_myconnerhome_off.gif";
		img12on  = new Image();img12on.src =  "images/btn_custom_on.gif";
		img12off = new Image();img12off.src = "images/btn_custom_off.gif";
		img13on  = new Image();img13on.src =  "images/btn_handyman_on.gif";
		img13off = new Image();img13off.src = "images/btn_handyman_off.gif";
		
		common  = new Image();common.src =  "images/btn_communities_on.gif";
		commoff = new Image();commoff.src = "images/btn_communities_off.gif";
		contacton  = new Image();contacton.src =  "images/btn_contact_on.gif";
		contactoff = new Image();contactoff.src = "images/btn_contact_off.gif";
		abouton  = new Image();abouton.src =  "images/btn_about_on.gif";
		aboutoff = new Image();aboutoff.src = "images/btn_about_off.gif";
		newson  = new Image();newson.src =  "images/btn_news_on.gif";
		newsoff = new Image();newsoff.src = "images/btn_news_off.gif";
		joinon  = new Image();joinon.src =  "images/btn_joinconner_on.gif";
		joinoff = new Image();joinoff.src = "images/btn_joinconner_off.gif";
		landon  = new Image();landon.src =  "images/btn_land_on.gif";
		landoff = new Image();landoff.src = "images/btn_land_off.gif";
		earthon  = new Image();earthon.src =  "images/btn_earthsense_on.gif";
		earthoff = new Image();earthoff.src = "images/btn_earthsense_off.gif";
		myconneron  = new Image();myconneron.src =  "images/btn_myconnerhome_on.gif";
		myconneroff = new Image();myconneroff.src = "images/btn_myconnerhome_off.gif";
		homeon  = new Image();homeon.src =  "images/btn_home_on.gif";
		homeoff = new Image();homeoff.src = "images/btn_home_off.gif";
		customon  = new Image();customon.src =  "images/btn_custom_on.gif";
		customoff = new Image();customoff.src = "images/btn_custom_off.gif";
		handymanon  = new Image();handymanon.src =  "images/btn_handyman_on.gif";
		handymanoff = new Image();handymanoff.src = "images/btn_handyman_off.gif";
		preloadFlag = true;
		}
	}


function preLoad_sub1() 
	{
	if (document.images) 
		{ 
		arrow_right_on  = new Image();arrow_right_on.src =  "images/arrow_right_on.gif";
		arrow_right_off = new Image();arrow_right_off.src = "images/arrow_right_off.gif";
		arrow_left_on  = new Image();arrow_left_on.src =  "images/arrow_left_on.gif";
		arrow_left_off = new Image();arrow_left_off.src = "images/arrow_left_off.gif";
		sub1p1on  = new Image();sub1p1on.src =  "images/community/btn_communityinfo_on.gif";
		sub1p1off = new Image();sub1p1off.src = "images/community/btn_communityinfo_off.gif";
		sub1p2on  = new Image();sub1p2on.src =  "images/community/btn_homesforsale_on.gif";
		sub1p2off = new Image();sub1p2off.src = "images/community/btn_homesforsale_off.gif";
		sub1p3on  = new Image();sub1p3on.src =  "images/community/btn_neighborplan_on.gif";
		sub1p3off = new Image();sub1p3off.src = "images/community/btn_neighborplan_off.gif";
		//sub1p4on  = new Image();sub1p4on.src =  "images/community/btn_floorplans_on.gif";
		//sub1p4off = new Image();sub1p4off.src = "images/community/btn_floorplans_off.gif";
		sub1p4on  = new Image();sub1p4on.src =  "images/community/btn_home_designs_on.gif";
		sub1p4off = new Image();sub1p4off.src = "images/community/btn_home_designs_off.gif";
		sub1p5on  = new Image();sub1p5on.src =  "images/community/btn_areaoverview_on.gif";
		sub1p5off = new Image();sub1p5off.src = "images/community/btn_areaoverview_off.gif";
		sub1p6on  = new Image();sub1p6on.src =  "images/community/btn_homefeatures_on.gif";
		sub1p6off = new Image();sub1p6off.src = "images/community/btn_homefeatures_off.gif";
		sub1p6featon  = new Image();sub1p6featon.src =  "images/community/feat_on.gif";
		sub1p6featoff = new Image();sub1p6featoff.src = "images/community/feat_off.gif";
		sub1p6glosson  = new Image();sub1p6glosson.src =  "images/community/gloss_on.gif";
		sub1p6glossoff = new Image();sub1p6glossoff.src = "images/community/gloss_off.gif";
		sub1p7on  = new Image();sub1p7on.src =  "images/community/btn_drivingdirections_on.gif";
		sub1p7off = new Image();sub1p7off.src = "images/community/btn_drivingdirections_off.gif";
		sub1p10on  = new Image();sub1p10on.src =  "images/community/btn_photogallery_on.gif";
		sub1p10off = new Image();sub1p10off.src = "images/community/btn_photogallery_off.gif";
		sub1p11on  = new Image();sub1p11on.src =  "images/community/btn_communitynews_on.gif";
		sub1p11off = new Image();sub1p11off.src = "images/community/btn_communitynews_off.gif";
		preloadFlag = true;
		}
	}

function preLoad_sub3() 
	{
	if (document.images) 
		{ 
		sub3p1on  = new Image();sub3p1on.src =  "images/history/btn_history_on.gif";
		sub3p1off = new Image();sub3p1off.src = "images/history/btn_history_off.gif";
		sub3p2on  = new Image();sub3p2on.src =  "images/history/btn_awards_on.gif";
		sub3p2off = new Image();sub3p2off.src = "images/history/btn_awards_off.gif";
		sub3p3on  = new Image();sub3p3on.src =  "images/history/btn_biographies_on.gif";
		sub3p3off = new Image();sub3p3off.src = "images/history/btn_biographies_off.gif";
		preloadFlag = true;
		}
	}

function preLoad_sub8() 
	{
	if (document.images) 
		{ 
		sub8p1on  = new Image();sub8p1on.src =  "images/earthsense/btn_interactive_home_on.gif";
		sub8p1off = new Image();sub8p1off.src = "images/earthsense/btn_interactive_home_off.gif";
		sub8p2on  = new Image();sub8p2on.src =  "images/earthsense/btn_earthsense_choose_on.gif";
		sub8p2off = new Image();sub8p2off.src = "images/earthsense/btn_earthsense_choose_off.gif";
		sub8p3on  = new Image();sub8p3on.src =  "images/earthsense/btn_earthsense_green_on.gif";
		sub8p3off = new Image();sub8p3off.src = "images/earthsense/btn_earthsense_green_off.gif";
		preloadFlag = true;
		}
	}

function preLoad_gallery() 
	{
	if (document.images) 
		{ 
		btn_left_on  = new Image();btn_left_on.src =  "images/gallery/btn_left_on.gif";
		btn_left_off = new Image();btn_left_off.src = "images/gallery/btn_left_off.gif";
		btn_right_on  = new Image();btn_right_on.src =  "images/gallery/btn_right_on.gif";
		btn_right_off = new Image();btn_right_off.src = "images/gallery/btn_right_off.gif";
		preloadFlag = true;
		}
	}

function preLoad_ebrochure() 
	{
	if (document.images) 
		{ 
		tab_daylight_on  = new Image();tab_daylight_on.src =  "images/ebrochure/tab_daylight_on.gif";
		tab_daylight_off = new Image();tab_daylight_off.src = "images/ebrochure/tab_daylight_off.gif";
		tab_entry_on  = new Image();tab_entry_on.src =  "images/ebrochure/tab_entry_on.gif";
		tab_entry_off = new Image();tab_entry_off.src = "images/ebrochure/tab_entry_off.gif";
		tab_exterior_on  = new Image();tab_exterior_on.src =  "images/ebrochure/tab_exterior_on.gif";
		tab_exterior_off = new Image();tab_exterior_off.src = "images/ebrochure/tab_exterior_off.gif";
		tab_main_on  = new Image();tab_main_on.src =  "images/ebrochure/tab_main_on.gif";
		tab_main_off = new Image();tab_main_off.src = "images/ebrochure/tab_main_off.gif";
		tab_upper_on  = new Image();tab_upper_on.src =  "images/ebrochure/tab_upper_on.gif";
		tab_upper_off = new Image();tab_upper_off.src = "images/ebrochure/tab_upper_off.gif";
		btn_create_on  = new Image();btn_create_on.src =  "images/ebrochure/btn_create_on.gif";
		btn_create_off = new Image();btn_create_off.src = "images/ebrochure/btn_create_off.gif";
		checkbox_selected  = new Image();checkbox_selected.src =  "images/ebrochure/checkbox_selected.gif";
		checkbox_off  = new Image();checkbox_off.src =  "images/ebrochure/checkbox_off.gif";
		checkbox_on  = new Image();checkbox_on.src =  "images/ebrochure/checkbox_on.gif";
		checkbox_dim_off  = new Image();checkbox_dim_off.src =  "images/ebrochure/checkbox_dim_off.gif";
		checkbox_dim_on  = new Image();checkbox_dim_on.src =  "images/ebrochure/checkbox_dim_on.gif";
		radio_selected  = new Image();radio_selected.src =  "images/ebrochure/radio_selected.gif";
		radio_off  = new Image();radio_off.src =  "images/ebrochure/radio_off.gif";
		radio_on  = new Image();radio_on.src =  "images/ebrochure/radio_on.gif";
		radio_dim_off  = new Image();radio_dim_off.src =  "images/ebrochure/radio_dim_off.gif";
		radio_dim_on  = new Image();radio_dim_on.src =  "images/ebrochure/radio_dim_on.gif";
		preloadFlag = true;
		}
	}

function preload_earthsense() {
	var es_images = new Array('floor', 'exterior', 'roof', 'insulation', 'mechanical', 'finishes', 'community', 'environmental');
	for (var i = 0; i < es_images.length; i++) {
		var img = es_images[i];
		es_images[i] = new Object();
		es_images[i].off = new Image();
		es_images[i].off.src = 'images/earthsense/lab_' + img + '.gif';
		es_images[i].on = new Image();
		es_images[i].on.src = 'images/earthsense/lab_' + img + '_on.gif';
		if (document.getElementById('nav').className.search(/all/) == -1) {
			es_images[i].gum = new Image();
			es_images[i].gum.src = 'images/earthsense/gum_' + img + '.gif';
			var a = document.getElementById('nav_' + img).firstChild;
			a.onmouseover = function() {
				es_over(this);
			}
			a.onmouseout = function() {
				es_out(this);
			}
		}
	}
}

function es_over(elm) {
	var name = elm.parentNode.id.match(/nav_(.*)/)[1];
	if (elm.className.search(/current/) == -1) {
		elm.parentNode.previousSibling.firstChild.src = 'images/earthsense/gum_' + name + '.gif';
	}
}

function es_out(elm) {
	if (elm.className.search(/current/) == -1) {
		elm.parentNode.previousSibling.firstChild.src = 'images/earthsense/gum_dim.gif';
	}
}

function change(){if (document.images && (preloadFlag == true)){for (var i=0; i<change.arguments.length; i+=2)
	{document[change.arguments[i]].src = eval(change.arguments[i+1] + ".src");}}}

function validate()
	{
	var FormPath;
	FormPath = document.contactform;

	if (FormPath.fname.value == "")
		{
		  alert("Please enter your name in the \"First Name\" field.");
		  FormPath.fname.focus();
		  return false;
		}
	if (FormPath.lname.value == "")
		{
		  alert("Please enter your name in the \"Last Name\" field.");
		  FormPath.lname.focus();
		  return false;
		}
	if (FormPath.email.value == "")
		{
		  alert("Please enter your e-mail in the \"E-Mail Address\" field.");
		  FormPath.email.focus();
		  return false;
		}
	if (FormPath.email.value != "")	
	{
		if (FormPath.email.value.indexOf('@') == -1 || FormPath.email.value.indexOf('.') == -1)
			{
			  alert("Your e-mail address is not formatted correctly. Please check it and try again.");
			  FormPath.email.focus();
			  return false;
			}
	}
	
	if (FormPath.address.value == "")
		{
		  alert("Please enter your address in the \"Address\" field.");
		  FormPath.address.focus();
		  return false;
		}
	if (FormPath.city.value == "")
		{
		  alert("Please enter your city in the \"City\" field.");
		  FormPath.city.focus();
		  return false;
		}
	if (FormPath.state.value == "")
		{
		  alert("Please enter your state in the \"State\" field.");
		  FormPath.state.focus();
		  return false;
		}
	if (FormPath.zip.value == "")
		{
		  alert("Please enter your zipcode in the \"Zip\" field.");
		  FormPath.zip.focus();
		  return false;
		}

myOption = -1;
for (i=FormPath.Community.length-1; i > -1; i--) {
if (FormPath.Community[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Please select a community");
FormPath.elements["Community"][0].focus();
return false;
}

}	
	
function showBrochureHelp(divid,x,y)
	{
	if (document.getElementById(divid)) 
		{
		document.getElementById(divid).style.left = x;
		document.getElementById(divid).style.top = y;
		document.getElementById(divid).style.display = 'block';
		}
	}

function hideBrochureHelp(divid)
	{
	if (document.getElementById(divid)) 
		{
		document.getElementById(divid).style.display = 'none';
		}
	}