/** 
 *  
 * Version  	Date          Author       				Comment
 *	1     04/17/2009         Infosys(Deepak Suneja)		put '/' before images
 *  2	  01/08/2010		 Infosys(Deepak Agarwal)	M#6272-Revision to Search Box Pop Up Interaction 
 *	3	  02/11/2010		 Infosys(Selva Kumar P)	    ENH 30 - Updated code for allowing product search results URLs to be book marked
 *
 */
$(function() {

	$("#searchterm input[type=image], #attribute_category input[type=image], #headerSearch input[type=image]").hover(

		function(event) {$(event.target).attr("src", "/images/b_search_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_search.png");}
	);
	$("#searchterm input[type=image], #attribute_category input[type=image], #headerSearch input[type=image]").focus(
		function(event) {$(event.target).attr("src", "/images/b_search_rollover.png");}
	);
	$("#searchterm input[type=image], #attribute_category input[type=image], #headerSearch input[type=image]").blur(
			function(event) {$(event.target).attr("src", "/images/b_search.png");}
	);
	
	$("#exploreButton").hover(
			function(event) {$(event.target).attr("src", "/images/b_explore_rollover.png");},
			function(event) {$(event.target).attr("src", "/images/b_explore.png");}
	);
	
	$("#goButton").hover(
			function(event) {$(event.target).attr("src", "/images/b_go_rollover.png");},
			function(event) {$(event.target).attr("src", "/images/b_go.png");}
	);
	
	$(".cancelButton").hover(
		function(event) {$(event.target).attr("src", "/images/b_cancel_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_cancel.png");}
	);
	
	$(".okButton").hover(
			function(event) {$(event.target).attr("src", "/images/b_ok_rollover.png");},
			function(event) {$(event.target).attr("src", "/images/b_ok.png");}
	);
	
	$(".signinButton").hover(
			function(event) {$(event.target).attr("src", "/images/b_signin_rollover.png");},
			function(event) {$(event.target).attr("src", "/images/b_signin.png");}
	);
	
	$(".checkout").hover(
		function(event) {$(event.target).attr("src", "/images/b_checkout_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_checkout.png");}
	);

	$(".reviewcart").hover(
		function(event) {$(event.target).attr("src", "/images/b_review_cart_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_review_cart.png");}
	);
	
	$(".add_wide").hover(
		function(event) {$(event.target).attr("src", "/images/b_add_wide_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_add_wide.png");}
	);
	
	$("img.detailTable").hover(
		function(event) {$(event.target).attr("src", "/images/b_table_detail_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_table_detail.png");}
	);
	$("img.simpleTable").hover(
		function(event) {$(event.target).attr("src", "/images/b_table_simple_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_table_simple.png");}
	);
	$(".supportbtn").hover(
		function(event) {$(event.target).attr("src", "/images/b_support_rollover.png");},
		function(event) {$(event.target).attr("src", "/images/b_support.png");}
	);
	
	
	$("#confirmDialog").css("left", Math.max((($(window).width() - $("#confirmDialog").width()) / 2), 0) + 'px');
	$("#confirmDialog").css("top", Math.max((($(window).height() - $("#confirmDialog").height()-6) / 2), 0) + 'px');

});

/*
 * The Following functions (show_search_options_menu, delay_hide_search_options_menu, and hide_search_options_menu) added 2009/11/10 by Jon Baize to support the menu dropdown on the search box
 */
var timeValue ;
function show_search_options_menu(){
	document.getElementById("search_options_container").style.visibility = 'visible';
}
function delay_hide_search_options_menu(){
	timeValue = setTimeout("hide_search_options_menu()", 750);
}
function hide_search_options_menu(){
	document.getElementById("search_options_container").style.visibility = 'hidden';
}
function focus_search(){
	clearTimeout(timeValue);
	document.forms[0].key.focus();
	document.getElementById("search_options_container").style.visibility = 'visible';
}

