var hp_fyh = new Image();
hp_fyh.src = "/assets/images/maronda/homepage/fyh_map.jpg";
var hp_fyh_fl = new Image();
hp_fyh_fl.src = "/assets/images/maronda/homepage/fyh_map_fl.jpg";
var hp_fyh_oh = new Image();
hp_fyh_oh.src = "/assets/images/maronda/homepage/fyh_map_oh.jpg";
var hp_fyh_ga = new Image();
hp_fyh_ga.src = "/assets/images/maronda/homepage/fyh_map_ga.jpg";
var hp_fyh_ky = new Image();
hp_fyh_ky.src = "/assets/images/maronda/homepage/fyh_map_ky.jpg";
var hp_fyh_pa = new Image();
hp_fyh_pa.src = "/assets/images/maronda/homepage/fyh_map_pa.jpg";

function hp_rollout() {
	document.getElementById("hp_fyh_map_img").src = hp_fyh.src;
}
function hp_fl_rollover() {
	document.getElementById("hp_fyh_map_img").src = hp_fyh_fl.src;
}
function hp_oh_rollover() {
	document.getElementById("hp_fyh_map_img").src = hp_fyh_oh.src;
}
function hp_ga_rollover() {
	document.getElementById("hp_fyh_map_img").src = hp_fyh_ga.src;
}
function hp_ky_rollover() {
	document.getElementById("hp_fyh_map_img").src = hp_fyh_ky.src;
}
function hp_pa_rollover() {
	document.getElementById("hp_fyh_map_img").src = hp_fyh_pa.src;
}

/** Pre-load all roll over and click images **/
var fyh = new Image();
fyh.src = "/assets/images/maronda/findYourHome/findMapBackground.jpg";
var pa_ro = new Image();
pa_ro.src = "/assets/images/maronda/findYourHome/pa_Rollover.jpg";
var oh_ro = new Image();
oh_ro.src = "/assets/images/maronda/findYourHome/oh_Rollover.jpg";
var ky_ro = new Image();
ky_ro.src = "/assets/images/maronda/findYourHome/ky_Rollover.jpg";
var ga_ro = new Image();
ga_ro.src = "/assets/images/maronda/findYourHome/ga_Rollover.jpg";
var fl_ro = new Image();
fl_ro.src = "/assets/images/maronda/findYourHome/fl_Rollover.jpg";
var pa_click = new Image();
pa_click.src = "/assets/images/maronda/findYourHome/pa_Click.jpg";
var oh_click = new Image();
oh_click.src = "/assets/images/maronda/findYourHome/oh_Click.jpg";
var ky_click = new Image();
ky_click.src = "/assets/images/maronda/findYourHome/ky_Click.jpg";
var ga_click = new Image();
ga_click.src = "/assets/images/maronda/findYourHome/ga_Click.jpg";
var fl_click = new Image();
fl_click.src = "/assets/images/maronda/findYourHome/fl_Click.jpg";
/** End pre-load of all roll over and click images **/

/** Load all image maps **/
original_iMap = new Array();
//original_iMap.push("<map id='map' name='map'>");
original_iMap.push("	<area shape='poly' coords='139,127,146,121,146,123,197,117,203,122,202,134,207,140,202,147,195,151,142,161' href='#' onmouseover='pa_Rollover();' title='Maronda Homes in Pennsylvania' alt='Maronda Homes in Pennsylvania' />");
original_iMap.push("	<area shape='poly' coords='91,138,106,135,117,139,124,136,138,127,140,162,133,169,127,179,127,185,119,180,111,183,102,178,98,178' href='#' onmouseover='oh_Rollover();' title='Maronda Homes in Ohio' alt='Maronda Homes in Ohio' />");
original_iMap.push("	<area shape='poly' coords='49,221,49,213,56,213,56,209,61,202,61,201,75,200,75,197,78,194,85,195,91,184,97,182,98,178,104,178,108,182,118,180,124,183,124,189,130,196,131,198,121,211,62,218,63,221' href='#' onmouseover='ky_Rollover();' title='Maronda Homes in Kentucky' alt='Maronda Homes in Kentucky' />");	
original_iMap.push("	<area shape='poly' coords='95,241,121,236,125,244,131,247,148,262,159,278,155,297,150,297,149,303,111,304,108,293,107,285,108,277,102,270' href='#' onmouseover='ga_Rollover();' title='Maronda Homes in Georgia' alt='Maronda Homes in Georgia' />");
original_iMap.push("	<area shape='poly' coords='77,306,107,301,114,304,148,302,151,298,156,299,173,328,185,351,186,365,184,378,179,379,162,368,155,359,149,349,150,343,147,342,147,329,133,318,127,313,112,319,104,319,93,313,86,314' href='#' onmouseover='fl_Rollover();' title='Maronda Homes in Florida' alt='Maronda Homes in Florida' />");
//original_iMap.push("</map>");
paRO_iMap = new Array();
//paRO_iMap.push("<map id='paRO' name='paRO'>");
paRO_iMap.push("	<area shape='poly' coords='129,126,140,118,141,122,185,116,201,115,208,122,206,136,212,143,205,153,199,154,142,167,134,166' href='/region/pittsburgh' onmouseout='rollout();' title='Maronda Homes in Pennsylvania' alt='Maronda Homes in Pennsylvania' />");
paRO_iMap.push("	<area shape='poly' coords='92,138,96,179,102,179,108,183,120,182,124,184,133,168,128,135,118,140,105,136' href='#' onmouseover='oh_Rollover();' onmouseout='rollout();' title='OH' alt='OH' />");
paRO_iMap.push("	<area shape='poly' coords='49,221,49,213,56,213,56,209,61,202,61,201,75,200,75,197,78,194,85,195,91,184,97,182,98,178,104,178,108,182,118,180,124,183,124,189,130,196,131,198,121,211,62,218,63,221' href='#' onmouseover='ky_Rollover();' onmouseout='rollout();' title='KY' alt='KY' />");	
paRO_iMap.push("	<area shape='poly' coords='95,241,121,236,125,244,131,247,148,262,159,278,155,297,150,297,149,303,111,304,108,293,107,285,108,277,102,270' href='#' onmouseover='ga_Rollover();' onmouseout='rollout();' title='GA' alt='GA' />");
paRO_iMap.push("	<area shape='poly' coords='77,306,107,301,114,304,148,302,151,298,156,299,173,328,185,351,186,365,184,378,179,379,162,368,155,359,149,349,150,343,147,342,147,329,133,318,127,313,112,319,104,319,93,313,86,314' href='#' onmouseover='fl_Rollover();' onmouseout='rollout();' title='FL' alt='FL' />");
//paRO_iMap.push("</map>");
ohRO_iMap = new Array();
//ohRO_iMap.push("<map id='ohRO' name='ohRO'>");
ohRO_iMap.push("	<area shape='poly' coords='144,123,148,124,196,120,203,123,201,138,206,141,202,149,195,151,147,162,148,151' href='#' onmouseover='pa_Rollover();' onmouseout='rollout();' title='PA' alt='PA' />");
ohRO_iMap.push("	<area shape='poly' coords='86,134,107,131,117,135,127,131,140,122,144,122,148,155,141,169,133,177,129,187,123,189,118,184,109,187,97,182,93,182' href='javascript:oh_Click();' onmouseout='rollout();' title='Maronda Homes in Ohio' alt='Maronda Homes in Ohio' />");
ohRO_iMap.push("	<area shape='poly' coords='48,222,50,214,57,214,57,209,61,205,61,202,73,201,81,195,85,196,91,187,98,183,110,189,120,185,131,198,121,212,63,219,59,222' href='#' onmouseover='ky_Rollover();' onmouseout='rollout();' title='KY' alt='KY' />");
ohRO_iMap.push("	<area shape='poly' coords='95,241,121,236,125,244,131,247,148,262,159,278,155,297,150,297,149,303,111,304,108,293,107,285,108,277,102,270' href='#' onmouseover='ga_Rollover();' onmouseout='rollout();' title='GA' alt='GA' />");
ohRO_iMap.push("	<area shape='poly' coords='77,306,107,301,114,304,148,302,151,298,156,299,173,328,185,351,186,365,184,378,179,379,162,368,155,359,149,349,150,343,147,342,147,329,133,318,127,313,112,319,104,319,93,313,86,314' href='#' onmouseover='fl_Rollover();' onmouseout='rollout();' title='FL' alt='FL' />");
//ohRO_iMap.push("</map>");
kyRO_iMap = new Array();
//kyRO_iMap.push("<map id='kyRO' name='kyRO'>");
kyRO_iMap.push("	<area shape='poly' coords='139,127,146,121,146,123,197,117,203,122,202,134,207,140,202,147,195,151,142,161' href='#' onmouseover='pa_Rollover();' onmouseout='rollout();' title='PA' alt='PA' />");
kyRO_iMap.push("	<area shape='poly' coords='92,139,107,137,117,140,137,129,141,162,132,170,128,179,123,175,112,178,101,172,96,173' href='#' onmouseover='oh_Rollover();' onmouseout='rollout();' title='OH' alt='OH' />");
kyRO_iMap.push("	<area shape='poly' coords='36,228,38,220,39,214,46,214,52,205,53,200,67,199,75,193,79,195,86,183,93,180,95,173,101,173,110,179,122,177,129,181,133,191,139,198,122,216,58,225,55,227' href='javascript:ky_Click();' onmouseout='rollout();' title='Maronda Homes in Kentucky' alt='Maronda Homes in Kentucky' />");
kyRO_iMap.push("	<area shape='poly' coords='95,241,121,236,125,244,131,247,148,262,159,278,155,297,150,297,149,303,111,304,108,293,107,285,108,277,102,270' href='#' onmouseover='ga_Rollover();' onmouseout='rollout();' title='GA' alt='GA' />");
kyRO_iMap.push("	<area shape='poly' coords='77,306,107,301,114,304,148,302,151,298,156,299,173,328,185,351,186,365,184,378,179,379,162,368,155,359,149,349,150,343,147,342,147,329,133,318,127,313,112,319,104,319,93,313,86,314' href='#' onmouseover='fl_Rollover();' onmouseout='rollout();' title='FL' alt='FL' />");
//kyRO_iMap.push("</map>");
gaRO_iMap = new Array();
//gaRO_iMap.push("<map id='gaRO' name='gaRO'>");
gaRO_iMap.push("	<area shape='poly' coords='139,127,146,121,146,123,197,117,203,122,202,134,207,140,202,147,195,151,142,161' href='#' onmouseover='pa_Rollover();' onmouseout='rollout();' title='PA' alt='PA' />");
gaRO_iMap.push("	<area shape='poly' coords='91,138,106,135,117,139,124,136,138,127,140,162,133,169,127,179,127,185,119,180,111,183,102,178,98,178' href='#' onmouseover='oh_Rollover();' onmouseout='rollout();' title='OH' alt='OH' />");
gaRO_iMap.push("	<area shape='poly' coords='49,221,49,213,56,213,56,209,61,202,61,201,75,200,75,197,78,194,85,195,91,184,97,182,98,178,104,178,108,182,118,180,124,183,124,189,130,196,131,198,121,211,62,218,63,221' href='#' onmouseover='ky_Rollover();' onmouseout='rollout();' title='KY' alt='KY' />");	
gaRO_iMap.push("	<area shape='poly' coords='89,238,125,232,126,239,132,242,148,258,164,277,168,280,161,305,155,306,154,312,149,310,110,312,104,306,104,297,101,291,104,282,101,277' href='javascript:ga_Click();' onmouseout='rollout();' title='Maronda Homes in Georgia' alt='Maronda Homes in Georgia' />");
gaRO_iMap.push("	<area shape='poly' coords='76,306,104,302,104,307,109,313,148,311,153,313,155,312,155,307,158,307,168,325,173,327,175,335,184,351,187,368,184,373,184,379,178,379,162,370,161,364,152,356,149,350,148,344,146,345,145,331,142,326,133,319,127,315,122,315,114,320,108,321,102,317,98,316,94,316,90,316,80,314' href='#' onmouseover='fl_Rollover();' onmouseout='rollout();' title='FL' alt='FL' />");
//gaRO_iMap.push("</map>");
flRO_iMap = new Array();
//flRO_iMap.push("<map id='flRO' name='flRO'>");
flRO_iMap.push("	<area shape='poly' coords='139,127,146,121,146,123,197,117,203,122,202,134,207,140,202,147,195,151,142,161' href='#' onmouseover='pa_Rollover();' onmouseout='rollout();' title='PA' alt='PA' />");
flRO_iMap.push("	<area shape='poly' coords='91,138,106,135,117,139,124,136,138,127,140,162,133,169,127,179,127,185,119,180,111,183,102,178,98,178' href='#' onmouseover='oh_Rollover();' onmouseout='rollout();' title='OH' alt='OH' />");
flRO_iMap.push("	<area shape='poly' coords='49,221,49,213,56,213,56,209,61,202,61,201,75,200,75,197,78,194,85,195,91,184,97,182,98,178,104,178,108,182,118,180,124,183,124,189,130,196,131,198,121,211,62,218,63,221' href='#' onmouseover='ky_Rollover();' onmouseout='rollout();' title='KY' alt='KY' />");	
flRO_iMap.push("	<area shape='poly' coords='95,242,122,238,126,244,139,255,149,264,159,278,156,293,149,295,145,298,109,301,106,290,109,280,104,273' href='#' onmouseover='ga_Rollover();' onmouseout='rollout();' title='GA' alt='GA' />");
flRO_iMap.push("	<area shape='poly' coords='66,303,105,298,109,302,146,300,146,297,155,296,173,325,177,330,179,339,189,355,192,372,188,385,180,389,153,364,146,353,142,347,143,331,135,325,123,315,113,320,103,323,92,317,84,320,70,313' href='javascript:fl_Click();' onmouseout='rollout();' title='Maronda Homes in Florida' alt='Maronda Homes in Florida' />");
//flRO_iMap.push("</map>");
paClick_iMap = new Array();
//paClick_iMap.push("<map id='paClick' name='paClick'>");
paClick_iMap.push("	<area shape='rect' coords='61,223,137,242' href='/region/pittsburgh' title='Pittsburgh' alt='Pittsburgh' />");
paClick_iMap.push("	<area shape='rect' coords='250,12,264,25' href='javascript:closeClick();' title='Close' alt='Close' />");
//paClick_iMap.push("</map>");
ohClick_iMap = new Array();
//ohClick_iMap.push("<map id='ohClick' name='ohClick'>");
ohClick_iMap.push("	<area shape='rect' coords='73,195,148,216' href='/region/columbus' title='Columbus' alt='Columbus' />");
ohClick_iMap.push("	<area shape='rect' coords='66,262,141,280' href='/region/cincinnati' title='Cincinnati' alt='Cincinnati' />");
ohClick_iMap.push("	<area shape='rect' coords='250,12,264,25' href='javascript:closeClick();' title='Close' alt='Close' />");
//ohClick_iMap.push("</map>");
kyClick_iMap = new Array();
//kyClick_iMap.push("<map id='kyClick' name='kyClick'>");
kyClick_iMap.push("	<area shape='rect' coords='89,134,162,154' href='/region/cincinnati' title='Cincinnati' alt='Cincinnati' />");
kyClick_iMap.push("	<area shape='rect' coords='250,12,264,25' href='javascript:closeClick();' title='Close' alt='Close' />");
//kyClick_iMap.push("</map>");
gaClick_iMap = new Array();
//gaClick_iMap.push("<map id='gaClick' name='gaClick'>");
gaClick_iMap.push("	<area shape='rect' coords='169,232,245,252' href='/region/georgia' title='SE Georgia' alt='SE Georgia' />");
gaClick_iMap.push("	<area shape='rect' coords='158,314,247,333' href='/region/northflorida' title='North Florida' alt='North Florida' />");
gaClick_iMap.push("	<area shape='rect' coords='250,12,264,25' href='javascript:closeClick();' title='Close' alt='Close' />");
//gaClick_iMap.push("</map>");
flClick_iMap = new Array();
//flClick_iMap.push("<map id='flClick' name='flClick'>");
flClick_iMap.push("	<area shape='rect' coords='149,99,222,117' href='/region/northflorida' title='North Florida' alt='North Florida' />");
flClick_iMap.push("	<area shape='rect' coords='112,165,186,183' href='/region/central' title='Central' alt='Central' />");
flClick_iMap.push("	<area shape='rect' coords='202,174,267,200' href='/region/treasureCoast' title='Treasure Coast' alt='Treasure Coast' />");
flClick_iMap.push("	<area shape='rect' coords='111,221,185,240' href='/region/suncoast' title='Sun Coast' alt='Sun Coast' />");
flClick_iMap.push("	<area shape='rect' coords='250,12,264,25' href='javascript:closeClick();' title='Close' alt='Close' />");
//flClick_iMap.push("</map>");
/** End load all images maps **/

somethingClicked = false;
function rollout() {
	if(somethingClicked) return;

	document.getElementById("findYourHomeSearch").style.background = "url(" + fyh.src + ") no-repeat";
	s = "";
	for(i in original_iMap) {
		s += original_iMap[i];
	}
	
	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#map";
}

function closeClick() {
	document.getElementById("findYourHomeSearch").style.background = "url(" + fyh.src + ") no-repeat";
	s = "";
	for(i in original_iMap) {
		s += original_iMap[i];
	}
	
	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#map";
}
function pa_Rollover() {
	window.status = "pa_Rollover";
	document.getElementById("findYourHomeSearch").style.background = "url(" + pa_ro.src + ") no-repeat";
	s = "";
	for(i in paRO_iMap) {
		s += paRO_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#paRO";

}
function oh_Rollover() {
	window.status = "oh_Rollover";
	document.getElementById("findYourHomeSearch").style.background = "url(" + oh_ro.src + ") no-repeat";
	s = "";
	for(i in ohRO_iMap) {
		s += ohRO_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#ohRO";
}
function ky_Rollover() {
	window.status = "ky_Rollover";
	document.getElementById("findYourHomeSearch").style.background = "url(" + ky_ro.src + ") no-repeat";
	s = "";
	for(i in kyRO_iMap) {
		s += kyRO_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#kyRO";
}
function ga_Rollover() {
	window.status = "ga_Rollover";
	document.getElementById("findYourHomeSearch").style.background = "url(" + ga_ro.src + ") no-repeat";
	s = "";
	for(i in gaRO_iMap) {
		s += gaRO_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#gaRO";
}
function fl_Rollover() {
	window.status = "fl_Rollover";
	document.getElementById("findYourHomeSearch").style.background = "url(" + fl_ro.src + ") no-repeat";
	s = "";
	for(i in flRO_iMap) {
		s += flRO_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#flRO";
}
function pa_Click() {
	somethingClicked = true;
	window.status = "pa_Click";
	document.getElementById("findYourHomeSearch").style.background = "url(" + pa_click.src + ") no-repeat";
	s = "";
	for(i in paClick_iMap) {
		s += paClick_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#paClick";
}
function oh_Click() {
	somethingClicked = true;
	window.status = "oh_Click";
	document.getElementById("findYourHomeSearch").style.background = "url(" + oh_click.src + ") no-repeat";
	s = "";
	for(i in ohClick_iMap) {
		s += ohClick_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#ohClick";
}
function ky_Click() {
	somethingClicked = true;
	window.status = "ky_Click";
	document.getElementById("findYourHomeSearch").style.background = "url(" + ky_click.src + ") no-repeat";
	s = "";
	for(i in kyClick_iMap) {
		s += kyClick_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#kyClick";
}
function ga_Click() {
	somethingClicked = true;
	window.status = "ga_Click";
	document.getElementById("findYourHomeSearch").style.background = "url(" + ga_click.src + ") no-repeat";
	s = "";
	for(i in gaClick_iMap) {
		s += gaClick_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#gaClick";
}
function fl_Click() {
	somethingClicked = true;
	window.status = "fl_Click";
	document.getElementById("findYourHomeSearch").style.background = "url(" + fl_click.src + ") no-repeat";
	s = "";
	for(i in flClick_iMap) {
		s += flClick_iMap[i];
	}

	//document.getElementById("iMap").innerHTML = s;
	document.getElementById("map").innerHTML = s;
	//document.getElementById("mapPic").useMap = "#flClick";
}

function getCitySelect(state) {
/** The plan is to do this static for now, but eventually maintain an xml file that is read by javascript**/
 
	city = document.getElementById("citySelect");
	
	for(i=city.length-1; i>0; i--) {
		city.remove(i);
	}
	
	switch(state) {
		case "PA":
			newOption1 = document.createElement("option");
			newOption1.text = "Pittsburgh";
			newOption1.value = "pittsburgh";
			newOption1.selected = true;
			try {
				city.add(newOption1, null); // standards compliant
			} catch(ex) {
				city.add(newOption1); // IE
			}
			try {
				pa_Click();
			}catch(e){}
			break;
		case "OH":
			newOption1 = document.createElement("option");
			newOption1.text = "Columbus";
			newOption1.value = "columbus";
			newOption2 = document.createElement("option");
			newOption2.text = "Cincinnati";
			newOption2.value = "cincinnati";
			try {
				city.add(newOption1, null); // standards compliant
				city.add(newOption2, null); // standards compliant
			} catch(ex) {
				city.add(newOption1); // IE
				city.add(newOption2); // IE
			}
			try {
				oh_Click();
			}catch(e){}
			break;
		case "KY":
			newOption1 = document.createElement("option");
			newOption1.text = "Kentucky";
			newOption1.value = "kentucky";
			try {
				city.add(newOption1, null); // standards compliant
			} catch(ex) {
				city.add(newOption1); // IE
			}
			try {
				ky_Click();
			}catch(e){}
			break;
		case "GA":
			newOption1 = document.createElement("option");
			newOption1.text = "Georgia";
			newOption1.value = "georgia";
			newOption2 = document.createElement("option");
			newOption2.text = "\u0020\u0020-\u0020St. Mary's";
			newOption2.value = "georgia";
			newOption3 = document.createElement("option");
			newOption3.text = "\u0020\u0020-\u0020Jacksonville, FL";
			newOption3.value = "northflorida";
			try {
				city.add(newOption1, null); // standards compliant
				city.add(newOption3, null); // standards compliant
				city.add(newOption2, null); // standards compliant
			} catch(ex) {
				city.add(newOption1); // IE
				city.add(newOption3); // IE
				city.add(newOption2); // IE
			}
			try {
				ga_Click();
			}catch(e){}
			break;
		case "FL":
			newOption1 = document.createElement("option");
			newOption1.className = "italic";
			newOption1.text = "North Florida";
			newOption1.value = "northflorida";
			newOption5 = document.createElement("option");
			newOption5.text = "\u0020\u0020-\u0020Jacksonville";
			newOption5.value = "northflorida";
			newOption11 = document.createElement("option");
			newOption11.text = "\u0020\u0020-\u0020Gainesville";
			newOption11.value = "northflorida";
			newOption12 = document.createElement("option");
			newOption12.text = "\u0020\u0020-\u0020Palm Coast";
			newOption12.value = "northflorida";
			newOption21 = document.createElement("option");
			newOption21.text = "\u0020\u0020-\u0020Lake City";
			newOption21.value = "northflorida";
			newOption24 = document.createElement("option");
			newOption24.text = "\u0020\u0020-\u0020St. Augustine";
			newOption24.value = "northflorida";

			newOption2 = document.createElement("option");
			newOption2.className = "italic";
			newOption2.text = "Central";
			newOption2.value = "central";
			newOption6 = document.createElement("option");
			newOption6.text = "\u0020\u0020-\u0020Orlando";
			newOption6.value = "central";
			newOption9 = document.createElement("option");
			newOption9.text = "\u0020\u0020-\u0020Daytona Beach";
			newOption9.value = "central";
			newOption10 = document.createElement("option");
			newOption10.text = "\u0020\u0020-\u0020Ocala";
			newOption10.value = "central";
			newOption3 = document.createElement("option");
			newOption3.className = "italic";
			newOption3.text = "Sun Coast";
			newOption3.value = "suncoast";
			newOption7 = document.createElement("option");
			newOption7.text = "\u0020\u0020-\u0020Tampa";
			newOption7.value = "suncoast";
			//newOption13 = document.createElement("option");
			//newOption13.text = "\u0020\u0020-\u0020North Port";
			//newOption13.value = "suncoast";
			newOption14 = document.createElement("option");
			newOption14.text = "\u0020\u0020-\u0020Winter Haven";
			newOption14.value = "suncoast";

			newOption16 = document.createElement("option");
			newOption16.text = "\u0020\u0020-\u0020Port Charlotte";
			newOption16.value = "suncoast";
			newOption17 = document.createElement("option");
			newOption17.text = "\u0020\u0020-\u0020Lakeland";
			newOption17.value = "suncoast";
			//newOption18 = document.createElement("option");
			//newOption18.text = "\u0020\u0020-\u0020Auburndale";
			//newOption18.value = "suncoast";
			//newOption19 = document.createElement("option");
			//newOption19.text = "\u0020\u0020-\u0020Dade City";
			//newOption19.value = "suncoast";
			newOption20 = document.createElement("option");
			newOption20.text = "\u0020\u0020-\u0020Spring Hill";
			newOption20.value = "suncoast";


			newOption4 = document.createElement("option");
			newOption4.className = "italic";
			newOption4.text = "Treasure Coast";
			newOption4.value = "treasurecoast";
			newOption8 = document.createElement("option");
			newOption8.text = "\u0020\u0020-\u0020Brevard Co.";
			newOption8.value = "treasurecoast";
			newOption15 = document.createElement("option");
			newOption15.text = "\u0020\u0020-\u0020Vero Beach / Sebastian";
			newOption15.value = "treasurecoast";
			newOption22 = document.createElement("option");
			newOption22.text = "\u0020\u0020-\u0020Pt. St. Lucie";
			newOption22.value = "treasurecoast";
			newOption23 = document.createElement("option");
			newOption23.text = "\u0020\u0020-\u0020Space Coast";
			newOption23.value = "treasurecoast";
			try {
				city.add(newOption1, null); // standards compliant
				city.add(newOption11, null); // standards compliant
				city.add(newOption5, null); // standards compliant
				city.add(newOption21, null); // standards compliant
				city.add(newOption12, null); // standards compliant
				city.add(newOption24, null); // standards compliant

				city.add(newOption2, null); // standards compliant
				city.add(newOption9, null); // standards compliant
				city.add(newOption10, null); // standards compliant
				city.add(newOption6, null); // standards compliant

				city.add(newOption3, null); // standards compliant
				//city.add(newOption18, null); // standards compliant
				//city.add(newOption19, null); // standards compliant
				city.add(newOption17, null); // standards compliant
				//city.add(newOption13, null); // standards compliant
				city.add(newOption16, null); // standards compliant
				city.add(newOption20, null); // standards compliant
				city.add(newOption7, null); // standards compliant
				city.add(newOption14, null); // standards compliant

				city.add(newOption4, null); // standards compliant
				city.add(newOption8, null); // standards compliant
				city.add(newOption15, null); // standards compliant
				city.add(newOption22, null); // standards compliant
				city.add(newOption23, null); // standards compliant
			} catch(ex) {
				city.add(newOption1); // IE
				city.add(newOption11); // IE
				city.add(newOption5); // IE
				city.add(newOption21); // IE
				city.add(newOption12); // IE
				city.add(newOption24); // IE

				city.add(newOption2); // IE
				city.add(newOption9); // IE
				city.add(newOption10); // IE
				city.add(newOption6); // IE

				city.add(newOption3); // IE
				//city.add(newOption18); // IE
				//city.add(newOption19); // IE
				city.add(newOption17); // IE
				//city.add(newOption13); // IE
				city.add(newOption16); // IE
				city.add(newOption20); // IE
				city.add(newOption7); // IE
				city.add(newOption14); // IE

				city.add(newOption4); // IE
				city.add(newOption8); // IE
				city.add(newOption15); // IE
				city.add(newOption22); // IE
				city.add(newOption23); // IE
			}
			try{
				fl_Click();
			}catch(e){}
			break;
		default :
			closeClick();
		 
	}
}

/** Find A Community button was pressed on the Find Your Home main page (home page) **/
function goToCommunities() {
	cityVal = document.getElementById("citySelect").value
	if(cityVal == "") {
		alert("Please choose a State and City");
		return;
	}
	window.location = "/region/" + cityVal;
}

/** Find an Express Delivery Home button was pressed on the Find Your Home main page (home page) **/
function goToExpress() {
	cityVal = document.getElementById("citySelect").value
	if(cityVal == "") {
		alert("Please choose a State and City");
		return;
	}
	window.location = "/express-delivery/" + cityVal;
}
var autoRotate = true;
var rotations = 0;
function autoRotateHeadlines() {
    if(autoRotate && rotations > 0) {
		fadeOut();	
	}
	if(autoRotate) {
		rotations++;
		window.setTimeout('autoRotateHeadlines()', 6000);
	}
}

function rotateHeadlineLeft() {
    autoRotate = false;
    fadeOutLeft();
}
function continueLeft() {
	imageDiv = document.getElementById("rotatingImages");
    textDiv = document.getElementById("headlinesText");	
	if(imageDiv.style.left == "") imageDiv.style.left = "0px";
	if(textDiv.style.left == "") textDiv.style.left = "0px";
	
	if((parseInt(imageDiv.style.left, 10) + 340) > 0 ){
		imageDiv.style.left = (parseInt(imageDiv.style.left, 10) - (340*5)) + "px";
		textDiv.style.left = (parseInt(textDiv.style.left, 10) - (338*5)) + "px";
	} else {
		imageDiv.style.left = (parseInt(imageDiv.style.left, 10) + 340) + "px";
		textDiv.style.left = (parseInt(textDiv.style.left, 10) + 338) + "px";
	}
}
function rotateHeadlineRight() {
    autoRotate = false;
    fadeOut();
}
function continueRight() {
	imageDiv = document.getElementById("rotatingImages");
    textDiv = document.getElementById("headlinesText");	
	if(imageDiv.style.left == "") imageDiv.style.left = "0px";
	if(textDiv.style.left == "") textDiv.style.left = "0px";
	if((parseInt(imageDiv.style.left, 10) - 340) < -(340 * 5)){
		imageDiv.style.left = "0px";
		textDiv.style.left = "0px";
	} else {
		imageDiv.style.left = (parseInt(imageDiv.style.left, 10) - 340) + "px";
		textDiv.style.left = (parseInt(textDiv.style.left, 10) - 338) + "px";
	}
}

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };

function assembleTable() {
/*
php makes the following objects to use
name, regId, id, township, type, price, glat, glon -- all arrays ordered by name
*/
	magnifyingGlass = new Image();
	magnifyingGlass.src = "/assets/images/maronda/region/magnifyingglass.gif";
	theTable = document.getElementById("community-results").getElementsByTagName("tbody")[0];
	for(i=0; i<commName.length; i++) {
		row = document.createElement("tr");
		cell0 = document.createElement("td");
		cell0.className = "row" + i;
		cell0Img = new Image();
		cell0Img.src = magnifyingGlass.src;
		cell0Img.style.marginLeft = 10 + "px";
		cell0.style.border = 0;
		cell0.appendChild(cell0Img);
		cell1 = document.createElement("td");
		cell1.className = "row" + i;
		cell1.style.textDecoration = "underline";
		cell1.style.color = "#224F78";
		cell1.style.textTransform = "capitalize";
		/*link1 = document.createElement("a");
		link1.setAttribute("href", "index.php?id=15&cno=" + cno + "&rid=" + region[i] + "&sid=" + sub[i]);
		link1.appendChild(document.createTextNode(commName[i]));
		cell1.appendChild(link1);*/
		cell1.appendChild(document.createTextNode(commName[i].replace(" T/H", "").replace(" TOWNHOMES", "").toLowerCase()));
		cell2 = document.createElement("td");
		cell2.className = "row" + i;
		cell2.appendChild(document.createTextNode(township[i]));
		cell3 = document.createElement("td");
		cell3.className = "row" + i;
		if(type1[i] == "TH") {
			cell3.style.color = "#224F78";
		} else if(type1[i] == "SF") {
			cell3.style.color = "#8A1C28";
		}
		cell3.appendChild(document.createTextNode(type1[i]));
		cell4 = document.createElement("td");
		cell4.className = "row" + i;
		cell4.appendChild(document.createTextNode(price[i]));

		cell5 = document.createElement("td");
		cell5.className = "row" + i;
		
		/*if(i%2 == 0){
			cell1.style.background = "#ebf6ec";
			cell2.style.background = "#ebf6ec";
			cell3.style.background = "#ebf6ec";
			cell4.style.background = "#ebf6ec";
		}*/

		row.onmouseover = Function("this.className += ' over';");
		row.onmouseout = Function("this.className.indexOf(' over')!=-1?this.className=this.className.replace(' over', ''):false;");
		
		/*tableCellMouseOver = Function("document.styleSheets[0].insertRule('table#community-results td.row" + i + " { background : #dceff2; }', document.styleSheets[1].cssRules.length);");
		tableCellMouseOut = Function("document.styleSheets[0].deleteRule(document.styleSheets[1].cssRules.length-1);");*/
		
		/*cell1.onmouseover = tableCellMouseOver;
		cell1.onmouseout = tableCellMouseOut;
		cell2.onmouseover = tableCellMouseOver;
		cell2.onmouseout = tableCellMouseOut;
		cell3.onmouseover = tableCellMouseOver;
		cell3.onmouseout = tableCellMouseOut;
		cell4.onmouseover = tableCellMouseOver;
		cell4.onmouseout = tableCellMouseOut;*/
		
		tableCellOnClick = new Function("goToCommunity(" + i + ");");
		
		cell0.onclick = tableCellOnClick;
		cell1.onclick = tableCellOnClick;
		cell2.onclick = tableCellOnClick;
		cell3.onclick = tableCellOnClick;
		cell4.onclick = tableCellOnClick;
		
		row.appendChild(cell0);
		row.appendChild(cell1);
		row.appendChild(cell2);
		row.appendChild(cell3);
		row.appendChild(cell4);
		row.appendChild(cell5);
		theTable.appendChild(row);
	}
}

function goToCommunity(n, city) {
	//alert(cno + "  " + region[n] + "   " + sub[n]);
	//window.location = "index.php?id=15&cno=" + cno + "&rid=" + region[n] + "&sid=" + sub[n];
	window.location = "/community/" + city + "/" + sub[n];
}
function goToCommunity_fromTour(c, s) {
	window.location = "/community/" + c + "/" + s;
}
function goToHomeDesign(c, s, m) {
	//alert(cno + "  " + region[n] + "   " + sub[n]);
	//window.location = "index.php?id=16&cno=" + c + "&rid=" + r + "&sid=" + s + "&mdl=" + m;
	window.location = "/home-design/" + c + "/" + s + "/" + m;
}

function sortTableSelect(theSelect, oValue) {
	var colNum = 0;
	switch(oValue) {
		case "name":
			colNum = 1;
			break;
		case "township":
			colNum = 2;			
			break;
		case "type":
			colNum = 3;		
			break;
		case "price":
			colNum = 4;
			break;
		default:
			colNum = 1;
	}
	
	theSelect.options[0].selected = true;
	
	t = document.getElementById("community-results-header");

	var firstRow = t.rows[0];

	if (!firstRow) return;
	
	var lnk = "";
	var cell = firstRow.cells[colNum];
	if (cell.className != "unsortable" && cell.className.indexOf("unsortable") == -1) {
		for (var ci=0;ci<cell.childNodes.length;ci++) {
			if (cell.childNodes[ci].tagName && cell.childNodes[ci].tagName.toLowerCase() == 'a') lnk = cell.childNodes[ci];
		}
	}
	ts_resortTable(lnk, colNum);
}

function sortTableSelect2(theSelect, oValue) {
	var colNum = 0;
	switch(oValue) {
		case "name":
			colNum = 7;
			break;
		case "township":
			colNum = 6;			
			break;
		case "ba":
			colNum = 3;		
			break;
		case "bd":
			colNum = 2;
			break;
		case "model":
			colNum = 1;		
			break;
		case "sqft":
			colNum = 4;
			break;
		case "garage":
			colNum = 5;		
			break;
		default:
			colNum = 1;
	}
	
	theSelect.options[0].selected = true;
	
	t = document.getElementById("tour-results-header");

	var firstRow = t.rows[0];

	if (!firstRow) return;
	
	var lnk = "";
	var cell = firstRow.cells[colNum];
	if (cell.className != "unsortable" && cell.className.indexOf("unsortable") == -1) {
		for (var ci=0;ci<cell.childNodes.length;ci++) {
			if (cell.childNodes[ci].tagName && cell.childNodes[ci].tagName.toLowerCase() == 'a') lnk = cell.childNodes[ci];
		}
	}
	ts_resortTable_tour(lnk, colNum);
}


function sortTableSelect_exp(theSelect, oValue) {
	var colNum = 0;
	switch(oValue) {
		case "name":
			colNum = 0;
			break;
		case "township":
			colNum = 1;			
			break;
		case "design":
			colNum = 2;		
			break;
		case "type":
			colNum = 3;		
			break;
		case "stories":
			colNum = 4;
			break;
		case "bd":
			colNum = 5;
			break;
		case "sqft":
			colNum = 6;
			break;
		case "garage":
			colNum = 7;
			break;
		case "movein":
			colNum = 8;
			break;
		case "price":
			colNum = 9;
			break;
		default:
			colNum = 0;
	}
	
	theSelect.options[0].selected = true;
	
	t = document.getElementById("express-list-header");

	var firstRow = t.rows[0];

	if (!firstRow) return;
	
	var lnk = "";
	var cell = firstRow.cells[colNum];
	if (cell.className != "unsortable" && cell.className.indexOf("unsortable") == -1) {
		for (var ci=0;ci<cell.childNodes.length;ci++) {
			if (cell.childNodes[ci].tagName && cell.childNodes[ci].tagName.toLowerCase() == 'a') lnk = cell.childNodes[ci];
		}
	}
	ts_resortTable(lnk, colNum);
}

function sortTableSelect2_exp(theSelect, oValue) {
	var colNum = 0;
	switch(oValue) {
		case "name":
			colNum = 0;
			break;
		case "design":
			colNum = 1;		
			break;
		case "type":
			colNum = 2;		
			break;
		case "stories":
			colNum = 3;
			break;
		case "bd":
			colNum = 4;
			break;
		case "ba":
			colNum = 5;
			break;
		case "sqft":
			colNum = 6;
			break;
		case "garage":
			colNum = 7;
			break;
		case "movein":
			colNum = 8;
			break;
		case "price":
			colNum = 9;
			break;
		default:
			colNum = 0;
	}
	
	theSelect.options[0].selected = true;
	
	t = document.getElementById("express-detail-header");

	var firstRow = t.rows[0];

	if (!firstRow) return;
	
	var lnk = "";
	var cell = firstRow.cells[colNum];
	if (cell.className != "unsortable" && cell.className.indexOf("unsortable") == -1) {
		for (var ci=0;ci<cell.childNodes.length;ci++) {
			if (cell.childNodes[ci].tagName && cell.childNodes[ci].tagName.toLowerCase() == 'a') lnk = cell.childNodes[ci];
		}
	}
	ts_resortTable_det(lnk, colNum);
}


/** Image Swapper: receives direction (L/R) **/
function imageSwap(d) {
	bigImage1 = document.getElementById("bigImage");
	if(d == "L") {
		for(i=0; i<imageArray.length; i++){
			if(imageArray[i].src == bigImage1.src){
				if(i==0) return;
				//bigImage.src = imageArray[i--].src;
				if(i>3)	moveImagesDown();
				swap(imageArray[--i].src, i);
				return;
			}
		}
	} else if(d == "R") {
		for(i=0; i<imageArray.length; i++){
			if(imageArray[i].src == bigImage1.src){
				if(i==imageArray.length-1) return;
				//bigImage.src = imageArray[i++].src;
				if(i>2)	moveImagesUp();
				swap(imageArray[++i].src, i);
				return;
			}
		}	
	}
}

function moveImagesUp() {
	theImages = document.getElementById("imageSwapperImagesMv");
	if(theImages.style.top == "") theImages.style.top = 0 + "px";
	theImages.style.top = (parseInt(theImages.style.top, 10) - 85) + "px";

}

function moveImagesDown() {
	theImages = document.getElementById("imageSwapperImagesMv");
	if(theImages.style.top == "") theImages.style.top = 0 + "px";
	theImages.style.top = (parseInt(theImages.style.top, 10) + 85) + "px";

}

imageArray = new Array();

function swap(theSrc, n) {
	document.getElementById("bigImage").src = theSrc;
	aArray = document.getElementById("imageSwapper").getElementsByTagName("a");
	for(i in aArray) {
		if(aArray[i].className == "selected") {
			aArray[i].className = "";
		}
		if(i == n){
			aArray[i].className = "selected";
		}
	}
}

fpAIndex = 0;
function fpScroll(d) {
	fpImageDiv = document.getElementById("floorplanImage");
	if(fpImageDiv.style.left == "") { 
		fpImageDiv.style.left = 0 + "px";
		fpAIndex = 0;
	}
	if(d == "L") {
		if(fpAIndex == 0) {
			fpAIndex = fpArray.length;
			fpImageDiv.style.left = ((fpAIndex-1) * -500) + "px";
		} else {
			fpImageDiv.style.left = (parseInt(fpImageDiv.style.left, 10) + 500) + "px";
		}
		fpAIndex--;
		floorIdDiv = document.getElementById("floorId");
		switch(fpArray[fpAIndex]) {
			case 9:
				floorIdDiv.innerHTML = "Unfinished Lower Level";
				break;
			case 7:
				floorIdDiv.innerHTML = "Finished Lower Level";			
				break;
			case 3:
				floorIdDiv.innerHTML = "First Floor";
				break;
			case 5:
				floorIdDiv.innerHTML = "Second Floor";
				break;
			case 19:
				floorIdDiv.innerHTML = "Unfinished Lower Level (With 3-Car Garage Option)";
				break;
			case 17:
				floorIdDiv.innerHTML = "Finished Lower Level (With 3-Car Garage Option)";			
				break;
			case 13:
				floorIdDiv.innerHTML = "First Floor (With 3-Car Garage Option)";
				break;
			case 15:
				floorIdDiv.innerHTML = "Second Floor (With 3-Car Garage Option)";
				break;
		}
		
	} else if(d == "R") {
		if(fpAIndex >= fpArray.length-1) {
			fpAIndex = 0;
			fpImageDiv.style.left = "0px";			
		} else {
			fpAIndex++;
			fpImageDiv.style.left = (parseInt(fpImageDiv.style.left, 10) - 500) + "px";	
		}
		floorIdDiv = document.getElementById("floorId");
		switch(fpArray[fpAIndex]) {
			case 9:
				floorIdDiv.innerHTML = "Unfinished Lower Level";
				break;
			case 7:
				floorIdDiv.innerHTML = "Finished Lower Level";			
				break;
			case 3:
				floorIdDiv.innerHTML = "First Floor";
				break;
			case 5:
				floorIdDiv.innerHTML = "Second Floor";
				break;
			case 19:
				floorIdDiv.innerHTML = "Unfinished Lower Level (With 3-Car Garage Option)";
				break;
			case 17:
				floorIdDiv.innerHTML = "Finished Lower Level (With 3-Car Garage Option)";			
				break;
			case 13:
				floorIdDiv.innerHTML = "First Floor (With 3-Car Garage Option)";
				break;
			case 15:
				floorIdDiv.innerHTML = "Second Floor (With 3-Car Garage Option)";
				break;
		}
	}
}


function jobScroll(d) {
	jobImageDiv = document.getElementById("jobImgs");
	jobImageArray = jobImageDiv.getElementsByTagName("img");
	maxRight = -((jobImageArray.length-1) * 500);
	//alert(maxRight);
	if(jobImageDiv.style.left == "") { 
		jobImageDiv.style.left = 0 + "px";
	}
	if(d == "L") {
		if(parseInt(jobImageDiv.style.left) == 0){
			jobImageDiv.style.left = maxRight + "px";
			return;
		}
		jobImageDiv.style.left = (parseInt(jobImageDiv.style.left, 10) + 500) + "px";
		
	} else if(d == "R") {
		if(parseInt(jobImageDiv.style.left) <= maxRight) { 
			jobImageDiv.style.left = "0px";
			return;
		}
		jobImageDiv.style.left = (parseInt(jobImageDiv.style.left, 10) - 500) + "px";	
	}
}

function commImgScroll(d) {
	commImageDiv = document.getElementById("communityImage");
	numImages = commImageDiv.getElementsByTagName("img").length;

	if(commImageDiv.style.left == "") { 
		commImageDiv.style.left = 0 + "px";
	}
	if(d == "L") {
		if(commImageDiv.style.left != "0px")
			commImageDiv.style.left = (parseInt(commImageDiv.style.left, 10) + 375) + "px";
		else 
			commImageDiv.style.left = ((numImages-1) * -375) + "px";
	} else if(d == "R") {
		if(commImageDiv.style.left != (((numImages-1) * -375) + "px"))
			commImageDiv.style.left = (parseInt(commImageDiv.style.left, 10) - 375) + "px";
		else
			commImageDiv.style.left = "0px";			
	}
}

function showCommsTable() {
	document.getElementById("sort-By2").style.display = "none";
	document.getElementById("sort-By").style.display = "inline";
	document.getElementById("fake-y-scroll-container2").style.display = "none";
	document.getElementById("fake-y-scroll-container").style.display = "block";
	/*document.getElementById("tourTab").style.background = "url('/assets/images/maronda/region/search_tabs_comm.jpg')";
	document.getElementById("commTab").style.background = "url('/assets/images/maronda/region/search_tabs_comm.jpg')";*/
	document.getElementById("tourTab").style.backgroundPosition = "-259px 0";
	document.getElementById("commTab").style.backgroundPosition = "0 0";
}
function showToursTable() {
	document.getElementById("sort-By").style.display = "none";
	document.getElementById("sort-By2").style.display = "inline";
	document.getElementById("fake-y-scroll-container").style.display = "none";
	document.getElementById("fake-y-scroll-container2").style.display = "block";
	/*document.getElementById("tourTab").style.background = "url('/assets/images/maronda/region/search_tabs_tour.jpg')";
	document.getElementById("commTab").style.background = "url('/assets/images/maronda/region/search_tabs_tour.jpg')";*/
	document.getElementById("tourTab").style.backgroundPosition = "-259px -33px";
	document.getElementById("commTab").style.backgroundPosition = "0 -33px";
if(header2 == '') { tableEmulatorInit(); }
}

/** Express Delivery Home Search Page **/
function showListView() {
	document.getElementById("sortBy2").style.display = "none";
	document.getElementById("sortBy").style.display = "inline";
	document.getElementById("fake-y-scroll-container2").style.display = "none";
	document.getElementById("fake-y-scroll-container2").className = "doNotPrint";
	document.getElementById("fake-y-scroll-container").className = "doPrint";
	document.getElementById("fake-y-scroll-container").style.display = "block";
    document.getElementById("listview-tab").style.backgroundPosition = "0px 0px";
	document.getElementById("detailview-tab").style.backgroundPosition = "-171px 0px";
}

function showDetailView() {
	document.getElementById("sortBy").style.display = "none";
	document.getElementById("sortBy2").style.display = "inline";
	document.getElementById("fake-y-scroll-container").style.display = "none";
	document.getElementById("fake-y-scroll-container").className = "doNotPrint";
	document.getElementById("fake-y-scroll-container2").className = "doPrint";
	document.getElementById("fake-y-scroll-container2").style.display = "block";
    document.getElementById("listview-tab").style.backgroundPosition = "0px -68px";
	document.getElementById("detailview-tab").style.backgroundPosition = "-171px -68px";
	if(header2 == '') tableEmulatorInit();
}

function listViewHover() {
	aLink = document.getElementById("listview-tab");
	if(aLink.style.backgroundPosition == "0px -68px"){
		aLink.style.backgroundPosition = "0px -102px";
	}
}
function listViewHoverOff() {
	aLink = document.getElementById("listview-tab");
	if(aLink.style.backgroundPosition == "0px -102px") {
		aLink.style.backgroundPosition = "0px -68px";
	}
}


function detailViewHover() {
	aLink = document.getElementById("detailview-tab");
	if(aLink.style.backgroundPosition == "" || aLink.style.backgroundPosition == "-171px 0px") {
		aLink.style.backgroundPosition = "-171px -34px";
	} 
}
function detailViewHoverOff() {
	aLink = document.getElementById("detailview-tab");
	if(aLink.style.backgroundPosition == "-171px -34px") {
		aLink.style.backgroundPosition = "-171px 0px";
	} 
}
/** End Express Delivery Home Search Page **/

/** Max Height Fix for IE 6 **/

function setMaxHeight(elementId, height){
	var container = document.getElementById(elementId);
	container.style.height = (container.scrollHeight > (height - 1)) ? height + "px" : "auto";
} 
/** End Max Height Fix for IE 6 **/

// Function to fix IE6 problems
function ie6Fixes() {
	if(typeof document.body.style.maxHeight == "undefined") {  
		setMaxHeight('fake-scroll', 370);  
		setMaxHeight('y-scroll', 370);  
		setMaxHeight('y-scroll2', 370);  
	}
} // End function to fix IE6 problems

/* 
	Drop Down
	URL: http://javascript-array.com/scripts/jquery_simple_drop_down_menu/
*/
/*
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('#jsddm > li').bind('mouseover', jsddm_open)
   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

document.onclick = jsddm_close;
*/

