var ModalDialog=function(D){var H="sf-modalbox-overlay";var K=D&&D.overlayZIndex||(jQuery.browser.msie?19000:15);var J=D&&D.overlayOpacity||0.5;var E=D&&D.overlayBgColor||"#ccc";var I=null;var M=null;function B(){return{x:window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft,y:window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop,w:window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body.clientWidth,h:window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight}}var F="top: 0; left: 0; z-index: "+K+"; display: none;background-color: "+E+";";var A=B();M=jQuery("#"+H);if(M.length<=0){var L=null;if(jQuery.browser.msie){F+="filter: alpha(opacity="+((100*J))+");position: absolute;width:"+(A.x+A.w)+"px;height:"+Math.max(A.y+A.h,jQuery(document.body).height())+"px;";L="<iframe  src='javascript:false' id='"+H+"' style='"+F+"'></iframe>"}else{F+="position:fixed; opacity: "+J+"; width: 100%; height: 100%; ";L="<div id='"+H+"' style='"+F+"'></div>"}jQuery(document.body).prepend(L);if(jQuery.browser.msie){var C=document.getElementById(H).contentWindow.document;C.open();C.write("<html><body style='background-color: "+E+"; filter:alpha(opacity="+(100*J)+");'></body></html>");C.close()}M=jQuery("#"+H)}var G=null;this.show=function(S,P){I=S;G=P;var Q=B();M.css({display:"block"});if(jQuery.browser.msie){M.css({width:Q.x+Q.w+"px",height:Q.y+Q.h+"px"})}var N=Q.y+100;G=P;if(P){var O=I.width(),R=I.height(),T=G.offset();I.css({display:"block",position:"absolute",visibility:"visible",width:"20px",height:"20px",left:T.left,top:T.top,zIndex:K+1});I.animate({left:(Q.x+(Q.w-O)/2)+"px",width:O+"px",height:R+"px"})}else{I.css({display:"block",position:"absolute",visibility:"hidden",zIndex:K+1,top:N+"px"});setTimeout(function(){I.css({left:(Q.x+(Q.w-I.width())/2)+"px",visibility:"visible"})},100)}};this.hide=function(){M.css({display:"none"});if(G){var R=G.offset();var O=I.width(),Q=I.height(),N=R.left,P=R.top;I.animate({width:"10px",height:"10px",left:N,top:P},{complete:function(){I.css({width:O+"px",height:Q+"px",visibility:"hidden"})}})}else{I.css({display:"none"})}}};

