var mapDetect=navigator.userAgent.toLowerCase();var mapOS,mapBrowser,mapVersion,mapTotal,mapThestring;function mapGetBrowserInfo(){if(mapCheckIt('konqueror')){mapBrowser="Konqueror";mapOS="Linux";}
else if(mapCheckIt('safari'))mapBrowser="Safari"
else if(mapCheckIt('omniweb'))mapBrowser="OmniWeb"
else if(mapCheckIt('opera'))mapBrowser="Opera"
else if(mapCheckIt('webtv'))mapBrowser="WebTV";else if(mapCheckIt('icab'))mapBrowser="iCab"
else if(mapCheckIt('msie'))mapBrowser="Internet Explorer"
else if(!mapCheckIt('compatible')){mapBrowser="Netscape Navigator"
mapVersion=mapDetect.charAt(8);}
else mapBrowser="An unknown browser";if(!mapVersion)mapVersion=mapDetect.charAt(place+ mapThestring.length);if(!mapOS){if(mapCheckIt('linux'))mapOS="Linux";else if(mapCheckIt('x11'))mapOS="Unix";else if(mapCheckIt('mac'))mapOS="Mac"
else if(mapCheckIt('win'))mapOS="Windows"
else mapOS="an unknown operating system";}};function processsubmit(){if(typeof(productAddToCartForm.validator)!='undefined'){if(productAddToCartForm.validator.validate()){productAddToCartForm.form.submit()}else{window.maprice.deactivate();return false;}}else{$('maprice-form').submit();}
return false;}
function awSetLocation(url){window.location.href=url;}
function mapCheckIt(string){place=mapDetect.indexOf(string)+ 1;mapThestring=string;return place;};Event.observe(window,'load',mapGetBrowserInfo,false);var Maprice=Class.create();Maprice.prototype={yPos:0,xPos:0,isLoaded:false,initialize:function(url){this.content=url;this.activate();},activate:function(){if(mapBrowser=='Internet Explorer'){this.getScroll();this.setScroll(0,0);this.hideSelects('hidden');}
this.displayMaprice("block");},prepareIE:function(height,overflow){bod=document.getElementsByTagName('body')[0];bod.style.height=height;bod.style.overflow=overflow;htm=document.getElementsByTagName('html')[0];htm.style.height=height;htm.style.overflow=overflow;},hideSelects:function(visibility){selects=document.getElementsByTagName('select');for(i=0;i<selects.length;i++){selects[i].style.visibility=visibility;}},getScroll:function(){if(self.pageYOffset){this.yPos=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){this.yPos=document.documentElement.scrollTop;}else if(document.body){this.yPos=document.body.scrollTop;}},setScroll:function(x,y){window.scrollTo(x,y);},displayMaprice:function(display){$('maprice-overlay').style.display=display;$('maprice').style.display=display;if(display!='none')this.loadInfo();},loadInfo:function(){$('maprice').className='loading';var myAjax=new Ajax.Request(this.content,{method:'post',parameters:'',onComplete:this.processInfo.bindAsEventListener(this)});},processInfo:function(response){$('mapContent').update(response.responseText);$('maprice').className='done';this.isLoaded=true;this.actions();},actions:function(){mapActions=document.getElementsByClassName('mapAction');},deactivate:function(){if(mapBrowser=="Internet Explorer"){this.setScroll(0,this.yPos);this.prepareIE("auto","auto");this.hideSelects("visible");}
this.displayMaprice("none");}};arrayIntersect=function(a,b){var res=[];for(var i=0;i<a.length;i++)
for(var j=0;j<b.length;j++)
if(a[i]==b[j]){res.push(b[j]);break;}
return res;};Event.observe(window,'load',function(){if(typeof(productAddToCartForm)!='undefined'){var _input=new Element('input',{'id':'aw_map_goto','type':'hidden','name':'goto','value':''});productAddToCartForm.form.appendChild(_input);}
if(typeof(opConfig)!='undefined'){opConfig._reloadPrice=opConfig.reloadPrice;opConfig.reloadPrice=function(){opConfig._reloadPrice.apply(this,arguments)
var optionPrice=optionsPrice.optionPrices.options;var aw_maprice_opts=Array.from(document.getElementById('product_addtocart_form').getElementsByClassName('aw_maprice_checkbutton'))
aw_maprice_opts.each(function(checkpricebutton){var oncklick_str=checkpricebutton.onclick.toString();var optionPrice_replace=oncklick_str.replace(/(opt\/\d+)|(opt\/)/i,'opt/'+ optionPrice);var split_func=optionPrice_replace.split(/^function[^\{]*\{|\}$/).join('');checkpricebutton.setAttribute('onclick',split_func);checkpricebutton.parentNode.innerHTML=checkpricebutton.parentNode.innerHTML.replace('&#10;','');});}}});;
