jQuery.fn.center=function(params){var options={vertical:true,horizontal:true} op=jQuery.extend(options,params);return this.each(function(){var $self=jQuery(this);var width=$self.width();var height=$self.height();var paddingTop=parseInt($self.css("padding-top"));var paddingBottom=parseInt($self.css("padding-bottom"));var borderTop=parseInt($self.css("border-top-width"));var borderBottom=parseInt($self.css("border-bottom-width"));var mediaBorder=(borderTop+borderBottom)/2;var mediaPadding=(paddingTop+paddingBottom)/2;var positionType=$self.parent().css("position");var halfWidth=(width/2)*(-1);var halfHeight=((height/2)*(-1))-mediaPadding-mediaBorder;var cssProp={position:'absolute'};if(op.vertical){cssProp.height=height;cssProp.top='50%';cssProp.marginTop=halfHeight;} if(op.horizontal){cssProp.width=width;cssProp.left='50%';cssProp.marginLeft=halfWidth;} if(positionType=='static'){$self.parent().css("position","relative");} $self.css(cssProp);});};(function($){var oldWidth=0;var oldHeight=0;var resizeThreshold=30;var shouldBeaSelector;var callBack;var enable=true;jQuery.fn.hookAutoResizeEnable=function(Enable){enable=Enable;} jQuery.fn.hookAutoResize=function(aShouldBeaSelector,CallBack,options){var settings=jQuery.extend({resizeThreshold:5},options);resizeThreshold=settings.resizeThreshold;shouldBeaSelector=aShouldBeaSelector;callBack=CallBack;oldWidth=shouldBeaSelector.clientWidth;oldHeight=shouldBeaSelector.clientHeight;if(document.implementation.hasFeature('MutationEvents','2.0')||window.MutationEvent){shouldBeaSelector.addEventListener("DOMAttrModified",ResizeEventHandler,false);} else{shouldBeaSelector.onresize=ResizeEventHandler;}} function isResizeThreshold(){var width=shouldBeaSelector.clientWidth;var height=shouldBeaSelector.clientHeight;if(width>oldWidth+resizeThreshold||widtholdHeight+resizeThreshold||height").attr("id",uid+"-VIEW").attr("name",uid+"-VIEW").attr("src",url).attr("scrolling","no").css("margin","0").css("border","0").css("padding","0").css("top","0").css("left","0").css("right","0").css("bottom","0").hide().bind("unload",function(event,ui){}).bind("load",function(event,ui){var frame=$(this);$.FrameDialog.iframeMini(frame);$('#iframemsg').hide();frame.show();var fuid=frame.attr("id");var cid=fuid.replace("-VIEW","");var fdocument=this.contentWindow.document;iframeDocument=fdocument;if(opts.formFocus==true){if(fdocument.forms.length>0&&fdocument.forms[0].elements.length>0){$.FrameDialog.setFormFocus(fdocument.forms);}} $.FrameDialog.resizePopup(fdocument);$.FrameDialog.resizeIframe(frame);$.FrameDialog.positionIframe(cid);$.FrameDialog.scroolable(frame);var temp='$.FrameDialog.forceRefresh("'+fuid+'");' setTimeout(temp,500);if(opts.autoResize==true){var aDiv=fdocument.getElementById(popupHolderId);if(aDiv){iframeDocument=fdocument;jQuery.fn.hookAutoResize(aDiv,reSize2);jQuery.fn.hookAutoResizeEnable(true);} else{reSize2();}} wrap.bind('resizestart',wrapresizestart);wrap.bind('resizestop',wrapresizestop);wrap.bind('dragstop',wrapdragstop);wrap.bind('dragstart',wrapdragstart);});var ret=$("
").attr("id",uid).css("margin","0").css("border","0").css("padding","0").css("top","0").css("left","0").css("right","0").css("bottom","0").hide().append(iframe).appendTo("body").dialog(opts).bind("dialogbeforeclose",function(event,ui){var frame=$(this);var uid=frame.attr("id");if(event&&event.originalTarget&&event.originalTarget.nodeName&&event.originalTarget.nodeName=="SPAN") $.FrameDialog.clearResult(uid);if(event&&event.originalEvent&&event.originalEvent.currentTarget&&event.originalEvent.currentTarget.tagName&&event.originalEvent.currentTarget.tagName=="A") $.FrameDialog.clearResult(uid);var result=$.FrameDialog._results[uid]||null;return result;}).bind('dialogclose',function(event,ui){var frame=$(this);var uid=frame.attr("id");var result=$.FrameDialog._results[uid]||null;frame.attr("result",result);var fdocument=top.document;if(fdocument.forms.length>0&&fdocument.forms[0].elements.length>0){$.FrameDialog.setFormFocus(fdocument.forms);} window.setTimeout(function(){frame.dialog('destroy');frame.remove();try{delete $.FrameDialog._results[uid];}catch(err){}},150);return result;});if(opts.titleImage){var img=$("").attr("alt","title").attr("src",opts.titleImage);ret.prev().children(".ui-dialog-title").prepend(img);} var loadmsgtext=$("
");var loadmsg=$("").attr("id","iframemsg").css("margin","0").css("border","0").css("padding","0").css("top",ret.css('top')).css("left",ret.css('left')).attr("width",ret.width()).attr("height",ret.height()).attr("position","absolute").attr("z-index","99999").append(loadmsgtext).appendTo(ret);var movelayer=$("");var resizePopup=function(adocument){var x=adocument.getElementById("frame");if(x){var content=x;var className=content.className;adocument.className="";adocument.className=className;}} var winh=$(document).height();var winw=$(document).width();var wrap=ret.parent(".ui-resizable");var visualEffect='';var wrapresizestart=function(){resizeToPerform=1;jQuery.fn.hookAutoResizeEnable(false);iframe.hide(visualEffect);loadmsg.show(visualEffect);} var wrapresizestop=function(event,ui){loadmsg.hide(visualEffect);var dragheight=ui.size.height;var dragwidth=ui.size.width;var frameId=iframe.attr("id");var iframeBody=$('#'+frameId)[0].contentWindow.document.body;var fdocument=$('#'+frameId)[0].contentWindow.document;if(fdocument.getElementById(popupHolderId)==null)return;var tableframe;var tableframe=fdocument.getElementById(popupHolderId);if(!tableframe){tableframe=fdocument.getElementById("body");} iframe.css('height',ui.size.height-45+'px').css('width',ui.size.width-30+'px');iframe.show(visualEffect);tableframe.style.width=iframe.width()-5+'px';tableframe.style.height=iframe.height()-10+'px';var content=fdocument.getElementById(popupContentId);content.style.height=iframe.height()-30+'px';;content.style.width=iframe.width()-20+'px';;resizePopup(fdocument);resizeToPerform=0;setTimeout('jQuery.fn.hookAutoResizeEnable(true);',500);} var wrapdragstart=function(){jQuery.fn.hookAutoResizeEnable(false);resizeToPerform=1;iframe.hide(visualEffect);loadmsg.show(visualEffect);} var wrapdragstop=function(){jQuery.fn.hookAutoResizeEnable(true);resizeToPerform=0;loadmsg.hide(visualEffect);iframe.show(visualEffect);} ret.bind('dialogclose',function(event,ui){wrap.unbind('resizestart',wrapresizestart);wrap.unbind('resizestop',wrapresizestop);wrap.unbind('dragstop',wrapdragstop);wrap.unbind('dragstart',wrapdragstart);$('#iframemsg').remove();});wrap.trigger('resize');var ww=wrap.width();if(opts.position=='center'||(opts.position&&(opts.position[0]=='center'||opts.position[1]=='center'))){var pos=parseInt(parseFloat(winw-ww)/2);if(pos<0)pos=0;wrap.css('left',pos+'px');} if(opts.position=='right'||(opts.position&&(opts.position[0]=='right'||opts.position[1]=='right'))){var pos=winw-ww-5;if(pos<0)pos=0;wrap.css('left',pos+'px');} return ret;} $.FrameDialog.forceRefresh=function(fuid){var ie=!jQuery.support.boxModel;var frame=$('#'+fuid);var fdocument=frame[0].contentWindow.document;var tableframe;tableframe=fdocument.getElementById(popupHolderId);if(!tableframe){tableframe=fdocument.getElementById("body");} if(ie){tableframe.style.display="none";tableframe.style.display="";} var content=fdocument.getElementById(popupContentId);if(ie){content.style.display="none";content.style.display="";} $.FrameDialog.resizeIframe(frame);} $.FrameDialog._getUid=function(){if(window.parent&&window.parent.frames&&window.parent.document&&window.parent.document.getElementsByTagName){var iframes=window.parent.document.getElementsByTagName("IFRAME");for(var i=0;i0&&forms[0].elements.length>0){var aElement;for(i=0;i=winh-100){fheight=winh-100;tableFrame.height=fheight;content.style.overflow='auto';content.style.height=fheight-40+"px";fwidth+=20;} if(fwidth>=winw-100){fwidth=winw-100;content.style.overflow='auto';content.style.width=fwidth-60+"px";content.style.height=fheight-70+"px";doResize=true;} if(!doResize){fheight+=10;fwidth+=3;} frame.css('height',fheight).css('width',fwidth);if(!ie){fwidth+=11;if(doResize){fwidth+=3;} else{fwidth+=3;fheight+=15;}} else{fheight+=25;fwidth+=30;if(doResize){}} var cid=fuid.replace("-VIEW","");var conteneur=$('#'+cid);var theparent=conteneur.parent(".ui-resizable");conteneur.css('height',fheight+'px');conteneur.css('width',fwidth+'px');theparent.css('height',fheight+'px');theparent.css('width',fwidth+'px');conteneur.trigger('resize');theparent.trigger('resize');jQuery.fn.hookAutoResizeEnable(true);resizeToPerform=0;} $.FrameDialog.iframeMini=function(aIframe){aIframe.css('height',30).css('width',30);} $.FrameDialog.reSize=function(aDocument){if(!aDocument)return;var uid=$.FrameDialog._getUid();var fuid;if(window.parent&&window.parent.frames&&window.parent.document&&window.parent.document.getElementsByTagName){var iframes=window.parent.document.getElementsByTagName("IFRAME");for(var i=0;i