jQuery.fn.centerwindowhandler=function(A){this.each(function(E){var D="centerwindow_mainBg";var B=$(this);var C={bgid:B.attr("id")+"_bg",bgcolor:"#000",bgopacity:0.5,bgzindex:1000,bgclickable:true,id:B.attr("id"),width:B.width(),height:B.height(),fadespeed:1000};$.extend(C,A);for(E in C){B.data(E,C[E])}B.data("shown",false);B.data("fullbgid","#"+C.bgid);$("body").append('<div id="'+C.bgid+'"></div>');var F=$(B.data("fullbgid"));F.css({display:"none",position:"absolute","z-index":C.bgzindex,left:"0px",top:"0px","background-color":C.bgcolor,width:"0px",height:"0px"});B.css({"z-index":C.bgzindex+1,display:"none"});$.fn.centerwindowhandlerStartAction=function(){if(!this.data("shown")&&$(this.data("fullbgid"))){this.data("shown",true);this.centerwindowhandlerPositionActionWindow();var G=this;$(window).resize(function(){if(G.data("shown")&&$(G.data("fullbgid"))){G.centerwindowhandlerPositionActionWindow()}});$(window).scroll(function(){if(G.data("shown")&&$(G.data("fullbgid"))){G.centerwindowhandlerPositionActionWindow()}})}};$.fn.centerwindowhandlerStopAction=function(){if(this.data("shown")&&$(this.data("fullbgid"))){var G=this;G.data("shown",false);G.stop().fadeTo(G.data("fadespeed"),0,function(){G.hide();$(G.data("fullbgid")).stop().fadeTo(G.data("fadespeed"),0,function(){$(G.data("fullbgid")).hide()})})}};$.fn.centerwindowhandlerPositionActionWindow=function(){if(this.data("shown")&&$(this.data("fullbgid"))){var J=$("body").width();var G=$("body").height();if($.browser.msie&&parseInt($.browser.version)<7){var P=document.documentElement.clientWidth;var H=document.documentElement.clientHeight;if(P>0){J=P}if(H>0){G=H}}var M=$(this.data("fullbgid"));M.css({width:J,height:G});var L=Math.max(Math.max(J,document.documentElement.scrollWidth),document.body.scrollWidth);var S=Math.max(Math.max(G,document.documentElement.scrollHeight),document.body.scrollHeight);var N=Math.max($("body").scrollLeft(),document.documentElement.scrollLeft);var O=Math.max($("body").scrollTop(),document.documentElement.scrollTop);var I=this.data("width");var Q=this.data("height");M.css({width:L,height:S});if($.browser.msie){this.stop().css({left:(J<=I?0:parseInt((J-I)/2)+N),top:(G<=Q?0:parseInt((G-Q)/2)+O)})}else{this.stop().animate({left:(J<=I?0:parseInt((J-I)/2)+N),top:(G<=Q?0:parseInt((G-Q)/2)+O)})}var R=this;M.stop().fadeTo(R.data("fadespeed"),R.data("bgopacity"),function(){R.fadeTo(R.data("fadespeed"),1)});if(R.data("bgclickable")){var K=M.data("events");if(typeof K=="undefined"||(K&&typeof K.click=="undefined")){M.click(function(){R.centerwindowhandlerStopAction()})}}}};return B});return this};