var dhtmlwindow={imagefiles:["js/img/min.gif","js/img/close.gif","js/img/restore.gif","js/img/resize.gif"],ajaxbustcache:true,ajaxloadinghtml:"<b>Loading Page. Please wait...</b>",minimizeorder:0,zIndexvalue:100,tobjects:[],lastactivet:{},init:function(B){var E=document.createElement("div");E.id=B;E.className="dhtmlwindow";var D="";D='<div class="drag-handle">';D+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" /><img src="'+this.imagefiles[1]+'" title="Close" /></div>';D+="</div>";D+='<div id="'+B+'_inner" class="drag-contentarea"></div>';D+='<div class="drag-statusarea"><div class="drag-resizearea" style="background: transparent url('+this.imagefiles[3]+') top right no-repeat;">&nbsp;</div></div>';D+="</div>";E.innerHTML=D;document.getElementById("dhtmlwindowholder").appendChild(E);var B=document.getElementById(B);var C=B.getElementsByTagName("div");for(var A=0;A<C.length;A++){if(/drag-/.test(C[A].className)){B[C[A].className.replace(/drag-/,"")]=C[A]}}B.handle._parent=B;B.resizearea._parent=B;B.controls._parent=B;B.onclose=function(){return true};B.onmousedown=function(){dhtmlwindow.setfocus(this)};B.handle.onmousedown=dhtmlwindow.setupdrag;B.resizearea.onmousedown=dhtmlwindow.setupdrag;B.controls.onclick=dhtmlwindow.enablecontrols;B.show=function(){dhtmlwindow.show(this)};B.hide=function(){dhtmlwindow.hide(this)};B.close=function(){dhtmlwindow.close(this)};B.setSize=function(F,G){dhtmlwindow.setSize(this,F,G)};B.moveTo=function(F,G){dhtmlwindow.moveTo(this,F,G)};B.isResize=function(F){dhtmlwindow.isResize(this,F)};B.isScrolling=function(F){dhtmlwindow.isScrolling(this,F)};B.load=function(F,G,H){dhtmlwindow.load(this,F,G,H)};this.tobjects[this.tobjects.length]=B;return B},open:function(J,D,I,G,E,H){var F=dhtmlwindow;function B(K){var L=new RegExp(K+"=([^,]+)","i");return(L.test(E))?parseInt(RegExp.$1):0}if(document.getElementById(J)==null){J=this.init(J)}else{J=document.getElementById(J)}this.setfocus(J);J.setSize(B(("width")),(B("height")));var C=B("center")?"middle":B("left");var A=B("center")?"middle":B("top");if(typeof H!="undefined"&&H=="recal"&&this.scroll_top==0){if(window.attachEvent&&!window.opera){this.addEvent(window,function(){setTimeout(function(){J.moveTo(C,A)},400)},"load")}else{this.addEvent(window,function(){J.moveTo(C,A)},"load")}}J.isResize(B("resize"));J.isScrolling(B("scrolling"));J.style.visibility="visible";J.style.display="block";J.contentarea.style.display="block";J.moveTo(C,A);J.load(D,I,G);if(J.state=="minimized"&&J.controls.firstChild.title=="Restore"){J.controls.firstChild.setAttribute("src",dhtmlwindow.imagefiles[0]);J.controls.firstChild.setAttribute("title","Minimize");J.state="fullview"}return J},setSize:function(B,A,C){B.style.width=Math.max(parseInt(A),150)+"px";B.contentarea.style.height=Math.max(parseInt(C),100)+"px"},moveTo:function(B,A,C){this.getviewpoint();B.style.left=(A=="middle")?this.scroll_left+(this.docwidth-B.offsetWidth)/2+"px":this.scroll_left+parseInt(A)+"px";B.style.top=(C=="middle")?this.scroll_top+(this.docheight-B.offsetHeight)/2+"px":this.scroll_top+parseInt(C)+"px"},isResize:function(A,B){A.statusarea.style.display=(B)?"block":"none";A.resizeBool=(B)?1:0},isScrolling:function(A,B){A.contentarea.style.overflow=(B)?"auto":"hidden"},load:function(C,B,D,E){if(C.isClosed){alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.");return }var B=B.toLowerCase();if(typeof E!="undefined"){C.handle.firstChild.nodeValue=E}if(B=="inline"){C.contentarea.innerHTML=D}else{if(B=="div"){var A=document.getElementById(D);C.contentarea.innerHTML=(A.defaultHTML||A.innerHTML);if(!A.defaultHTML){A.defaultHTML=A.innerHTML}A.innerHTML="";A.style.display="none"}else{if(B=="iframe"){C.contentarea.style.overflow="hidden";if(!C.contentarea.firstChild||C.contentarea.firstChild.tagName!="IFRAME"){C.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+C.id+'"></iframe>'}window.frames["_iframe-"+C.id].location.replace(D)}else{if(B=="ajax"){this.ajax_connect(D,C)}}}}C.contentarea.datatype=B},setupdrag:function(B){var C=dhtmlwindow;var A=this._parent;C.etarget=this;var B=window.event||B;C.initmousex=B.clientX;C.initmousey=B.clientY;C.initx=parseInt(A.offsetLeft);C.inity=parseInt(A.offsetTop);C.width=parseInt(A.offsetWidth);C.contentheight=parseInt(A.contentarea.offsetHeight);if(A.contentarea.datatype=="iframe"){A.style.backgroundColor="#F8F8F8";A.contentarea.style.visibility="hidden"}document.onmousemove=C.getdistance;document.onmouseup=function(){if(A.contentarea.datatype=="iframe"){A.contentarea.style.backgroundColor="white";A.contentarea.style.visibility="visible"}C.stop()};return false},getdistance:function(B){var C=dhtmlwindow;var A=C.etarget;var B=window.event||B;C.distancex=B.clientX-C.initmousex;C.distancey=B.clientY-C.initmousey;if(A.className=="drag-handle"){C.move(A._parent,B)}else{if(A.className=="drag-resizearea"){C.resize(A._parent,B)}}return false},getviewpoint:function(){var B=document.all&&!window.opera;var A=document.documentElement&&parseInt(document.documentElement.clientWidth)||100000;this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;this.scroll_top=(B)?this.standardbody.scrollTop:window.pageYOffset;this.scroll_left=(B)?this.standardbody.scrollLeft:window.pageXOffset;this.docwidth=(B)?this.standardbody.clientWidth:(/Safari/i.test(navigator.userAgent))?window.innerWidth:Math.min(A,window.innerWidth-16);this.docheight=(B)?this.standardbody.clientHeight:window.innerHeight},rememberattrs:function(A){this.getviewpoint();A.lastx=parseInt((A.style.left||A.offsetLeft))-dhtmlwindow.scroll_left;A.lasty=parseInt((A.style.top||A.offsetTop))-dhtmlwindow.scroll_top;A.lastwidth=parseInt(A.style.width)},move:function(A,B){A.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px";A.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"},resize:function(A,B){A.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex,150)+"px";A.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey,100)+"px"},enablecontrols:function(B){var C=dhtmlwindow;var A=window.event?window.event.srcElement:B.target;if(/Minimize/i.test(A.getAttribute("title"))){C.minimize(A,this._parent)}else{if(/Restore/i.test(A.getAttribute("title"))){C.restore(A,this._parent)}else{if(/Close/i.test(A.getAttribute("title"))){C.close(this._parent)}}}return false},minimize:function(B,A){dhtmlwindow.rememberattrs(A);B.setAttribute("src",dhtmlwindow.imagefiles[2]);B.setAttribute("title","Restore");A.state="minimized";A.contentarea.style.display="none";A.statusarea.style.display="none";if(typeof A.minimizeorder=="undefined"){dhtmlwindow.minimizeorder++;A.minimizeorder=dhtmlwindow.minimizeorder}A.style.left="10px";A.style.width="200px";var C=A.minimizeorder*10;A.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(A.handle.offsetHeight*A.minimizeorder)-C+"px"},restore:function(B,A){dhtmlwindow.getviewpoint();B.setAttribute("src",dhtmlwindow.imagefiles[0]);B.setAttribute("title","Minimize");A.state="fullview";A.style.display="block";A.contentarea.style.display="block";if(A.resizeBool){A.statusarea.style.display="block"}A.style.left=parseInt(A.lastx)+dhtmlwindow.scroll_left+"px";A.style.top=parseInt(A.lasty)+dhtmlwindow.scroll_top+"px";A.style.width=parseInt(A.lastwidth)+"px"},close:function(B){try{var A=B.onclose()}catch(C){var A=true}finally{if(typeof A=="undefined"){alert('An error has occured somwhere inside your "onclose" event handler');var A=true}}if(A){if(B.state!="minimized"){dhtmlwindow.rememberattrs(B)}if(window.frames["_iframe-"+B.id]){window.frames["_iframe-"+B.id].location.replace("about:blank")}else{B.contentarea.innerHTML=""}B.style.display="none";B.isClosed=true}return A},setopacity:function(A,B){if(!A){return }if(A.filters&&A.filters[0]){if(typeof A.filters[0].opacity=="number"){A.filters[0].opacity=B*100}else{A.style.filter="alpha(opacity="+B*100+")"}}else{if(typeof A.style.MozOpacity!="undefined"){A.style.MozOpacity=B}else{if(typeof A.style.opacity!="undefined"){A.style.opacity=B}}}},setfocus:function(A){this.zIndexvalue++;A.style.zIndex=this.zIndexvalue;A.isClosed=false;this.setopacity(this.lastactivet.handle,0.5);this.setopacity(A.handle,1);this.lastactivet=A},show:function(A){if(A.isClosed){alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.");return }if(A.lastx){dhtmlwindow.restore(A.controls.firstChild,A)}else{A.style.display="block"}this.setfocus(A);A.state="fullview"},hide:function(A){A.style.display="none"},ajax_connect:function(A,B){var E=false;var D="";if(window.XMLHttpRequest){E=new XMLHttpRequest()}else{if(window.ActiveXObject){try{E=new ActiveXObject("Msxml2.XMLHTTP")}catch(C){try{E=new ActiveXObject("Microsoft.XMLHTTP")}catch(C){}}}else{return false}}B.contentarea.innerHTML=this.ajaxloadinghtml;E.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(E,B)};if(this.ajaxbustcache){D=(A.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime()}E.open("GET",A+D,true);E.send(null)},ajax_loadpage:function(B,A){if(B.readyState==4&&(B.status==200||window.location.href.indexOf("http")==-1)){A.contentarea.innerHTML=B.responseText}},stop:function(){dhtmlwindow.etarget=null;document.onmousemove=null;document.onmouseup=null},addEvent:function(B,C,A){var A=(window.addEventListener)?A:"on"+A;if(B.addEventListener){B.addEventListener(A,C,false)}else{if(B.attachEvent){B.attachEvent(A,C)}}},cleanup:function(){for(var A=0;A<dhtmlwindow.tobjects.length;A++){dhtmlwindow.tobjects[A].handle._parent=dhtmlwindow.tobjects[A].resizearea._parent=dhtmlwindow.tobjects[A].controls._parent=null}window.onload=null}};document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>');window.onunload=dhtmlwindow.cleanup;