var _miniLocation=0;var _totalImages=0;var _imagePath="";var _imageUrl="";var _sku;
var _linkTo400=true;var newwindow;function initMiniBrowser(D,F,G,H,C,B,E){_totalImages=D;
_imagePath=G;_imageUrl=H;_sku=B;_linkTo400=E;populateImages(F);setImageByLocation(ImageLocation(F,150));
if(_totalImages>1){jQuery("#browserImages").show();}jQuery("#miniBrowserImage").attr("alt",C);
for(var A=1;A<=3;A++){jQuery("#miniBrowserSelector"+A).attr("alt",C);}}function populateImages(A){var D=A+2;
if(D>(_totalImages-1)){D=_totalImages-1;}var B=1;for(C=1;C<=3;C++){jQuery("#miniBrowser"+C).show();
}for(C=A;C<=D;C++){jQuery("#miniBrowserSelector"+B).attr("src",ImageLocation(C,50));
jQuery("#miniBrowserSelector"+B).attr("zoom",ImageLocation(C,150));jQuery("#miniBrowserSelector"+B).fadeIn();
B++;}if((B-1)<3){for(var C=B;C<=3;C++){jQuery("#miniBrowser"+C).hide();}}if(_miniLocation==0){jQuery("#browsePrevious").hide();
}else{jQuery("#browsePrevious").show();}if((_totalImages>3)&&(_miniLocation<_totalImages-3)){jQuery("#browseNext").show();
}else{jQuery("#browseNext").hide();}}function nextPage(){_miniLocation=_miniLocation+3;
populateImages(_miniLocation);}function previousPage(){if(_miniLocation>0){_miniLocation=_miniLocation-3;
populateImages(_miniLocation);}}function setImageByObject(A){setImageByLocation(jQuery("#"+A).attr("zoom"));
}function setImageByLocation(A){if(jQuery("#miniBrowserImage").attr("src")!=A){jQuery("#miniBrowserImage").hide();
jQuery("#miniBrowserImage").attr("src",A);jQuery("#miniBrowserImage").fadeIn();}}function PopImageBrowser(){if(_linkTo400){newwindow=window.open("/IPA/Shop/Product/ImageBrowser.htm?skuid="+_sku,"Images","location=0,status=0,menubar=0,resizable=0,scrollbars=1,titlebar=1,toolbar=0,width=720,height=600");
if(window.focus){newwindow.focus();}}else{return;}}function ImageLocation(B,A){var C=_imageUrl+_imagePath;
if(B!=0){C+="_"+B;}if(!(B==0&&A==150)){C+="_"+A;}C+=".jpg";return C;}function SetBrowserImage(A){jQuery(".selectedImage").hide();
jQuery(".selectedImage").attr("src",A);jQuery(".selectedImage").fadeIn();}