var dhtmlwindow_images=window.location.protocol+"//"+window.location.hostname.replace(/^[^\.]+\./,"img.")+"/dhtml_window/";var dhtmlwindow={imagefiles:[dhtmlwindow_images+"min.png",dhtmlwindow_images+"close.png",dhtmlwindow_images+"restore.png",dhtmlwindow_images+"resize.gif"],ajaxbustcache:true,minimizeorder:0,tobjects:[],init:function(B){var E=document.createElement("div");E.id=B;E.className="dhtmlwindow";var D="";D='<div id="layer">';D+='<div id="layer_w">';D+='<div id="layer_t"><div></div></div><div class="bg">';D+='<div class="drag-handle">DHTML Window ';D+='<div class="drag-controls">';D+='<img src="'+this.imagefiles[0]+'" title="Minimize" />';D+='<img src="'+this.imagefiles[1]+'" title="Close" />';D+="</div></div>";D+='<div 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><div id="layer_b"><div></div></div>';D+="</div></div>";D+="</div>";E.innerHTML=D;document.getElementById("dhtmlwindowholder").appendChild(E);this.zIndexvalue=(this.zIndexvalue)?this.zIndexvalue+1:100;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.style.zIndex=this.zIndexvalue;B.handle._parent=B;B.resizearea._parent=B;B.controls._parent=B;B.onclose=function(){return true};B.onmousedown=function(){dhtmlwindow.zIndexvalue++;this.style.zIndex=dhtmlwindow.zIndexvalue};B.handle.onmousedown=dhtmlwindow.setupdrag;B.resizearea.onmousedown=dhtmlwindow.setupdrag;B.controls.onclick=dhtmlwindow.enablecontrols;B.show=function(){dhtmlwindow.show(this)};B.hide=function(){B.isOpen=false;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)}J.setSize(B(("width")),(B("height")));var C=B("center")?"middle":B("left");var A=B("center")?"middle":B("top");J.moveTo(C,A);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.load(D,I,G);J.isOpen=true;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"},isScrolling:function(A,B){A.contentarea.style.overflow=(B)?"auto":"hidden"},load:function(B,A,C,D){var A=A.toLowerCase();if(typeof D!="undefined"){B.handle.firstChild.nodeValue=D}if(A=="inline"){B.contentarea.innerHTML=C}else{if(A=="div"){B.contentarea.innerHTML=document.getElementById(C).innerHTML;document.getElementById(C).style.display="none"}else{if(A=="iframe"){B.contentarea.style.overflow="hidden";if(!B.contentarea.firstChild||B.contentarea.firstChild.tagName!="IFRAME"){B.contentarea.innerHTML='<iframe src="" frameborder="0" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+B.id+'"></iframe>'}window.frames["_iframe-"+B.id].location.replace(C)}else{if(A=="ajax"){this.ajax_connect(C,B)}}}}B.contentarea.datatype=A},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=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";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){alert(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)}B.style.display="none"}B.isOpen=false;return A},show:function(A){if(A.lastx){dhtmlwindow.restore(A.controls.firstChild,A)}else{A.style.display="block"}A.state="fullview";A.isOpen=true},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}}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;