function gotoPage(a,b,c){if(!(b&&a.selectedIndex<b))document.location.href=(c?c:"")+a.options[a.selectedIndex].value+".shtml"}function opengpopup(a){var b=(screen.width-600)/2,c=(screen.height-320)/2-20;if(b<0)b=0;if(c<0)c=0;window.open(a,"_popup","top="+c+",left="+b+",width=600,height=320,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,fullscreen=no").focus()}
function sendByEmail(a,b){a="http://www.mediashopping.it/prodotti/"+a+".shtml";b=escape(b);a=escape("Ti segnalo il prodotto all'indirizzo:\n"+a+"\n\n=========================\nProdotto  Mediashopping.it http://www.mediashopping.it");b=window.open("mailto:?subject="+b+"&body="+a,"sendmail")}function activeMenu(){var a=document.location.pathname;$$("ul.list_Menu a").each(function(b){try{(linkpage=b.href)&&linkpage.indexOf(a)!=-1&&b.addClassName("selected")}catch(c){}})}
function selectBrand(a,b){a=$("selectBrand"+a);for(i=0;i<a.options.length;i++)if(a.options[i].value==b){a.options[i].selected=true;break}}function selectPrezzo(a,b){a=$("selectPrice"+a);for(i=0;i<a.options.length;i++)if(a.options[i].value==b){a.options[i].selected=true;break}}function switchMenuSx(a){Element.cleanWhitespace(a.parentNode);a.className=="link_Closed"?expandMenuSx(a):collapseMenuSx(a)}
function expandMenuCategorySx(a){Element.cleanWhitespace(a.parentNode);a.parentNode.nextSiblings().each(function(b){b.className=""});a.parentNode.hide()}function expandMenuSx(a){a.nextSibling.className="link_Opened";a.className="link_Opened"}function collapseMenuSx(a){a.nextSibling.className="link_Closed";a.className="link_Closed"}
function gotoSearchPageFromCategory(a,b,c){if(a.selectedIndex>0)location.href="/ricerca.shtml?query=*&filterCategory1="+b+"&"+c+"="+encodeURIComponent(a.options[a.selectedIndex].value.unescapeHTML())}function goBack(){var a=document.referrer;navigator.appName=="Microsoft Internet Explorer"&&parseFloat(/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)[1])<=7&&(!a||a.indexOf("cartChannel.jsp")>-1)?history.go(-2):history.back()}
function apriboxCredit(){document.getElementById("boxCredits").className="blockcredit";return false}function chiudiboxCredit(){document.getElementById("boxCredits").className="hiddencredit";return false}
function decodeUtf8(a){for(var b="",c=0,d=c1=c2=0;c<a.length;){d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1);b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}
function openPopupHome(){var a=(screen.width-340)/2,b=(screen.height-270)/2-20;if(a<0)a=0;if(b<0)b=0;a="top="+b+",left="+a+",width=340,height=270,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,fullscreen=no";if(document.cookie.indexOf("popuphp=ok")==-1){document.cookie="popuphp=ok";window.open("/res/html/popuphp.html","_popup",a).focus()}}
function openPopupVideo(){var a=(screen.width-480)/2,b=(screen.height-390)/2-20;if(a<0)a=0;if(b<0)b=0;window.open("/res/html/video.html","_popupvideo","top="+b+",left="+a+",width=480,height=390,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,fullscreen=no").focus()}
function formatPrice(a){a=Math.round(a*100).toString();return a.length>5?a.substring(0,a.length-5)+"."+a.substring(a.length-5,a.length-2)+","+a.substring(a.length-2,a.length):(a.length>2?a.substring(0,a.length-2):"0")+","+a.substring(a.length-2,a.length)}function parsePrice(a){var b=0;try{var c=/(\d+)?.?(\d+),(\d{2})/.exec(a);b=c[1]?parseFloat(c[1]+c[2]+"."+c[3]):parseFloat(c[2]+"."+c[3])}catch(d){}return b}Event.observe(window,"load",activeMenu);
