var windowObj;var overlayObj;var bindObj;var formObj;var cloneFormObj;var callback_func;var before_func;function open_popup_window(d,a,b,c){d.click(function(){if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");$("body").append('<iframe id="HideSelect"></iframe><div id="overlay"></div><div id="window"></div>');$("#window").css({display:"block"})}else{$("body").append('<div id="overlay"></div><div id="window"></div>')}$("#overlay, #window").show().html("");cloneFormObj=a.show().clone(true).appendTo($("#window"));a.hide();actionsBind(cloneFormObj,b,c);document.onkeyup=function(f){if(f==null){keycode=event.keyCode}else{keycode=f.which}if(keycode==27){boxClose()}};$(".exit",cloneFormObj).click(function(){boxClose();return false});$("#overlay, #HideSelect").click(function(){boxClose();return false});return false})}function actionsBind(c,a,b){$("form",c).ajaxForm({beforeSubmit:function(){if(typeof b=="function"){return b(c)}},success:function(d){if(typeof a=="function"){a(c,d)}actionsBind(c,a);$(".exit",c).click(function(){boxClose();return false})}});boxPositionSet(c)}function boxClose(){if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}document.onkeydown="";document.onkeyup="";$("#overlay, #HideSelect, #window").remove();return false}function boxPositionSet(h){h.css({marginLeft:"-"+parseInt((h.width()/2),10)+"px",width:h.width()+"px"});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){var f=-1*parseInt((h.height()/2),10);var e=document.compatMode=="CSS1Compat"&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight;var i=document.documentElement,a=document.body,c=window;var g;if($.browser.msie){g=a.scrollTop||i.scrollTop}else{g=c.pageYOffset}f=f+g;if(e-h.height()<0){f=f+(h.height()-e)/2}h.css({marginTop:f+"px"})}};
