(function(a){a.popupBox=function(b){function l(){function a(){j.remove();d.remove()}h.css("overflow",f).css("height",g);i.unbind("resize",k);e.remove();if(b.close instanceof Function){b.close.apply({remove:a},[d,j])}else{a()}}function k(){d.css("width",i.width()).css("height",i.height());j.css("width",b.width).css("height",b.height).css("left",i.width()/2-b.width/2).css("top",i.height()/2-b.height/2);e.css("top",j.offset().top-e.height()).css("left",j.offset().left+j.width()-e.width())}var c={containerColor:"#FFF",color:"#777",opacity:.8,width:400,height:400,closeText:"Kapat",close:null,load:null,useFrame:false,content:""};var b=a.extend(c,b);var d=a(document.createElement("DIV"));var e=a(document.createElement("A"));var f=a(document.body).css("overflow")||"auto";var g=a(document.body).css("overflow")||"auto";var h=a(document.body);var i=a(window);b.content=b.content.toString();if(b.content.match(/^http/i)){if(b.useFrame){var j=a(document.createElement("IFRAME"));j.attr("src",b.content).css("border","none")}else{var j=a(document.createElement("DIV"));j.load(b.content)}}else{var j=a(document.createElement("DIV"));j.html(b.content)}d.css("background-color",b.color).css("opacity",b.opacity).css("position","fixed").css("top",0).css("left",0).addClass("jqpopupbox-region");j.css("position","fixed").css("background-color",c.containerColor).addClass("jqpopupbox-container");e.css("position","fixed").addClass("jqpopupbox-close").html("× "+b.closeText).css("cursor","pointer");h.append(d).append(j).append(e).css("overflow","hidden").css("height","100%");i.bind("resize",k);d.bind("click",l);e.bind("click",l);k();if(b.load instanceof Function){b.load.apply(null,[d,j])}}})(jQuery)
