var Euronics = { swapImg : function(m, n){ /* swap per immagini */ m = m.getElementsByTagName("IMG"); m[0].src = n; }, getElementsByClassName : function(cl){ /* trova classe */ var retnode = []; var myclass = new RegExp('\\b' + cl + '\\b'); var elem = document.getElementsByTagName('*'); for (var i = 0; i < elem.length; i++) { var classes = elem[i].className; if (myclass.test(classes)) { retnode.push(elem[i]); } } return retnode; }, showLabel : function(e){ /* mostra label (cellulare) */ if (e == 'one') { document.getElementById('one').className = 'on'; document.getElementById('two').className = 'off'; if(document.getElementById('three')){ document.getElementById('three').className = 'off'; } document.getElementById('linkLabel').getElementsByTagName('li')[0].className = 'on'; document.getElementById('linkLabel').getElementsByTagName('li')[1].className = 'off'; if(document.getElementById('linkLabel').getElementsByTagName('li')[2]){ document.getElementById('linkLabel').getElementsByTagName('li')[2].className = 'off'; } }; if (e == 'two') { document.getElementById('one').className = 'off'; if(document.getElementById('three')){ document.getElementById('three').className = 'off'; } document.getElementById('two').className = 'on'; document.getElementById('linkLabel').getElementsByTagName('li')[0].className = 'off'; document.getElementById('linkLabel').getElementsByTagName('li')[1].className = 'on'; if(document.getElementById('linkLabel').getElementsByTagName('li')[2]){ document.getElementById('linkLabel').getElementsByTagName('li')[2].className = 'off'; } }; if (e == 'three') { document.getElementById('one').className = 'off'; document.getElementById('two').className = 'off'; if(document.getElementById('three')){ document.getElementById('three').className = 'on'; } document.getElementById('linkLabel').getElementsByTagName('li')[0].className = 'off'; document.getElementById('linkLabel').getElementsByTagName('li')[1].className = 'off'; if(document.getElementById('linkLabel').getElementsByTagName('li')[2]){ document.getElementById('linkLabel').getElementsByTagName('li')[2].className = 'on'; } }; }, chStars : function(a,b){ /* cambia rank */ b.parentNode.className = 'stars ' + a; }, resetStars : function(a,b){ /* resetta rank */ if (a) { b.className = 'stars ' + a; } else { b.className = 'stars'; } }, zoomThis : function(a){ this.getElementsByClassName('on')[0].className = ''; document.getElementById('photoZoom').src = a.firstChild.src.split('_th')[0]+a.firstChild.src.split('_th')[1]; a.className = 'on'; }, zoomThisImage : function(a){ this.getElementsByClassName('on')[0].className = ''; var imagePath=a.firstChild.src.split('_th')[0]+a.firstChild.src.split('_th')[1]; imagePath=imagePath.replace('width=78','width=500').replace('height=78','height=500').replace('undefined',''); document.getElementById('photoZoom').src = imagePath; a.className = 'on'; }, openWindow : function(url){ finestra=window.open(url,"popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=610,height=550"); finestra.focus(); }, submitCart : function(){ if(document.getElementById('accepted')){ document.getElementById('errore').style.display = "block"; if(document.getElementById('accepted').checked){ document.shoppingCart.submit(); }else{ document.getElementById('errore').style.display = "none"; document.getElementById('erroreCond').style.display = "block"; } } }, openPop : function(a){ if(navigator.appName == "Microsoft Internet Explorer"){ offTop = document.documentElement.scrollTop+10; }else{ offTop = window.pageYOffset+10; }; divCont = Builder.node('div',{id:'contPop',style:'display: block; position:absolute; top:0; left:0; z-index:100; background:red; filter:alpha(opacity=0);-moz-opacity:.0;opacity:.0; width:100%; height:'+document.body.clientHeight+'px;'}); popUp = Builder.node('div',{id:'popUp',style:'display: block; position: absolute; z-index: 101; top: '+offTop+'px; left: '+Math.ceil((document.body.clientWidth-790)/2)+'px; width:790px; height:390px; background:#eee; padding:10px; border-bottom:2px solid #666; border-right:2px solid #666;'}); closeDiv = Builder.node('div',{id:'closeDiv',style:'display: block; width:790px; height:20px; text-align:right;'}); btnClose = Builder.node('a',{href:'javascript:void(0);',id:'close'},'chiudi'); btnPrint = Builder.node('a',{href:'javascript:void(0);',id:'print'},'stampa'); popupLayer = Builder.node('div',{id:'popupLayer',style:'display: block; width:780px; height:355px; background:#fff; overflow:auto; padding:5px;'}); stealth=Builder.node('iframe',{name:'popstampa',id:'popstampa',src:'',width:'1',height:'1',frameborder:'0'}); $('content').appendChild(divCont); closeDiv.appendChild(btnPrint); closeDiv.appendChild(btnClose); popUp.appendChild(stealth); popUp.appendChild(closeDiv); popUp.appendChild(popupLayer); $('content').appendChild(popUp); url = a.href; $('popupLayer').innerHTML = '


