// JavaScript Document
$(document).ready(function() {
   $(".nav li").mouseenter(function() {										
		$(this).find("div:first").show();
   });
   $(".nav li").mouseleave(function() {										
		$(this).find("div:first").hide();
   });

   $("#miniwrapper #topmenu-new ul li div").hide();
   $("#miniwrapper #topmenu-new ul li").mouseenter(function() {										
		$(this).find("div:first").show();
   });
   $("#miniwrapper #topmenu-new ul li").mouseleave(function() {										
		$(this).find("div:first").hide();
   });
   
	$('input#keyword_search').focus(
		function () {
			if ($(this).val()=="Enter in keyword or sku#") {
				$(this).val("");
			}
		}); 
	$('input#keyword_search').blur(
		function () {
			if ($(this).val()=="") {
				$(this).val("Enter in keyword or sku#");
			}
		}); 

	$("input#keyword_search").autocomplete("/new-top/suggest.php", {
		width: 405,
		minChars: 2,
		selectFirst: false
	});
	$("input#keyword_search").result(function(event, data, formatted) {
		var paramArr = formatted.split(" - ");
		$('#searchText').val(paramArr[0]);							  
		$('#top_search_form').submit();									  
	});
	$("#getcoupon_signup").mouseenter(function() {										
		$(this).find("#coupon_signup_box").show();
	});	
	$("#getcoupon_signup").mouseleave(function() {										
		$(this).find("#coupon_signup_box").hide();
	});		
});

