// Hover Descriptions 
jQuery(document).ready(function($) {

$(".product_desc").fadeTo("slow", 0.0);
	$(".ajax_block_product").hover(
	  function () {
		 $(this).children(".product_desc").animate({
			opacity: 0.9
		  }, 300, function() {
	  });
	  }, 
	  function () {
		 $(this).children(".product_desc").animate({
			opacity: 0.0
		  }, 300, function() {
	  });
	  }
	);
});

function popitup(url) {
newwindow=window.open(url,'http://m12007:81/HHI/content/12-terms-and-conditions','height=500,width=1000');
if (window.focus) {newwindow.focus()}
return false;
}

// Clear Search Fields
jQuery(document).ready(function($) {
    $("#site_search").focus(function(){$(this).val("");});
	$("#search_by_name").focus(function(){$(this).val("");});
	$("#browse_by_name").focus(function(){$(this).val("");});
});

// Adds classes to table elements
$(document).ready(function() {
$("#content table tr:last-child").addClass("last");
$("#content table tr th:first-child").addClass("th-first");
$("#content table tr th:last-child").addClass("th-last");
$("#content table tr:even").addClass("even");
});

// Adds classes sub category items
$(document).ready(function() {
	$("ul.tree li:nth-child(1)").addClass("first");
});

$(document).ready(function() {
	$("#category-menu ul li:nth-child(1)").addClass("first");
});

$(document).ready(function() {
	$("#category-menu ul li:nth-child(1)").addClass("first");
	$("#category-menu ul li:last-child").addClass("last");
});


// Adds a class focus to input text when focused
function focusfix(selector, className) {
$(selector).focus(function() {
$(this).addClass(className);
});

// Removes class when focus is lost
$(selector).blur(function() {
$(this).removeClass(className);
});
}

jQuery(document).ready(function($) {
focusfix('input', 'focus');
});

jQuery(document).ready(function($) {
focusfix('textarea', 'focus');
});
