
window.ProductViewer1_jso = {

 _mode: 'ProductDetails.aspx', // this is one of "ProductDetails.aspx" or "ClearanceDetails.aspx"
 mouseover: function(imgo,stylecode)
 {
	if($(imgo).parent().hasClass("borderSwatch") )return;
	
	$($(imgo).parent().parent().children(".miniImageDiv")).each(function(){
		$(this).removeClass('borderSwatch');
        
    });
	$(imgo).parent().addClass('borderSwatch');
   var mainimage =  document.getElementById("mainimage"+stylecode);
   
   if ( ! mainimage ) return;
   var colorcode = imgo.getAttribute("Xcolorcode");
   var bigimgname = "bigimg"+stylecode+'_'+colorcode;
   var bigimg = document.getElementById(bigimgname);
   var bigimgclass ="."+bigimgname;
   var s = bigimg.innerHTML;
   var pagetoload = "/images/products/png/"+stylecode+"-"+colorcode+"-mi-trans.png";
   
   if(mainimage.src == pagetoload || mainimage.src == pagetoload )return;
   if ($(bigimgclass).get(0)) {  
	  
		mainimage.src = pagetoload;
	  
		 
	}else { 
	
		$($(imgo).parent().parent().parent().children(".loader")).css("display","block");
		$(bigimg).html('<img class="'+bigimgname+'" src="'+s+'"/>');
		$(mainimage)
		.attr('src', s)
		.load(function(){
		   $($(imgo).parent().parent().parent().children(".loader")).css("display","none");
		});

	}
   mainimage.setAttribute("Xcolorcode",colorcode);
   mainimage.setAttribute("Xcolorname",imgo.getAttribute("Xcolorname"));
 },
 onclick: function(imgo,stylecode)
 {
   var colorcode = imgo.getAttribute("Xcolorcode");
   var colorname = imgo.getAttribute("Xcolorname");
   var modelname = imgo.getAttribute("Xmodelname");
   var gender = imgo.getAttribute("Xgender");
   var categoryid = imgo.getAttribute("Xcategoryid");
   createCookie('colorShow', stylecode+"-"+colorcode+"-"+escape(colorname) ,0);
   document.location.href=window.ProductViewer1_jso._mode+"?productID="+stylecode+"&categoryID="+categoryid+"&g="+gender+"&model="+escape(modelname);
 }
};

