 $(document).ready(function() {
   $("#featuesNav1 > a").click(function(event){
		event.preventDefault();
		if ($("#featuesNav1").is('.featuesNav1BG')) { //#elm has the class} 
			hideAllFeatureBoxesAndNav();
			$("#featuesNav1").removeClass("featuesNav1BG");
			$("#featuesNav1").addClass("featuesNav1BGOn");
			$("#featureTabsContent1").removeClass("featureTabsHide");
			$("#featureTabsContent1").addClass("featureTabsShow");
		}
   });
   
   $("#featuesNav2 > a").click(function(event){
		event.preventDefault();
		if ($("#featuesNav2").is('.featuesNav2BG')) { //#elm has the class} 
			hideAllFeatureBoxesAndNav();
			$("#featuesNav2").removeClass("featuesNav2BG");
			$("#featuesNav2").addClass("featuesNav2BGOn");
			$("#featureTabsContent2").removeClass("featureTabsHide");
			$("#featureTabsContent2").addClass("featureTabsShow");
		}
   });
   
   $("#featuesNav3 > a").click(function(event){
		event.preventDefault();
		if ($("#featuesNav3").is('.featuesNav3BG')) { //#elm has the class} 
			hideAllFeatureBoxesAndNav();
			$("#featuesNav3").removeClass("featuesNav3BG");
			$("#featuesNav3").addClass("featuesNav3BGOn");
			$("#featureTabsContent3").removeClass("featureTabsHide");
			$("#featureTabsContent3").addClass("featureTabsShow");
		}
   });
   
   $("#featuesNav4 > a").click(function(event){
		event.preventDefault();
		if ($("#featuesNav4").is('.featuesNav4BG')) { //#elm has the class} 
			hideAllFeatureBoxesAndNav();
			$("#featuesNav4").removeClass("featuesNav4BG");
			$("#featuesNav4").addClass("featuesNav4BGOn");
			$("#featureTabsContent4").removeClass("featureTabsHide");
			$("#featureTabsContent4").addClass("featureTabsShow");
		}
   });
    
   function hideAllFeatureBoxesAndNav(){
	
		if ($("#featuesNav1").is('.featuesNav1BGOn')) { //#elm has the class}
			$("#featuesNav1").removeClass("featuesNav1BGOn");
			$("#featuesNav1").addClass("featuesNav1BG");
		}
		if ($("#featuesNav2").is('.featuesNav2BGOn')) { //#elm has the class}
			$("#featuesNav2").removeClass("featuesNav2BGOn");
			$("#featuesNav2").addClass("featuesNav2BG");
		}
		if ($("#featuesNav3").is('.featuesNav3BGOn')) { //#elm has the class}
			$("#featuesNav3").removeClass("featuesNav3BGOn");
			$("#featuesNav3").addClass("featuesNav3BG");
		}
		if ($("#featuesNav4").is('.featuesNav4BGOn')) { //#elm has the class}
			$("#featuesNav4").removeClass("featuesNav4BGOn");
			$("#featuesNav4").addClass("featuesNav4BG");
		}
		
		if ($("#featureTabsContent1").is('.featureTabsShow')) { //#elm has the class}
			$("#featureTabsContent1").removeClass("featureTabsShow");
			$("#featureTabsContent1").addClass("featureTabsHide");
		}
		if ($("#featureTabsContent2").is('.featureTabsShow')) { //#elm has the class}
			$("#featureTabsContent2").removeClass("featureTabsShow");
			$("#featureTabsContent2").addClass("featureTabsHide");
		}
		if ($("#featureTabsContent3").is('.featureTabsShow')) { //#elm has the class}
			$("#featureTabsContent3").removeClass("featureTabsShow");
			$("#featureTabsContent3").addClass("featureTabsHide");
		}
		if ($("#featureTabsContent4").is('.featureTabsShow')) { //#elm has the class}
			$("#featureTabsContent4").removeClass("featureTabsShow");
			$("#featureTabsContent4").addClass("featureTabsHide");
		}
   }
   
   $("#omniSwatch1").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch1");
   });
   
   $("#omniSwatch2").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch2");
   });
   
   $("#omniSwatch3").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch3");
   });
   
   $("#omniSwatch4").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch4");
   });
   
   $("#omniSwatch5").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch5");
   });
   
   $("#omniSwatch6").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch6");
   });
   
   $("#omniSwatch7").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch7");
   });
   
   $("#omniSwatch8").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch8");
   });
   
   $("#omniSwatch9").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch9");
   });
   
   $("#omniSwatch10").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch10");
   });
   
   $("#omniSwatch11").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch11");
   });
   
   $("#omniSwatch12").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch12");
   });
   
   $("#omniSwatch13").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch13");
   });
   
   $("#omniSwatch14").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch14");
   });
   
   $("#omniSwatch15").mouseover(function(event){
		removeOmniColors();
		$("#productSwatchTool").addClass("productSwatch15");
   });
   
   function removeOmniColors(){
		if ($("#productSwatchTool").is('.productSwatch1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch1");
   		}
		if ($("#productSwatchTool").is('.productSwatch2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch2");
		}	 
		if ($("#productSwatchTool").is('.productSwatch3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch3");
		}	 
		if ($("#productSwatchTool").is('.productSwatch4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch4");
		}	 
		if ($("#productSwatchTool").is('.productSwatch5')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch5");
		}	 
		if ($("#productSwatchTool").is('.productSwatch6')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch6");
		} 
		if ($("#productSwatchTool").is('.productSwatch7')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch7");
		} 
		if ($("#productSwatchTool").is('.productSwatch8')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch8");
		} 
		if ($("#productSwatchTool").is('.productSwatch9')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch9");
		} 
		if ($("#productSwatchTool").is('.productSwatch10')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch10");
		}
		if ($("#productSwatchTool").is('.productSwatch11')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch11");
		}
		if ($("#productSwatchTool").is('.productSwatch12')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch12");
		}
		if ($("#productSwatchTool").is('.productSwatch13')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch13");
		}
		if ($("#productSwatchTool").is('.productSwatch14')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch14");
		}
		if ($("#productSwatchTool").is('.productSwatch15')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSwatch15");
		}
	}
	
   $("#ottoSwatch1").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch1");
   });
   
   $("#ottoSwatch2").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch2");
   });
   
   $("#ottoSwatch3").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch3");
   });
   
   $("#ottoSwatch4").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch4");
   });
   
   $("#ottoSwatch5").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch5");
   });
   
   $("#ottoSwatch6").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch6");
   });
   
   $("#ottoSwatch7").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch7");
   });
   
   $("#ottoSwatch8").mouseover(function(event){
		removeOttoColors();
		$("#productSwatchTool").addClass("productOttoSwatch8");
   });
	
	function removeOttoColors(){
		if ($("#productSwatchTool").is('.productOttoSwatch1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch1");
   		}
		if ($("#productSwatchTool").is('.productOttoSwatch2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch2");
		}	 
		if ($("#productSwatchTool").is('.productOttoSwatch3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch3");
		}	 
		if ($("#productSwatchTool").is('.productOttoSwatch4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch4");
		}	 
		if ($("#productSwatchTool").is('.productOttoSwatch5')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch5");
		}	 
		if ($("#productSwatchTool").is('.productOttoSwatch6')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch6");
		} 
		if ($("#productSwatchTool").is('.productOttoSwatch7')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch7");
		} 
		if ($("#productSwatchTool").is('.productOttoSwatch8')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOttoSwatch8");
		} 
	}
	
   $("#sacGSwatch1").mouseover(function(event){
		removeSacGColors();
		$("#productSwatchTool").addClass("productSacGSwatch1");
   });
   
   $("#sacGSwatch2").mouseover(function(event){
		removeSacGColors();
		$("#productSwatchTool").addClass("productSacGSwatch2");
   });
	  
	$("#sacGSwatch3").mouseover(function(event){
		removeSacGColors();
		$("#productSwatchTool").addClass("productSacGSwatch3");
	});
		 
	$("#sacGSwatch4").mouseover(function(event){
		removeSacGColors();
		$("#productSwatchTool").addClass("productSacGSwatch4");
   });
	
	function removeSacGColors(){

		if ($("#productSwatchTool").is('.productSacGSwatch1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSacGSwatch1");
   		}
		if ($("#productSwatchTool").is('.productSacGSwatch2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSacGSwatch2");
		}	 
		if ($("#productSwatchTool").is('.productSacGSwatch3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSacGSwatch3");
		}	 
		if ($("#productSwatchTool").is('.productSacGSwatch4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSacGSwatch4");
		}
	}
	
   $("#omniplusSwatch1").mouseover(function(event){
		removeomniPlusColors();
		$("#productSwatchTool").addClass("productOmniPlus1");
   });
   
   $("#omniplusSwatch2").mouseover(function(event){
		removeomniPlusColors();
		$("#productSwatchTool").addClass("productOmniPlus2");
   });
	  
	$("#omniplusSwatch3").mouseover(function(event){
		removeomniPlusColors();
		$("#productSwatchTool").addClass("productOmniPlus3");
	});
		 
	$("#omniplusSwatch4").mouseover(function(event){
		removeomniPlusColors();
		$("#productSwatchTool").addClass("productOmniPlus4");
   });
	
	function removeomniPlusColors(){

		if ($("#productSwatchTool").is('.productOmniPlus1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOmniPlus1");
   		}
		if ($("#productSwatchTool").is('.productOmniPlus2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOmniPlus2");
		}	 
		if ($("#productSwatchTool").is('.productOmniPlus3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOmniPlus3");
		}	 
		if ($("#productSwatchTool").is('.productOmniPlus4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productOmniPlus4");
		}
	}
	
   $("#sac4Swatch1").mouseover(function(event){
		removeSac4Colors();
		$("#productSwatchTool").addClass("productSac4Swatch1");
   });
   
   $("#sac4Swatch2").mouseover(function(event){
		removeSac4Colors();
		$("#productSwatchTool").addClass("productSac4Swatch2");
   });
	  
	$("#sac4Swatch3").mouseover(function(event){
		removeSac4Colors();
		$("#productSwatchTool").addClass("productSac4Swatch3");
	});
		 
	$("#sac4Swatch4").mouseover(function(event){
		removeSac4Colors();
		$("#productSwatchTool").addClass("productSac4Swatch4");
   });
	
	function removeSac4Colors(){
		if ($("#productSwatchTool").is('.productSac4Swatch1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac4Swatch1");
   		}
		if ($("#productSwatchTool").is('.productSac4Swatch2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac4Swatch2");
		}	 
		if ($("#productSwatchTool").is('.productSac4Swatch3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac4Swatch3");
		}	 
		if ($("#productSwatchTool").is('.productSac4Swatch4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac4Swatch4");
		}
	}
	
   $("#sac5Swatch1").mouseover(function(event){
		removeSac5Colors();
		$("#productSwatchTool").addClass("productSac5Swatch1");
   });
   
   $("#sac5Swatch2").mouseover(function(event){
		removeSac5Colors();
		$("#productSwatchTool").addClass("productSac5Swatch2");
   });
	  
	$("#sac5Swatch3").mouseover(function(event){
		removeSac5Colors();
		$("#productSwatchTool").addClass("productSac5Swatch3");
	});
		 
	$("#sac5Swatch4").mouseover(function(event){
		removeSac5Colors();
		$("#productSwatchTool").addClass("productSac5Swatch4");
   });
	
	function removeSac5Colors(){
		if ($("#productSwatchTool").is('.productSac5Swatch1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac5Swatch1");
   		}
		if ($("#productSwatchTool").is('.productSac5Swatch2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac5Swatch2");
		}	 
		if ($("#productSwatchTool").is('.productSac5Swatch3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac5Swatch3");
		}	 
		if ($("#productSwatchTool").is('.productSac5Swatch4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac5Swatch4");
		}
	}
	
   $("#sac6Swatch1").mouseover(function(event){
		removeSac6Colors();
		$("#productSwatchTool").addClass("productSac6Swatch1");
   });
   
   $("#sac6Swatch2").mouseover(function(event){
		removeSac6Colors();
		$("#productSwatchTool").addClass("productSac6Swatch2");
   });
	  
	$("#sac6Swatch3").mouseover(function(event){
		removeSac6Colors();
		$("#productSwatchTool").addClass("productSac6Swatch3");
	});
		 
	$("#sac6Swatch4").mouseover(function(event){
		removeSac6Colors();
		$("#productSwatchTool").addClass("productSac6Swatch4");
   });
	
	function removeSac6Colors(){
		if ($("#productSwatchTool").is('.productSac6Swatch1')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac6Swatch1");
   		}
		if ($("#productSwatchTool").is('.productSac6Swatch2')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac6Swatch2");
		}	 
		if ($("#productSwatchTool").is('.productSac6Swatch3')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac6Swatch3");
		}	 
		if ($("#productSwatchTool").is('.productSac6Swatch4')) { //#elm has the class}
			$("#productSwatchTool").removeClass("productSac6Swatch4");
		}
	}
	
	
	/*function resetBedHighlights(){
	
		if ($("#bed1").is('.singleBedOn')) { //#elm has the class}
			$("#bed1").removeClass("singleBedOn");
			$("#bed1").addClass("singleBed");
		}
		if ($("#bed2").is('.doubleBedOn')) { //#elm has the class}
			$("#bed2").removeClass("doubleBedOn");
			$("#bed2").addClass("doubleBed");
		}
		if ($("#bed3").is('.queenBedOn')) { //#elm has the class}
			$("#bed3").removeClass("queenBedOn");
			$("#bed3").addClass("queenBed");
		}
		if ($("#bed4").is('.kingBedOn')) { //#elm has the class}
			$("#bed4").removeClass("kingBedOn");
			$("#bed4").addClass("kingBedBed");
		}
   }*/
   
   $("#bed1").mouseover(function(event){
		if ($("#bed1").is('.singleBed')) { //#elm has the class}
			$("#bed1").removeClass("singleBed");
		}
		$("#bed1").addClass("singleBedOn");
   });
   
   $("#bed2").mouseover(function(event){
		if ($("#bed2").is('.doubleBed')) { //#elm has the class}
			$("#bed2").removeClass("doubleBed");
		}
		$("#bed2").addClass("doubleBedOn");
   });
   
   $("#bed3").mouseover(function(event){
		if ($("#bed3").is('.queenBed')) { //#elm has the class}
			$("#bed3").removeClass("queenBed");
		}
		$("#bed3").addClass("queenBedOn");
   });
   
   $("#bed4").mouseover(function(event){
		if ($("#bed4").is('.kingBed')) { //#elm has the class}
			$("#bed4").removeClass("kingBed");
		}
		$("#bed4").addClass("kingBedOn");
   });
   
   $("#bed1").mouseout(function(event){
		if ($("#bed1").is('.singleBedOn')) { //#elm has the class}
			$("#bed1").removeClass("singleBedOn");
		}
		$("#bed1").addClass("singleBed");
   });
   
   $("#bed2").mouseout(function(event){
		if ($("#bed2").is('.doubleBedOn')) { //#elm has the class}
			$("#bed2").removeClass("doubleBedOn");
		}
		$("#bed2").addClass("doubleBed");
   });
   
   $("#bed3").mouseout(function(event){
		if ($("#bed3").is('.queenBedOn')) { //#elm has the class}
			$("#bed3").removeClass("queenBedOn");
		}
		$("#bed3").addClass("queenBed");
   });
   
   $("#bed4").mouseout(function(event){
		if ($("#bed4").is('.kingBedOn')) { //#elm has the class}
			$("#bed4").removeClass("kingBedOn");
		}
		$("#bed4").addClass("kingBed");
   });
   
 });
 
var newwindow;
function popup(url){
	newwindow=window.open(url,'name','height=425,width=380,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}