var easyViewer = Class.create({ xShift: easyViewerConstants ? easyViewerConstants.xShift : 0, yShift: easyViewerConstants ? easyViewerConstants.yShift : 0, boderWidth: easyViewerConstants ? easyViewerConstants.borderWidth : 0, styleLeft: easyViewerConstants ? easyViewerConstants.styleLeft : false, initialize: function(elementName) { var element = $('ev' + elementName); if (element != null) { this.elementName = elementName; this.element = element; this.enhanceShadow(); this.shadow = $('ev' + this.elementName + 'Shadow'); this.shadowIFrame = $('ev' + this.elementName + 'ShadowIframe'); this.attachActionsToHandles(); } var currentnode = $("evShipInfoWidget"); var qv = $("evQuickViewWidget"); var whatThis = $("evWhatThisWidget"); if(currentnode) { var parent = currentnode.parentNode; // node exists if(parent) { parent.id = "popUps"; if(qv) { parent.appendChild(qv); qv.style.display='block'; } if(whatThis) { parent.appendChild(whatThis); whatThis.style.display='block'; } currentnode.style.display='block'; document.body.appendChild(parent); } } }, enhanceShadow: function() { var shadowElement = new Element('div', {'id': 'ev' + this.elementName + 'Shadow', 'class': 'evShadow'}); shadowElement.insert('' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + '
' + '
'); this.element.insert({after: shadowElement}); }, attachActionsToHandles: function() { var openHandles = $$('.ev' + this.elementName + 'OpenHandle'); for (var i = 0; i < openHandles.length; i++) { openHandles[i].easyviewer = this; openHandles[i].onclick = this.showHandler; } var closeHandles = $$('.ev' + this.elementName + 'CloseHandle'); for (var i = 0; i < closeHandles.length; i++) { closeHandles[i].easyviewer = this; closeHandles[i].onclick = this.hideHandler; } }, show: function() { var isIE6=false; if(this.element.id != 'evShopBag' && this.element.id.substring(0,8) != 'evPrint8') this.element.style.top = 100+getY()+"px"; if(this.element.id.substring(0,8) == 'evPrint8') { closeOpenViewers(); var newTop = 100+getY()+'px'; changecss('.evPrint','top',newTop); } this.element.style.display = 'block'; if(navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.indexOf("MSIE 6")!=-1) { isIE6=true; } if (this.styleLeft) { this.element.style.left = ((document.body.offsetWidth - 860) / 2 + (810 - this.element.offsetWidth)) + "px"; } if(isIE6 == false) { this.shadowIFrame.style.width = (this.element.offsetWidth - this.boderWidth * 2) + "px"; this.shadowIFrame.style.height = (this.element.offsetHeight - this.boderWidth * 2) + "px"; this.shadow.style.left = (this.element.offsetLeft + this.xShift) + "px"; this.shadow.style.top = (this.element.offsetTop + this.yShift) + "px"; this.shadow.style.display = 'block'; } else if(this.element.id != 'evShopBag') { //alert('Mode: debugging - nav a'); this.shadowIFrame.style.width = (this.element.offsetWidth - this.boderWidth * 2) + "px"; this.shadowIFrame.style.height = (this.element.offsetHeight - this.boderWidth * 2) + "px"; //alert('Mode: debugging - nav b'); this.shadow.style.left = (this.element.offsetLeft + this.xShift) + "px"; this.shadow.style.top = (this.element.offsetTop + this.yShift) + "px"; //alert('Mode: debugging - nav c'); this.shadow.style.display = 'block'; } if(navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.indexOf("MSIE 6")!=-1) { var a = document.getElementsByTagName("select"); for(i=0; i=0){ this.isIE=true; this.version=parseFloat(ua.substr(i+s.length)); return; } s="Netscape6/"; if((i=ua.indexOf(s))>=0){ this.isNS=true; this.version=parseFloat(ua.substr(i+s.length)); return; } s="Gecko"; if((i=ua.indexOf(s))>=0){ this.isNS=true; this.version=6.1; return; } } var browser=new Browser(); function changecss(theClass,element,value) { var cssRules; if (document.all) { cssRules = 'rules'; } else if (document.getElementById) { cssRules = 'cssRules'; } var added = false; for (var S = 0; S < document.styleSheets.length; S++){ for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) { if (document.styleSheets[S][cssRules][R].selectorText == theClass) { if(document.styleSheets[S][cssRules][R].style[element]){ document.styleSheets[S][cssRules][R].style[element] = value; added=true; break; } } } if(!added){ if(document.styleSheets[S].insertRule){ document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length); } else if (document.styleSheets[S].addRule) { document.styleSheets[S].addRule(theClass,element+': '+value+';'); } } } return false; } function closeOpenViewers() { if(window.rewardsArray && rewardsArray) { for(var i=0;i