/*! * lhgcore Dialog Plugin v3.3.1 * Date : 2011-04-12 11:16:11 * Copyright (c) 2009 - 2011 By Li Hui Gang */ (function(a){var b=window,c,e,f,g=!1,h=a.browser.msie&&a.browser.version<7?!0:!1,i=h?'':"",j=function(a){d=a||document;return d.compatMode=="CSS1Compat"?d.documentElement:d.body},k=function(){f||(f=9999);return++f},l=function(c){if(a.browser.msie)try{return window.event||b.event||c.event}catch(d){return null}var e=l.caller;while(e!=null){var f=e.arguments[0];if(f&&(f+"").indexOf("Event")>=0)return f;e=e.caller}return null},m=function(){if("pageXOffset"in b)return{x:b.pageXOffset||0,y:b.pageYOffset||0};var a=j(c);return{x:a.scrollLeft||0,y:a.scrollTop||0}},n=function(){var a=j(c);return{w:a.clientWidth||0,h:a.clientHeight||0}},o=function(){var b=j(c);a(e).css({width:Math.max(b.scrollWidth,b.clientWidth||0)-1+"px",height:Math.max(b.scrollHeight,b.clientHeight||0)-1+"px"})},p=function(){var b=a("script"),c="",d=0,e=b.length,f=/lhgdialog(?:\.min)?\.js/i;for(;d0&&(b=window),c=b.document,a.fn.fixie6png=function(){var b=a("*",this),c,d;for(var e=0,f=b.length;e'),g=!0}var C=function(a){var b=a.style,d=j(c),e=parseInt(b.left)-d.scrollLeft,f=parseInt(b.top)-d.scrollTop;b.removeExpression("left"),b.removeExpression("top"),b.setExpression("left","this.ownerDocument.documentElement.scrollLeft"+e),b.setExpression("top","this.ownerDocument.documentElement.scrollTop + "+f)},D=function(){var a,b;A.html?typeof A.html=="string"?a='":a='':A.page&&(a=''),b=['
','',"",'','",'',"","",'',"",'',"","",'','','',"","
',A.titleBar?'
'+(A.iconTitle?'
':"")+'
'+A.title+"
"+(A.xButton?'':"")+"
":"","
",'',"",'","",A.btnBar?'':"","
',a,'
',A.loadingText,"
","
","
",i,"
"].join("");return b},E=function(){e=a("#lhgdgCover",c)[0];if(!e){var d='
'+i+"
";e=a(d,c).css("opacity",.5).appendTo(c.body)[0]}a(b).bind("resize",o),o(),a(e).css({display:"",zIndex:k()})},F=function(b,c,d,e){var f=n(),g=m(),i=b.offsetWidth,j=b.offsetHeight,k,l,o,p,q,r,s,t;e?(o=h?g.x:0,p=h?f.w+g.x-i:f.w-i,q=h?(p+g.x-20)/2:(p-20)/2,r=h?g.y:0,s=h?f.h+g.y-j:f.h-j,t=h?(s+g.y-20)/2:(s-20)/2):(o=g.x,q=g.x+(f.w-i-20)/2,p=g.x+f.w-i,r=g.y,t=g.y+(f.h-j-20)/2,s=g.y+f.h-j);switch(d){case"center":k=q;break;case"left":k=o;break;case"right":k=p;break;default:e&&h&&(d=d+g.x),k=d}switch(c){case"center":l=t;break;case"top":l=r;break;case"bottom":l=s;break;default:e&&h&&(c=c+g.y),l=c}a(b).css({top:l+"px",left:k+"px"}),e&&h&&C(b)},G=function(d){r.topWin=b,r.topDoc=c,r.curWin=window,r.curDoc=document,a(d).bind("contextmenu",function(a){a.preventDefault()}).bind("mousedown",r.SetIndex),A.html&&A.html.nodeType&&a(t).append(A.html),z=[window],b!=window&&z.push(b),A.page&&(r.dgFrm=a("#lhgfrm_"+A.id,c)[0],A.link||(r.dgWin=r.dgFrm.contentWindow,r.dgFrm.lhgDG=r),a(r.dgFrm).bind("load",function(){this.style.display="block";if(!A.link){var b=a.browser.msie?r.dgWin.document:r.dgWin;a(b).bind("mousedown",r.SetIndex),z.push(r.dgWin),r.dgDoc=r.dgWin.document,A.autoSize&&I(),a.isFunction(A.dgOnLoad)&&A.dgOnLoad.call(r)}s.style.display="none"})),A.xButton&&A.titleBar&&a(u).hover(function(){a(this).addClass("lhgdg_xbtnover")},function(){a(this).removeClass("lhgdg_xbtnover")}).bind("click",A.onXclick)},H=function(a){var b=v.offsetHeight,c=w.offsetHeight,d=A.btnBar?x.offsetHeight:0,e=parseInt(a.style.height,10)-b-c-d;s.style.lineHeight=e+"px",y.style.height=e+"px"},I=function(){var a=v.offsetHeight,b=w.offsetHeight,c=A.btnBar?x.offsetHeight:0,d=w.offsetWidth*2,e,f,g;if(A.html)e=Math.max(t.scrollHeight,t.clientHeight||0),f=Math.max(t.scrollWidth,t.clientWidth||0);else if(A.page&&!A.link){if(!r.dgDoc)return;g=j(r.dgDoc),e=Math.max(g.scrollHeight,g.clientHeight||0),f=Math.max(g.scrollWidth,g.clientWidth||0)}e=e+a+b+c,f=f+d,r.reDialogSize(f,e)},K=function(b){function o(d){for(var e=0,f=i.length;ed&&(g.x=d),g.y>e&&(g.y=e)),r.dg.style.top=A.fixed&&!h?g.y-k.y+"px":g.y+"px",r.dg.style.left=A.fixed&&!h?g.x-k.x+"px":g.x+"px"}var c,d,e,g,i=z,j,k;a(b).bind("mousedown",function(b){if(b.target.id!=="lhgdg_xbtn_"+r.opt.id){j=n(),k=m();var p=r.dg.offsetLeft,q=r.dg.offsetTop,s=r.dg.clientWidth,t=r.dg.clientHeight;g=A.fixed&&!h?{x:p+k.x,y:q+k.y}:{x:p,y:q},c={x:b.screenX,y:b.screenY},d=j.w+k.x-s,e=j.h+k.y-t,r.dg.style.zIndex=parseInt(f,10)+1;for(var u=0,v=i.length;u'+d+"",g=a(f,c).bind("click",e)[0];a("#lhgdg_btnBar_"+A.id,c).append(g)}},r.removeBtn=function(b){a("#lhgdg_"+A.id+"_"+b,c)[0]&&a("#lhgdg_"+A.id+"_"+b,c).remove()},r.SetIndex=function(){r.dg.style.zIndex=parseInt(f,10)+1,f=parseInt(r.dg.style.zIndex,10);var a=l(r.dgWin);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},r.cancel=function(){M();if(e)if(A.parent&&A.parent.opt.cover){var a=A.parent.dg.style.zIndex;e.style.zIndex=parseInt(a,10)-1}else e.style.display="none";var b=l(r.dgWin);!b||(b.preventDefault?b.preventDefault():b.returnValue=!1)},r.cleanDialog=function(){r.dg&&M(),e&&(a(e).remove(),e=null)},A.onCancel=A.onCancel||r.cancel,A.onXclick=A.onXclick||r.cancel,q&&a(q).bind("click",r.ShowDialog),a(window).bind("unload",r.cleanDialog)},a(function(){var b=setTimeout(function(){(new a.dialog({id:"reLoadId",html:"lhgdialog",width:100,title:"reLoad",height:100,left:-9e3,btnBar:!1})).ShowDialog(),clearTimeout(b)},150)})})(lhgcore);