/**
 * @author BryanBorst
 */

 $(document).ready(function(){ 	
	_init();
	_preLoadImg();
	
});

function _init() {
	$("ul.products div.product div").bind("mouseenter",function(){
			$('a',$(this)).addClass("red");
			$('a.prodImgLink img',$(this)).css({ border:"solid 1px #de464c" });
		}).bind("mouseleave",function(){
			$('a',$(this)).removeClass("red");
			$('a.prodImgLink img',$(this)).css({ border:"1px solid #B0B0B0" });
	});
	$("ul.redbox div.product").bind("mouseenter",function(){
			$('a',$(this)).addClass("wht");
			$('img.prodImg',$(this)).css({ border:"solid 1px #fff" });
		}).bind("mouseleave",function(){
			$('a',$(this)).removeClass("wht");
			$('img.prodImg',$(this)).css({ border:"1px solid #ad9394" });
	}); 
	
	//Hover State	
	$("div.product div img.hov").bind("mouseenter",function(){ 
		//Reset failsafe
		$('div.rollOver').css({display: "none"});	
		
		$('div.rollOver',$(this).parents('li')).fadeIn("fast");
	});
	$("div.product div.rollOver").bind("mouseleave",function(){ 
		$('div.rollOver',$(this).parents('li')).fadeOut("fast");
	});	
	 
	
}

function _preLoadImg() {
	var strHost= window.location.host;
	var baseURL = 'http://'+strHost+'/'
	var image1 = $('<img />').attr('src', baseURL+'holiday/static/img/bnr.rdbx.angelOver.gif');
	var image2 = $('<img />').attr('src', baseURL+'holiday/static/img/bnr.rdbx.giftcardOver.gif');
	var image3 = $('<img />').attr('src', baseURL+'holiday/static/img/bnr.rdbx.giftwrapOver.gif');
	var image4 = $('<img />').attr('src', baseURL+'holiday/static/img/bnr.rdbx.sportsOver.gif');
};
 