displayMediaOverlay={transparentOverlay:null,tBody:null,modalWrapper:null,outerModalContainer:null,modalContainer:null,modalViewCloserDiv:null,preloaderAnimation:null,overlayPreloaderImage:new Image(),overlyPreloaderAnimationLocation:'/images/misc/loadingAnimation.gif',magnify:function(zoom){this.overlayPreloaderImage.src=this.overlyPreloaderAnimationLocation;if(((Seadragon.Utils.getBrowser())==1)&&((Seadragon.Utils.getBrowserVersion())<7)){Seadragon.Utils.makeAjaxRequest("/images/extra_large/"+defaultProductImageName+"_el.jpg",function(xhr){(xhr.status==200)?displayMediaOverlay.extraLargeImage():displayMediaOverlay.largeImage()})}else{if(zoom=='no'){Seadragon.Utils.makeAjaxRequest("/images/extra_large/"+defaultProductImageName+"_el.jpg",function(xhr){(xhr.status==200)?displayMediaOverlay.extraLargeImage():displayMediaOverlay.largeImage()})}else{Seadragon.Utils.makeAjaxRequest(dziDirectoryPath+defaultProductImageName+".xml",function(xhr){(xhr.status==200)?displayMediaOverlay.zoomify():displayMediaOverlay.magnify('no')})}}},zoomify:function(){this.createOverlay('zoom');viewer=new Seadragon.Viewer("modalContainer");viewer.addEventListener("error",displayMediaOverlay.defaultErrorImage);viewer.openDzi(dziDirectoryPath+defaultProductImageName+".xml")},extraLargeImage:function(eStatus){if(eStatus=='error'){imgBox=document.createElement('img');imgBox.setAttribute('src',"/images/extra_large/"+defaultProductImageName+"_el.jpg");displayMediaOverlay.modalContainer.appendChild(imgBox);displayMediaOverlay.outerModalContainer.removeChild(displayMediaOverlay.outerModalContainer.lastChild);document.getElementById('catEntryId_1').style.display='none'}else{this.createOverlay('extralarge');imgBox=document.createElement('img');exImage=new Image();exImage.onload=function(){displayMediaOverlay.modalContainer.removeChild(displayMediaOverlay.preloaderAnimation);displayMediaOverlay.modalViewCloserDiv.style.width=(exImage.width)+"px";displayMediaOverlay.outerModalContainer.style.width=(exImage.width)+"px";displayMediaOverlay.modalContainer.style.width=(exImage.width)+"px";displayMediaOverlay.outerModalContainer.style.height=(exImage.height+25)+"px";displayMediaOverlay.modalContainer.style.height=(exImage.height)+"px";imgBox.setAttribute('src',exImage.src);displayMediaOverlay.modalContainer.appendChild(imgBox);document.getElementById('catEntryId_1').style.display='none'};exImage.src="/images/extra_large/"+defaultProductImageName+"_el.jpg"}},largeImage:function(eStatus){if(eStatus=='error'){displayMediaOverlay.outerModalContainer.removeChild(displayMediaOverlay.outerModalContainer.lastChild);displayMediaOverlay.outerModalContainer.style.height="450px";displayMediaOverlay.modalContainer.style.height="420px";imgBox=document.createElement('img');imgBox.setAttribute('src',"/images/large/"+defaultProductImageName+"_cl.jpg");displayMediaOverlay.modalContainer.appendChild(imgBox);document.getElementById('catEntryId_1').style.display='none'}else{this.createOverlay('large');imgBox=document.createElement('img');deImage=new Image();deImage.onload=function(){displayMediaOverlay.modalContainer.removeChild(displayMediaOverlay.preloaderAnimation);imgBox.setAttribute('src',deImage.src);displayMediaOverlay.modalContainer.appendChild(imgBox);document.getElementById('catEntryId_1').style.display='none'};deImage.src="/images/large/"+defaultProductImageName+"_cl.jpg"}},defaultErrorImage:function(x){if(displayMediaOverlay.modalContainer.hasChildNodes()){displayMediaOverlay.modalContainer.removeChild(displayMediaOverlay.modalContainer.firstChild)}Seadragon.Utils.makeAjaxRequest("/images/extra_large/"+defaultProductImageName+"_fl.jpg",function(xhr){(xhr.status==200)?displayMediaOverlay.extraLargeImage('error'):displayMediaOverlay.largeImage('error')})},videoOverlay:function(){document.getElementById('catEntryId_1').style.display='none';if(typeof(Qoof_WidgetId)!="undefined"){this.createOverlay('qoofVideo');this.modalViewCloserDiv.style.width=450+"px";this.outerModalContainer.style.width=450+"px";this.modalContainer.style.width=450+"px";var queryString='&id='+Qoof_WidgetId+'&w='+Qoof_widgetWidth+'&h='+Qoof_widgetHeight;var Qoof_HTTPReferrer=encodeURIComponent(document.location.href);var Qoof_swf_file='';if(Qoof_swf_file.length==0){Qoof_swf_file='widget.swf'}var Qoof_swf='http://flash.qoof.com/'+Qoof_swf_file+'?w='+Qoof_WidgetId;var Qoof_pass='';var Qoof_AffiliateData='';var Qoof_SessionId=generateQoofGuidInternal();this.modalContainer.innerHTML='<OBJECT ID="Qoof_Widget'+Qoof_SessionId+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" width="'+Qoof_widgetWidth+'" height="'+Qoof_widgetHeight+'">'+'<PARAM name="movie" value="'+Qoof_swf+'" />'+'<PARAM name="allowFullScreen" value="true" /><PARAM name="allowscriptaccess" value="always" /><PARAM name="quality" value="high" /><PARAM name="bgcolor" value="#ffffff" />'+'<PARAM name="wmode" value="transparent" /><PARAM name="flashvars" value="id='+Qoof_WidgetId+'&session='+Qoof_SessionId+'&referer='+Qoof_HTTPReferrer+'" />'+'<EMBED src="'+Qoof_swf+'"  width="'+Qoof_widgetWidth+'" height="'+Qoof_widgetHeight+'" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" type="application/x-shockwave-flash" Quality="high" bgcolor="#ffffff" flashvars="id='+Qoof_WidgetId+'&session='+Qoof_SessionId+'&referer='+Qoof_HTTPReferrer+'" /></OBJECT>'+'<img src="http://track.qoof.com/pix.gif?w='+Qoof_WidgetId+'&s='+Qoof_SessionId+queryString+'"/>'}else if(typeof(productVideoId)!='undefined'){if(productVideoId=='list'){this.createOverlay('productVideo');this.modalViewCloserDiv.style.width=730+"px";this.outerModalContainer.style.width=730+"px";this.modalContainer.style.width=730+"px";this.modalContainer.innerHTML='<OBJECT ID="pvid" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="730" height="400">'+'<PARAM name="movie" value="/swf/video_player_elements/player-licensed.swf" />'+'<PARAM name="allowFullScreen" value="true" /><PARAM name="allowscriptaccess" value="always" />'+'<PARAM name="flashvars" value="file=/video/video_playlist/'+websphereProductId+'.xml&playlistsize=350&playlist=right&config=/swf/video_player_elements/config.xml" />'+'<EMBED src="/swf/video_player_elements/player-licensed.swf"  width="730" height="400" allowscriptaccess="always" allowfullscreen="true" flashvars="file=/video/video_playlist/'+websphereProductId+'.xml&playlistsize=300&playlist=right&config=/swf/video_player_elements/config.xml" /></OBJECT>'}else{this.createOverlay('productVideo');this.modalContainer.innerHTML='<OBJECT ID="pvid" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="620" height="400">'+'<PARAM name="movie" value="/swf/video_player_elements/player-licensed.swf" /><PARAM name="flashvars" value="file='+productVideoId+'&config=/swf/video_player_elements/config.xml">'+'<PARAM name="allowFullScreen" value="true" /><PARAM name="allowscriptaccess" value="always" />'+'<EMBED src="/swf/video_player_elements/player-licensed.swf"  width="620" height="400" allowscriptaccess="always" allowfullscreen="true" flashvars="file='+productVideoId+'&config=/swf/video_player_elements/config.xml" /></OBJECT>'}}else if(typeof(productVideoVimeoId)!='undefined'){this.createOverlay('vimeoVideo');this.modalContainer.innerHTML='<iframe src="'+productVideoVimeoId+'" width="'+productVideo_Width+'" height="'+productVideo_Height+'" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>'}},createOverlay:function(modalViewType){switch(modalViewType){case'zoom':oHeight='675px';mHeight='620px';break;case'extralarge':oHeight='675px';mHeight='620px';break;case'productVideo':oHeight='440px';mHeight='400px';break;case'vimeoVideo':oHeight='400px';mHeight='350px';break;case'qoofVideo':oHeight='400px';mHeight='375px';break;default:oHeight='450px';mHeight='420px'}wh=this.getPageSize()[1];this.transparentOverlay=document.createElement('div');this.transparentOverlay.setAttribute('id','transparentOverlay');this.transparentOverlay.style.height=wh+"px";this.tBody=document.getElementsByTagName("body").item(0);this.tBody.appendChild(this.transparentOverlay);this.modalWrapper=document.createElement('div');this.modalWrapper.setAttribute('id','modalWrapper');this.outerModalContainer=document.createElement('div');this.outerModalContainer.setAttribute('id','outerModalContainer');this.outerModalContainer.style.height=oHeight;this.modalWrapper.style.top=((Math.ceil(Seadragon.Utils.getWindowSize().y*0.25))-50)+'px';this.modalViewCloserDiv=document.createElement('div');this.modalViewCloserDiv.setAttribute('id','modalViewCloser');modalViewCloserAnchor=document.createElement('a');modalViewCloserAnchor.setAttribute('id','modalViewCloserAnchor');modalViewCloserAnchor.setAttribute('href','javascript:displayMediaOverlay.closeModalView()');modalViewCloserText=document.createTextNode("x close");modalViewCloserAnchor.appendChild(modalViewCloserText);this.modalViewCloserDiv.appendChild(modalViewCloserAnchor);this.outerModalContainer.appendChild(this.modalViewCloserDiv);this.modalContainer=document.createElement('div');this.modalContainer.setAttribute('id','modalContainer');this.modalContainer.style.height=mHeight;this.outerModalContainer.appendChild(this.modalContainer);if(modalViewType=='zoom'){customZoomControl=document.createElement('div');customZoomControl.setAttribute('id','customZoomControl');this.outerModalContainer.appendChild(customZoomControl)}else{this.preloaderAnimation=document.createElement('img');this.preloaderAnimation.setAttribute('src',this.overlayPreloaderImage.src);this.preloaderAnimation.setAttribute('id','displayMediaPreloader');this.modalContainer.appendChild(this.preloaderAnimation)}this.modalWrapper.appendChild(this.outerModalContainer);this.tBody.appendChild(this.modalWrapper)},closeModalView:function(){document.getElementById('catEntryId_1').style.display='inline';this.tBody.removeChild(this.transparentOverlay);this.tBody.removeChild(this.modalWrapper)},getPageSize:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{windowWidth=self.innerWidth}windowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=xScroll}else{pageWidth=windowWidth}return[pageWidth,pageHeight]}};
