$(document).ready(function(){
   $("ul#topNavigation ").superfish({ 
		autoArrows:false,
		delay:400 
	});
   $('li.last').css("background-image","none");
   
    //navigation hover section, location stick, and Left Nav Locator
if(window.location.toString().indexOf("PoolCare") > -1){
	$('img#learnAbout').attr("src","/FedFiles/en/BAQCIL/Images/learnAboutOver.gif");
	$('#leftContainer h2').text("Learn About BAQCIL");
	$('li#topNavLearnAbout').hover(function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/learntab.gif").css('left', '20px').css('display','none').fadeIn('slow');
			}, function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
	});
}else{
   $('li#topNavLearnAbout').hover(function() {
	$('img#learnAbout').attr("src","/FedFiles/en/BAQCIL/Images/learnAboutOver.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/learntab.gif").css('left', '20px').css('display','none').fadeIn('slow');
		}, function() {
	$('img#learnAbout').attr("src","/FedFiles/en/BAQCIL/Images/learnAbout.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
});
}//close else
if(window.location.toString().indexOf("Products") > -1){
	$('img#findProducts').attr("src","/FedFiles/en/BAQCIL/Images/findProductsOver.gif");
	$('#leftContainer h2').text("Find Products");
	$('li#topNavFindProducts').hover(function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/productstab.gif").css('left', '222px').css('display','none').fadeIn('slow');
			}, function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
	});
}else{
   $('li#topNavFindProducts').hover(function() {
	$('img#findProducts').attr("src","/FedFiles/en/BAQCIL/Images/findProductsOver.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/productstab.gif").css('left', '222px').css('display','none').fadeIn('slow');
		}, function() {
	$('img#findProducts').attr("src","/FedFiles/en/BAQCIL/Images/findProducts.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
});
}//close else   

if(window.location.toString().indexOf("Support") > -1){
	$('img#advice').attr("src","/FedFiles/en/BAQCIL/Images/getAdviceOver.gif");
	$('#leftContainer h2').text("Get Advice");
	$('li#topNavGetAdvice').hover(function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/advicetab.gif").css('left', '384px').css('display','none').fadeIn('slow');
			}, function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
	});
}else{
   $('li#topNavGetAdvice').hover(function() {
	$('img#advice').attr("src","/FedFiles/en/BAQCIL/Images/getAdviceOver.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/advicetab.gif").css('left', '384px').css('display','none').fadeIn('slow');
		}, function() {
	$('img#advice').attr("src","/FedFiles/en/BAQCIL/Images/getAdvice.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
});
}//close else
if(window.location.toString().indexOf("MyPool") > -1){
	$('img#enjoy').attr("src","/FedFiles/en/BAQCIL/Images/enjoyPoolOver.gif");
	$('#leftContainer h2').text("Enjoy Your Pool");
	$('li#topNavEnjoySpa').hover(function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/enjoytab.gif").css('left', '515px').css('display','none').fadeIn('slow');
			}, function() {
		$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
	});
}else{
   $('li#topNavEnjoySpa').hover(function() {
	$('img#enjoy').attr("src","/FedFiles/en/BAQCIL/Images/enjoyPoolOver.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/enjoytab.gif").css('left', '515px').css('display','none').fadeIn('slow');
		}, function() {
	$('img#enjoy').attr("src","/FedFiles/en/BAQCIL/Images/enjoyPool.gif");
	$('img#placeTab').attr("src","/FedFiles/en/BAQCIL/Images/notab.gif");
});
}//close else
// Search Box Focus
$('#topNavSearch').each(function(){
    var topNavSearch = this.value;
    $(this).focus(function() {
        if(this.value == topNavSearch) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = topNavSearch;
        }
    });

});

$('#locatePro').each(function(){
    var locatePro = this.value;
    $(this).focus(function() {
        if(this.value == locatePro) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = locatePro;
        }
    });

});
//Font Resizer
fontResizer('10px','12px','15px');

// For the Sitemap Lists
$('#sitenavigation ul li:first-child').addClass("siteTitle").css("list-style-image", "none");

//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');
});