$(document).ready(function() {

// result accordian
$('.openClose').click(function(){$(this).toggleClass('closed').parents('.expandables').toggleClass('expOff');return false;});
	
$('a#image0').click(function (){
   window.location.href='/Fed/HTH/PoolCare/Products/balancers.htm';
	});
$('a#image1').click(function (){
   window.location.href='/Fed/HTH/PoolCare/Products/sanitize.htm';
	});
$('a#image2').click(function (){
   window.location.href='/Fed/HTH/PoolCare/Products/shock.htm';
	});
$('a#image3').click(function (){
   window.location.href='/Fed/HTH/PoolCare/Products/algaecides.htm';
	});
// caps on the first list item under site navigation
$('#sitenavigation ul li:first-child').addClass("siteTitle");

// spa first td width
$('table.spaLanding td:first-child').addClass("oneFiftyFive");

//navigation hover section, location stick, and Left Nav Locator
// Home Page - Hover
$('#nav li.home a img').hover(function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_home_active.gif");
		}, function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_home.gif");
});
// Pool Care
if(window.location.toString().indexOf("PoolCare") > -1){
	$('#nav li.poolcare a img').attr("src","/FedFiles/en/HTH/Images/nav_poolcare_active.gif");

}else{
   $('#nav li.poolcare a img').hover(function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_poolcare_active.gif");
		}, function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_poolcare.gif");
});
}//close else

// Spa Care
if(window.location.toString().indexOf("SpaCare") > -1){
	$('#nav li.spacare a img').attr("src","/FedFiles/en/HTH/Images/nav_spacare_active.gif");
		$('body.spa #logo a').attr("href","/Fed/HTH/SpaCare/");
		// $('body.spa #breadcrumb a:first').attr("href","/Fed/HTH/SpaCare/");
}else{
   $('#nav li.spacare a img').hover(function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_spacare_active.gif");
		}, function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_spacare.gif");
});
}//close else   

// TroubleShooting
if(window.location.toString().indexOf("Troubleshooting") > -1){
	$('#nav li.troubleshooting a img').attr("src","/FedFiles/en/HTH/Images/nav_troubleshooting_active.gif");
}else{
   $('#nav li.troubleshooting a img').hover(function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_troubleshooting_active.gif");
		}, function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_troubleshooting.gif");
});
}//close else

// Water Testing
if(window.location.toString().indexOf("WaterTesting") > -1){
	$('#nav li.watertesting a img').attr("src","/FedFiles/en/HTH/Images/nav_watertesting_active.gif");
}else{
   $('#nav li.watertesting a img').hover(function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_watertesting_active.gif");
		}, function() {
	$(this).attr("src","/FedFiles/en/HTH/Images/nav_watertesting.gif");
});
}//close else

// Highlight the "Contact Us" link in the global nav if classes are present
// on the body tag
if($("body.contact.main").length > 0){
	$('#contactUs').addClass('contactUs');
}else{
$('#contactUs').removeClass('contactUs');
}//close else

// Supplylist and Contact Us share the same classes on the body tag for page display purposes
// so overriding the above based on URL to turn off high light on "Contact Us" and highlight "Shopping List"
if(window.location.toString().indexOf("/MyPool/supplylist") > -1){
	$('#contactUs').removeClass('contactUs');
	$('.utilityNav .last').addClass('contactUs');
}
if($("body.contact.login").length > 0){
	$('#logIn').addClass('contactUs');
}else{
$('#logIn').removeClass('contactUs');
}//close else

//for shopList Table
$('table.shoppingListHeadTable th:first-child').css('width', '120px');
$('table.shoppingListHeadTable th:nth-child(3)').css('width', '107px');
$('table.shoppingListTable td:first-child').css('width', '120px');
$('table.shoppingListTable td:nth-child(3)').css('width', '107px');
$('table.shoppingListTable td:nth-child(3) input').addClass('countBox');
$('table.shoppingListHeadTable th:last-child').css('width', '93px');
$('table.shoppingListTable td:last-child').css('width', '93px');


});
