if (typeof(w2dpopupboxinstance)=='undefined') { function w2dpopupbox() { var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1); this.setPicture=function(object, url) { fullurl=w2dpopupboxfolderimages+url; if (ie6) { object.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + fullurl + "',sizingMethod='scale')"; } else { object.style.backgroundImage="url("+fullurl+")"; } } this.createbox=function() { var outer=document.createElement("div"); outer.id="w2dpopupbox_outer"; outer.style.display="none"; outer.style.position="absolute"; outer.style.zIndex=1000; $("body").prepend(outer); var shader=document.createElement("div"); shader.id="w2dpopupbox_shader"; shader.style.display="none"; shader.style.position="absolute"; shader.style.backgroundColor="#000000"; shader.style.zIndex=999; $("body").prepend(shader); var edge=document.createElement("div"); this.setPicture(edge,"w2dpopupboxtopright.png"); edge.style.backgroundRepeat="no-repeat"; edge.style.position="absolute"; edge.style.width="50px"; edge.style.height="50px"; edge.style.right="0"; edge.style.top="0"; edge.style.zIndex=1001; $(outer).append(edge); var edge=document.createElement("div"); this.setPicture(edge,"w2dpopupboxtopleft.png"); edge.style.backgroundRepeat="no-repeat"; edge.style.position="absolute"; edge.style.width="50px"; edge.style.height="50px"; edge.style.left="0"; edge.style.top="0"; edge.style.zIndex=1001; $(outer).append(edge); var edge=document.createElement("div"); this.setPicture(edge,"w2dpopupboxbottomright.png"); edge.style.backgroundRepeat="no-repeat"; edge.style.position="absolute"; edge.style.width="50px"; edge.style.height="50px"; edge.style.right="0"; edge.style.bottom="0"; edge.style.zIndex=1001; $(outer).append(edge); var edge=document.createElement("div"); this.setPicture(edge,"w2dpopupboxbottomleft.png"); edge.style.backgroundRepeat="no-repeat"; edge.style.position="absolute"; edge.style.width="50px"; edge.style.height="50px"; edge.style.left="0"; edge.style.bottom="0"; edge.style.zIndex=1001; $(outer).append(edge); var border=document.createElement("div"); border.id="w2dpopupbox_border_right"; this.setPicture(border,"w2dpopupboxright.png"); border.style.backgroundRepeat="repeat-y"; border.style.position="absolute"; border.style.width="50px"; border.style.right="0"; border.style.top="50px"; border.style.zIndex=1001; $(outer).append(border); var border=document.createElement("div"); border.id="w2dpopupbox_border_left"; this.setPicture(border,"w2dpopupboxleft.png"); border.style.backgroundRepeat="repeat-y"; border.style.position="absolute"; border.style.width="50px"; border.style.left="0"; border.style.top="50px"; border.style.zIndex=1001; $(outer).append(border); var border=document.createElement("div"); border.id="w2dpopupbox_border_top"; this.setPicture(border,"w2dpopupboxtop.png"); border.style.backgroundRepeat="repeat-x"; border.style.position="absolute"; border.style.height="50px"; border.style.left="50px"; border.style.top="0"; border.style.zIndex=1001; $(outer).append(border); var border=document.createElement("div"); border.id="w2dpopupbox_border_bottom"; this.setPicture(border,"w2dpopupboxbottom.png"); border.style.backgroundRepeat="repeat-x"; border.style.position="absolute"; border.style.height="50px"; border.style.left="50px"; border.style.bottom="0"; border.style.zIndex=1001; $(outer).append(border); var whitebox=document.createElement("div"); whitebox.id="w2dpopupbox_whitebox"; whitebox.style.position="absolute"; whitebox.style.left="26px"; whitebox.style.top="26px"; whitebox.style.backgroundColor="#ffffff"; whitebox.style.zIndex=1002; $(outer).append(whitebox); var closer=document.createElement("div"); this.setPicture(closer,"w2dpopupboxclose.png"); closer.style.backgroundRepeat="no-repeat"; closer.id="w2dpopupbox_closer"; closer.style.position="absolute"; closer.style.width="24px"; closer.style.height="24px"; closer.style.right="0"; closer.style.lineHeight="1px"; closer.style.top="0"; closer.style.cursor="pointer"; closer.style.zIndex=1003; $(outer).append(closer); $(window).resize(this.center); $(window).scroll(this.center); $("#w2dpopupbox_closer").click(function() { w2dpopupboxinstance.hideBox(); }); } this.center = function() { $("#w2dpopupbox_outer").css("top", ( $(window).height() - $("#w2dpopupbox_outer").height() ) / 2+$(window).scrollTop() + "px"); $("#w2dpopupbox_outer").css("left", ( $(window).width() - $("#w2dpopupbox_outer").width() ) / 2+$(window).scrollLeft() + "px"); $("#w2dpopupbox_shader").css("top", $(window).scrollTop()+"px"); $("#w2dpopupbox_shader").css("left", $(window).scrollLeft()+"px"); $("#w2dpopupbox_shader").css("width", $(window).width()+"px"); $("#w2dpopupbox_shader").css("height", $(window).height()+"px"); } this.showIframe = function(frameWidth, frameHeight, url, showScroll) { $("#w2dpopupbox_outer").css({"width": (frameWidth+52)+"px", "height": (frameHeight+52)+"px"}); $("#w2dpopupbox_whitebox").css({"width": frameWidth+"px", "height": frameHeight+"px"}); $("#w2dpopupbox_border_top").css({"width": (frameWidth-48)+"px"}); $("#w2dpopupbox_border_bottom").css({"width": (frameWidth-48)+"px"}); $("#w2dpopupbox_border_left").css({"height": (frameHeight-48)+"px"}); $("#w2dpopupbox_border_right").css({"height": (frameHeight-48)+"px"}); this.center(); $("#w2dpopupbox_shader").fadeTo(300,0.2, function() { $("#w2dpopupbox_content").remove(); var content=document.createElement("iframe"); content.id="w2dpopupbox_content"; content.src=url; content.style.position="absolute"; content.style.border="0"; content.style.width=frameWidth+"px"; content.style.height=frameHeight+"px"; content.scrolling=showScroll; content.style.zIndex=1003; content.frameBorder="0"; $("#w2dpopupbox_whitebox").eq(0).append(content); $("#w2dpopupbox_outer").css({"display": "block"}); }); } this.hideBox = function() { $("#w2dpopupbox_outer").hide(); $("#w2dpopupbox_shader").fadeTo(300,0, function() { $("#w2dpopupbox_shader").hide(); }); } this.showImage = function(frameWidth, frameHeight, url) { $("#w2dpopupbox_outer").css({"width": (frameWidth+52)+"px", "height": (frameHeight+52)+"px"}); $("#w2dpopupbox_whitebox").css({"width": frameWidth+"px", "height": frameHeight+"px"}); $("#w2dpopupbox_border_top").css({"width": (frameWidth-48)+"px"}); $("#w2dpopupbox_border_bottom").css({"width": (frameWidth-48)+"px"}); $("#w2dpopupbox_border_left").css({"height": (frameHeight-48)+"px"}); $("#w2dpopupbox_border_right").css({"height": (frameHeight-48)+"px"}); this.center(); $("#w2dpopupbox_shader").fadeTo(300,0.2, function() { $("#w2dpopupbox_content").remove(); var content=document.createElement("img"); content.id="w2dpopupbox_content"; content.style.position="absolute"; content.style.border="0"; content.style.display='none'; content.style.width=frameWidth+"px"; content.style.height=frameHeight+"px"; content.style.zIndex=1003; $(content).load(function() { $("#w2dpopupbox_whitebox").eq(0).append(this); $("#w2dpopupbox_outer").css({"display": "block"}); $(this).fadeIn(200); }); content.src=url; }); } } w2dpopupboxinstance=new w2dpopupbox(); w2dpopupboxinstance.createbox(); }