/*! * lhgcore dialog plugin v3.5.2 * date : 2011-07-03 11:03:11 * copyright (c) 2009 - 2011 by li hui gang */ (function(a){var b=window,c,d,e,f=a.browser.msie&&a.browser.version<7?!0:!1,g=f?'':"",h=function(a){a=a||document;return a.compatmode=="css1compat"?a.documentelement:a.body},i=function(){e||(e=1976);return++e},j=function(){if("pagexoffset"in b)return{x:b.pagexoffset||0,y:b.pageyoffset||0};var a=h(c);return{x:a.scrollleft||0,y:a.scrolltop||0}},k=function(){var a=h(c);return{w:a.clientwidth||0,h:a.clientheight||0}},l=function(){var a=document.getelementsbytagname("script"),b="",c=0,d=a.length,e=/lhgdialog(?:\.min)?\.js/i;for(;c0)b=window;c=b.document;try{c.execcommand("backgroundimagecache",!1,!0)}catch(q){}o=o.split(",");for(var r=0,s=o.length;r');a.fn.fixie6png=function(){var b=a("*",this),c,d;for(var e=0,f=b.length;e'+y.html+"":a='':y.page&&(a=''),b=['','',"",'','',y.titlebar?''+(y.icontitle?'':"")+''+y.title+""+(y.minbtn?'':"")+(y.maxbtn?'':"")+(y.xbutton?'':"")+"":"","",'',"","",'',"",'',"",'',a,'',y.loadingtext,"","","",y.btnbar?'':"","","",'',"","",'','','',"","",g,""].join("");return b},f=function(){d=a("#lhgdgcover",c)[0];if(!d){var e=''+g+"";d=a(e,c).css("opacity",y.opacity).appendto(c.body)[0]}y.lockscroll&&a("html",c).addclass("lhgdg_lockscroll"),a(b).bind("resize",p),p(),a(d).css({display:"",zindex:i()})},g=function(b,c,d,e){var g=k(),h=j(),i=parseint(b.style.width,10),l=parseint(b.style.height,10),m,n,o,p,q,r,s,t;e?(o=f?h.x:0,p=f?g.w+h.x-i:g.w-i,q=f?(p+h.x-20)/2:(p-20)/2,r=f?h.y:0,s=f?g.h+h.y-l:g.h-l,t=f?(s+h.y-20)/2:(s-20)/2):(o=h.x,q=h.x+(g.w-i-20)/2,p=h.x+g.w-i,r=h.y,t=h.y+(g.h-l-20)/2,s=h.y+g.h-l);switch(d){case"center":m=q;break;case"left":m=o;break;case"right":m=p;break;default:e&&f&&(d=d+h.x),m=d}switch(c){case"center":n=t;break;case"top":n=r;break;case"bottom":n=s;break;default:e&&f&&(c=c+h.y),n=c}nd&&(h.x=d),h.y>g&&(h.y=g)),m.dg.style.top=y.fixed&&!f?h.y-n.y+"px":h.y+"px",m.dg.style.left=y.fixed&&!f?h.x-n.x+"px":h.x+"px"}var c,d,g,h,i=w,l,n;a(b).bind("mousedown",function(b){if(b.target.id!=="lhgdg_xbtn_"+y.id){l=k(),n=j();var q=m.dg.offsetleft,r=m.dg.offsettop,s=m.dg.clientwidth,t=m.dg.clientheight;h=y.fixed&&!f?{x:q+n.x,y:r+n.y}:{x:q,y:r},c={x:b.screenx,y:b.screeny},d=l.w+n.x-s,g=l.h+n.y-t,m.dg.style.zindex=parseint(e,10)+1;for(var u=0,v=i.length;u"+d+"").unbind("click").bind("click",e);else{var g=''+d+"",h=a(g,c).bind("click",e)[0];f==="left"?a(".lhgdg_btn_div_"+y.skin,v).prepend(h):a(".lhgdg_btn_div_"+y.skin,v).append(h)}},m.removebtn=function(b){a("#lhgdg_"+y.id+"_"+b,c)[0]&&a("#lhgdg_"+y.id+"_"+b,c).remove()},m.setindex=function(){m.dg.style.zindex=parseint(e,10)+1,e=parseint(m.dg.style.zindex,10)},m.setxbtn=function(b,c){y.xbutton&&y.titlebar&&(a.isfunction(b)&&a(r).unbind("click").bind("click",b),c?r.style.display="none":r.style.display="")},m.settitle=function(b){y.titlebar&&typeof b=="string"&&a(".lhgdg_title_"+y.skin,m.dg).html(b)},m.cancel=function(){q();if(d){if(y.parent&&y.parent.iscover){var b=y.parent.dg.style.zindex;d.style.zindex=parseint(b,10)-1}else d.style.display="none";y.lockscroll&&a("html",c).removeclass("lhgdg_lockscroll")}},m.cleandialog=function(){m.dg&&q(),d&&(a(d).remove(),d=null)},m.closetime=function(a,b,c){x&&cleartimeout(x),b&&b.call(m),a&&(x=settimeout(function(){c&&c.call(m),m.cancel(),cleartimeout(x)},1e3*a))},m.setposition=function(a,b){g(m.dg,b,a,y.fixed)},m.iwin=function(b){if(a("#lhgfrm_"+b,c)[0])return a("#lhgfrm_"+b,c)[0].contentwindow;return null},m.idoc=function(b){if(a("#lhgfrm_"+b,c)[0])return a("#lhgfrm_"+b,c)[0].contentwindow.document;return null},m.idg=function(a){return c.getelementbyid("lhgdlg_"+a)||null},m.setcancelbtn=function(b,d){d=d||m.cancel,a("#lhgdg_"+y.id+"_dgcancelbtn",c)[0]&&a("#lhgdg_"+y.id+"_dgcancelbtn",c).html(""+b+"").unbind("click").bind("click",d)},m.setargs=function(a){y.args=a},m.getargs=function(){return y.args},m.dialogid=y.id,m.parent=y.parent,m.iscover=y.cover?!0:!1,a(window).bind("unload",m.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)})})(window.lhgcore||window.jquery);