if (typeof(activePages) == "undefined") {
	activePages = new Array('');
}

if (typeof(activeTab) == "undefined") {
	activeTab = new Array('');
}

// ROLLOVER CODE

Array.prototype.inArray = function (value)
// Returns true if the passed value is found in the
// array.  Returns false if it is not.
{
	var i;
	for (var i=0; i < this.length; i++) {
		// Matches identical (===), not just similar (==).
		if (this[i] === value) {
			return true;
		}
	}
	return false;
}

/* IE 5.0 does not support the push method, so here goes */
if(Array.prototype.push == null){
	Array.prototype.push = function(){
		for(var i = 0; i < arguments.length; i++){
			this[this.length] = arguments[i];
		};
		return this.length;
	};
};

imageDir = "/residential/images/";

over = new Array();
out = new Array();

over["headerNavFindAFloor"] = new Image()
over["headerNavFindAFloor"].src = imageDir + "headerNavFindAFloorOn.gif" 
over["headerNavVirtDec"] = new Image()
over["headerNavVirtDec"].src = imageDir + "headerNavVirtDecOn.gif" 
over["headerNavDesignAdvice"] = new Image()
over["headerNavDesignAdvice"].src = imageDir + "headerNavDesignAdviceOn.gif" 
over["headerNavCustServ"] = new Image()
over["headerNavCustServ"].src = imageDir + "headerNavCustServOn.gif" 

over["tabRoomType"] = new Image()
over["tabRoomType"].src = imageDir + "tabRoomTypeOn.gif" 
over["tabFlooringType"] = new Image()
over["tabFlooringType"].src = imageDir + "tabFlooringTypeOn.gif" 
over["tabCustomerService"] = new Image()
over["tabCustomerService"].src = imageDir + "tabCustomerServiceOn.gif" 
over["tabDesignAdvice"] = new Image()
over["tabDesignAdvice"].src = imageDir + "tabDesignAdviceOn.gif" 
over["tabVirtDec"] = new Image()
over["tabVirtDec"].src = imageDir + "tabVirtDecOn.gif" 
over["tabStoreLocator"] = new Image()
over["tabStoreLocator"].src = imageDir + "tabStoreLocatorOn.gif" 

over["subNavKitchen"] = new Image()
over["subNavKitchen"].src = imageDir + "subNavKitchenOn.gif" 
over["subNavLivingSpaces"] = new Image()
over["subNavLivingSpaces"].src = imageDir + "subNavLivingSpacesOn.gif" 
over["subNavBathroom"] = new Image()
over["subNavBathroom"].src = imageDir + "subNavBathroomOn.gif" 
over["subNavBedroom"] = new Image()
over["subNavBedroom"].src = imageDir + "subNavBedroomOn.gif" 
over["subNavDiningRoom"] = new Image()
over["subNavDiningRoom"].src = imageDir + "subNavDiningRoomOn.gif" 
over["subNavFoyer"] = new Image()
over["subNavFoyer"].src = imageDir + "subNavFoyerOn.gif" 
over["subNavNew"] = new Image()
over["subNavNew"].src = imageDir + "subNavNewOn.gif" 

over["subNavResilient"] = new Image()
over["subNavResilient"].src = imageDir + "subNavResilientOn.gif" 
over["subNavLaminate"] = new Image()
over["subNavLaminate"].src = imageDir + "subNavLaminateOn.gif" 
over["subNavHardwood"] = new Image()
over["subNavHardwood"].src = imageDir + "subNavHardwoodOn.gif" 
over["subNavPorcelain"] = new Image()
over["subNavPorcelain"].src = imageDir + "subNavPorcelainOn.gif" 
over["subNavAdura"] = new Image()
over["subNavAdura"].src = imageDir + "subNavAduraOn.gif" 

over["leftNavResilient"] = new Image()
over["leftNavResilient"].src = imageDir + "leftNavResilientOn.gif" 
over["leftNavLaminate"] = new Image()
over["leftNavLaminate"].src = imageDir + "leftNavLaminateOn.gif" 
over["leftNavHardwood"] = new Image()
over["leftNavHardwood"].src = imageDir + "leftNavHardwoodOn.gif" 
over["leftNavPorcelain"] = new Image()
over["leftNavPorcelain"].src = imageDir + "leftNavPorcelainOn.gif" 
over["leftNavAdura"] = new Image()
over["leftNavAdura"].src = imageDir + "leftNavAduraOn.gif" 
over["leftNavBrochure"] = new Image()
over["leftNavBrochure"].src = imageDir + "leftNavBrochureOn.gif" 

out["headerNavFindAFloor"] = new Image()
out["headerNavFindAFloor"].src = imageDir + "headerNavFindAFloor.gif" 
out["headerNavVirtDec"] = new Image()
out["headerNavVirtDec"].src = imageDir + "headerNavVirtDec.gif" 
out["headerNavDesignAdvice"] = new Image()
out["headerNavDesignAdvice"].src = imageDir + "headerNavDesignAdvice.gif" 
out["headerNavCustServ"] = new Image()
out["headerNavCustServ"].src = imageDir + "headerNavCustServ.gif" 

out["tabRoomType"] = new Image()
out["tabRoomType"].src = imageDir + "tabRoomType.gif" 
out["tabFlooringType"] = new Image()
out["tabFlooringType"].src = imageDir + "tabFlooringType.gif" 
out["tabCustomerService"] = new Image()
out["tabCustomerService"].src = imageDir + "tabCustomerService.gif" 
out["tabDesignAdvice"] = new Image()
out["tabDesignAdvice"].src = imageDir + "tabDesignAdvice.gif" 
out["tabVirtDec"] = new Image()
out["tabVirtDec"].src = imageDir + "tabVirtDec.gif" 
out["tabStoreLocator"] = new Image()
out["tabStoreLocator"].src = imageDir + "tabStoreLocator.gif" 

out["subNavKitchen"] = new Image()
out["subNavKitchen"].src = imageDir + "subNavKitchen.gif" 
out["subNavLivingSpaces"] = new Image()
out["subNavLivingSpaces"].src = imageDir + "subNavLivingSpaces.gif" 
out["subNavBathroom"] = new Image()
out["subNavBathroom"].src = imageDir + "subNavBathroom.gif" 
out["subNavBedroom"] = new Image()
out["subNavBedroom"].src = imageDir + "subNavBedroom.gif" 
out["subNavDiningRoom"] = new Image()
out["subNavDiningRoom"].src = imageDir + "subNavDiningRoom.gif" 
out["subNavFoyer"] = new Image()
out["subNavFoyer"].src = imageDir + "subNavFoyer.gif" 
out["subNavNew"] = new Image()
out["subNavNew"].src = imageDir + "subNavNew.gif" 

out["subNavResilient"] = new Image()
out["subNavResilient"].src = imageDir + "subNavResilient.gif" 
out["subNavLaminate"] = new Image()
out["subNavLaminate"].src = imageDir + "subNavLaminate.gif" 
out["subNavHardwood"] = new Image()
out["subNavHardwood"].src = imageDir + "subNavHardwood.gif" 
out["subNavPorcelain"] = new Image()
out["subNavPorcelain"].src = imageDir + "subNavPorcelain.gif" 
out["subNavAdura"] = new Image()
out["subNavAdura"].src = imageDir + "subNavAdura.gif" 

out["leftNavResilient"] = new Image()
out["leftNavResilient"].src = imageDir + "leftNavResilient.gif" 
out["leftNavLaminate"] = new Image()
out["leftNavLaminate"].src = imageDir + "leftNavLaminate.gif" 
out["leftNavHardwood"] = new Image()
out["leftNavHardwood"].src = imageDir + "leftNavHardwood.gif" 
out["leftNavPorcelain"] = new Image()
out["leftNavPorcelain"].src = imageDir + "leftNavPorcelain.gif" 
out["leftNavAdura"] = new Image()
out["leftNavAdura"].src = imageDir + "leftNavAdura.gif" 
out["leftNavBrochure"] = new Image()
out["leftNavBrochure"].src = imageDir + "leftNavBrochure.gif" 

function imageHover(id) { 
	document.getElementById(id).src = over[id].src; 
} 
 
function imageReset(id) {
	if (typeof(activePages) != "undefined") {
		if (!activePages.inArray(id) && !activeTab.inArray(id)) {
			document.getElementById(id).src = out[id].src;
		}
	} else {
		document.getElementById(id).src = out[id].src;
	}
}

function highlightActivePages(ap) {
	if (ap.length > 0) {
		for (var i = 0; i < ap.length; i++) {
			if (document.getElementById(ap[i]) != null) {
				document.getElementById(ap[i]).src = over[ap[i]].src;
			}
		}
	}
}

function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			  return pair[1];
		}
	} 
	return "";
}

function embedObject(filename, flashName, width, height, variableName, variableValue) {
	document.write('<object style="vertical-align: bottom" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="'+flashName+'Flash" align="middle">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="'+filename+'" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="bgcolor" value="#ffffff" />\n');
	if (variableName != '')	{
		document.write('<param name="flashVars" value="'+variableName+'='+variableValue+'" />');
		document.write('<embed src="'+filename+'" flashVars="'+variableName+'='+variableValue+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+flashName+'Flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	} else {
		document.write('<embed src="'+filename+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+flashName+'Flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	}
	document.write('</object>\n');
}

function popUpWindow(width, height, url) {
	leftPixel = (screen.width / 2) - (width / 2);
	topPixel = (screen.height / 2) - (height / 2);
	window.open (url,"popUpWindow","width="+width+", height="+height+", scrollbars=1,status=no,left="+leftPixel+",top="+topPixel);
}

navMenus = new Array('subNavRoomType', 'subNavFlooringType', 'subNavCustomerService', 'subNavDesignAdvice', 'subNavVirtualDecorator', 'subNavResilientFilters', 'subNavLaminateFilters', 'subNavHardwoodFilters', 'subNavPorcelainFilters', 'subNavAduraFilters', 'subNavStoreLocator');
navTabs = new Array('tabRoomType', 'tabFlooringType');

function showSubNav(subNavID) {
	for (var x=0; x < navMenus.length; x++) {
		hideSubNav(navMenus[x]);
	}
	document.getElementById(subNavID).style.display = "block";
}

function hideSubNav(subNavID) {
	if (document.getElementById(subNavID)) {
		document.getElementById(subNavID).style.display = "none";
	}
}

function makeActive(tabID) {
	activeTab = new Array(tabID);
	for (var x=0; x < navTabs.length; x++) {
		imageReset(navTabs[x]);
	}
	highlightActivePages(activeTab);
}

function popVirtDec() { 
	//VirtDecWin = window.open("http://www.visualize-it.com/manningtonv2/virtdec/virtdec.php?Type=VirtDec","StandaloneVirtDec","width=785,height=870");
	VirtDecWin = window.open("http://207.245.65.100/virtdec/virtdec.php?Type=VirtDec","StandaloneVirtDec","width=785,height=870");
	if (VirtDecWin) VirtDecWin.focus(); 
}