
$(document).ready(function(){
	
	// links with rel="external" will open in a new window
	$("a[rel=external]").click(function(){
		 window.open(this.href);
		 return false;
	});
	
	$("#search, #newsletter").focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
	
	// add class of dropdown to each navigation item that has a sub menu
	$("ul#sitenav li:has(ul.submenu)").addClass("dropdown");
	
	// shop our products drop down updates
	$("ul#sitenav li ul.withcategories li.subheading:first").css({ margin: "0" });
	$("ul#sitenav li ul.withcategories li:last-child").css({ paddingBottom: "8px" });
	
	// show/hide drop down menus
	$("ul#sitenav li").hover(
		function(){
			if ( $(this).hasClass("dropdown") ) {
				$(this).addClass("showdropdown");
				$(this).find("ul").show();
			}
		},
		function(){
			$(this).removeClass("showdropdown");
			$(this).find("ul").hide();
		}
	);
	
	// header updates 10.2011 //
	$('div#headerUtilities ul li#callUs').click(function(){
		// disable click
		return false;
	});
	// show customer service number on hover
	$('div#headerUtilities ul li#callUs').hover(
		function()
		{
			$(this).find('div#calluspopup').fadeIn(250);
		},
		function()
		{
			$(this).find('div#calluspopup').hide();
		}
	);
		
});
