var tbn=new Array();var dcj=-1;var qnmb=(document.all!=undefined);var zlt=false;var tfpb="";function xhkb(wpm,rqm,lycb,mgw,lrlb,yhz){this.m_Dialog=wpm;this.m_sName=rqm;this.m_nWidth=lycb;this.m_nHeight=mgw;this.m_sOpaqueLayer=lrlb;this.m_fnOnHide=yhz;}function bssb(dmp){if(zlt){var Event=((qnmb)?event:dmp);var xhkb=tbn[dcj];var wpm=xhkb.m_Dialog;var qdhb=(parseInt(Event.clientX)+mbwb);var qvdb=(parseInt(Event.clientY)+zvb);var xms=(document.body.clientWidth-1);var fcx=(document.body.clientHeight-1);if((qdhb+xhkb.m_nWidth)>=xms)qdhb=(xms-(xhkb.m_nWidth+1));if((qvdb+xhkb.m_nHeight)>=fcx)qvdb=(fcx-(xhkb.m_nHeight+1));if(qdhb<0)qdhb=0;if(qvdb<0)qvdb=0;wpm.style.left=qdhb;wpm.style.top=qvdb;}return(!zlt);}function mjjb(dmp){if(dcj>=0){var xbt=tbn[dcj].m_Dialog;var ryt=document.getElementById(xbt.id+"TitleBar");if(ryt!=undefined){var Event=((qnmb)?event:dmp);var qjwb=document.getElementById(xbt.id+"TitleIcon");var lld=parseInt(xbt.style.left);var wxd=parseInt(xbt.style.top);mbwb=(lld-Event.clientX);zvb=(wxd-Event.clientY);if((mbwb<=0)&&(Event.clientX<=(lld+tbn[dcj].m_nWidth))&&(zvb<=0)&&(Event.clientY<=(wxd+qjwb.height+4))){zlt=true;document.onmousemove=bssb;}}}return(!zlt);}function xdz(dmp){var wtnb=true;if(zlt){zlt=false;wtnb=false;}return(!zlt);}function zyt(wpm,lycb,mgw,lrlb,yhz,yndb,rzp,xj,lfb){var zk;var tjw=document.getElementById(yndb);if(tjw!=undefined){rwl=czf(tjw);hqbb=rwl[0];dkl=rwl[1];if(rzp){zk=((dkl)+(lfb));hqbb=((hqbb)+(xj));}else zk=((dkl)-(mgw));if(zk<0)zk=0;wpm.style.top=zk;wpm.style.left=((hqbb));}else{zk=((document.body.clientHeight/2)-(mgw/2));if(zk<0)zk=0;wpm.style.top=zk;wpm.style.left=((document.body.clientWidth/2)-(lycb/2));}tbn[++dcj]=new xhkb(wpm,wpm.id,lycb,mgw,lrlb,yhz);}function bzm(cntb){if((dcj>=0)&&(tbn[dcj].m_Dialog.id==cntb)){if(tbn[dcj].m_fnOnHide!=undefined)tbn[dcj].m_fnOnHide(tbn[dcj].m_sName);tbn[dcj].m_Dialog.style.display="none";if(tbn[dcj].m_sOpaqueLayer!=undefined)document.getElementById(tbn[dcj].m_sOpaqueLayer).style.display="none";tbn[dcj--]=undefined;document.onmousedown=function(){return(true);};}}function xfvb(wpm,lrlb){var ssmb=dcj;var yplb=document.getElementById(lrlb);while(ssmb>0){--ssmb;if(tbn[ssmb].m_sOpaqueLayer==lrlb){lrlb=(tbn[ssmb].m_Dialog.id+"OpaqueLayer");wpm.m_sOpaqueLayer=lrlb;break;}}return(lrlb);}function shg(cntb,yhkb,yhz){bzm(tfpb);var wpm=document.getElementById(cntb);var vpbb=document.getElementById(cntb+"Body");var lycb=parseInt(wpm.style.width);var mgw=parseInt(wpm.style.height);if(vpbb!=undefined){if(!qnmb)vpbb.style.width=(lycb-2);else vpbb.style.width=lycb;}if(wpm!=undefined){var qdwb=(8000+(dcj*2));var lrlb=(cntb+"OpaqueLayer");zyt(wpm,lycb,mgw,lrlb,yhz);wpm.style.display="block";wpm.style.zIndex=(qdwb+1);if((yhkb==undefined)||(yhkb)){lrlb=xfvb(tbn[dcj],lrlb);var yplb=document.getElementById(lrlb);if(yplb!=undefined){yplb.style.zIndex=qdwb;yplb.style.display="block";ncv(yplb);}}var ryt=document.getElementById(cntb+"TitleBar");if(ryt!=undefined)ryt.style.cursor="move";document.onmousedown=mjjb;document.onmouseup=xdz;}}function wtz(cntb,yhkb,yhz,yndb,qvnb,zlq,rzp,xj,lfb){var wpm=document.getElementById(cntb);tfpb=cntb;var vpbb=document.getElementById(cntb+"Body");var lycb,mgw=0;if(qvnb==undefined)lycb=parseInt(wpm.style.width);else lycb=parseInt(qvnb);if(zlq==undefined)mgw=parseInt(wpm.style.height);else mgw=parseInt(zlq);if(vpbb!=undefined){if(!qnmb){vpbb.style.width=(lycb-2);vpbb.style.height=((mgw-102)-2);}else{vpbb.style.width=lycb;vpbb.style.height=(mgw-78);}}if(wpm!=undefined){zyt(wpm,lycb,mgw,undefined,yhz,yndb,rzp,xj,lfb);wpm.style.display="block";wpm.style.zIndex=((8000+(dcj*2))+1);wpm.onmouseover=function(){document.onmousedown=function(){return(false);};};wpm.onmouseout=function(){document.onmousedown=function(){if(dcj>=0)bzm(cntb);return(true);};};wpm.onmousedown=function(){return(false);};document.onmousedown=function(){if(dcj>=0)bzm(cntb);return(false);};}}function ntm(gcnb,mjhb,yhz){var lrlb="",lgfb="";var hmk,rzd;if((dcj>=0)&&(tbn[dcj].m_Dialog.id==gcnb)){if(tbn[dcj].m_fnOnHide!=undefined)tbn[dcj].m_fnOnHide(gcnb);tbn[dcj].m_Dialog.style.display="none";lrlb=tbn[dcj].m_sOpaqueLayer;tbn[dcj--]=undefined;}shg(mjhb,false,yhz);hmk=document.getElementById(lrlb);rzd=document.getElementById(lgfb=xfvb(tbn[dcj],mjhb+"OpaqueLayer"));if((hmk!=undefined)&&(rzd!=undefined)){hmk.style.display="none";rzd.style.zIndex=hmk.style.zIndex;rzd.style.display="block";tbn[dcj].m_sOpaqueLayer=lgfb;}}function ynnb(jsb,ttp,mmq,kmdb){var zrjb=zgcb(jsb,ttp,mmq,70,undefined,kmdb);return(zrjb);}