var readSizeFromCookie=false;var windowMinSize=[400,120];var moveCounter=-1;var startEventPos=new Array();var startPosWindow=new Array();var startWindowSize=new Array();var initResizeCounter=-1;var activeWindow=false;var activeWindowContent=false;var windowSizeArray=new Array();var windowPositionArray=new Array();var currentZIndex=10000;var windowStateArray=new Array();var activeWindowIframe=false;var divCounter=0;var zIndexSet=false;var MSIEWIN=(navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("Win")>=0&&navigator.userAgent.toLowerCase().indexOf("opera")<0)?true:false;var opera=navigator.userAgent.toLowerCase().indexOf("opera")>=0?true:false;var ajaxObjects=new Array();function Get_Cookie(c){var d=document.cookie.indexOf(c+"=");var a=d+c.length+1;if((!d)&&(c!=document.cookie.substring(0,c.length))){return null}if(d==-1){return null}var b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))}function Set_Cookie(b,f,c,i,d,a){c=c*60*60*24*1000;var e=new Date();var g=new Date(e.getTime()+(c));var h=b+"="+escape(f)+((c)?";expires="+g.toGMTString():"")+((i)?";path="+i:"")+((d)?";domain="+d:"")+((a)?";secure":"");document.cookie=h}function cancelEvent(){return(moveCounter==-1&&initResizeCounter==-1)?true:false}function initMove(a){if(document.all){a=event}moveCounter=0;switchElement(false,this);startEventPos=[a.clientX,a.clientY];startPosWindow=[activeWindow.offsetLeft,activeWindow.offsetTop];startMove();if(!MSIEWIN){return false}}function startMove(){if(moveCounter>=0&&moveCounter<=10){moveCounter++;setTimeout("startMove()",5)}}function stopMove(b){if(document.all){b=event}moveCounter=-1;initResizeCounter=-1;if(!activeWindow||!activeWindowContent){return}var a="0";if(windowStateArray[activeWindow.id.replace(/[^0-9]/g,"")]){a="1"}Set_Cookie(activeWindow.id+"_attr",activeWindow.style.left.replace("px","")+","+activeWindow.style.top.replace("px","")+","+activeWindow.style.width.replace("px","")+","+activeWindowContent.style.height.replace("px","")+","+activeWindow.style.zIndex+","+a,50)}function moveWindow(c){if(document.all){c=event}if(moveCounter>=10){activeWindow.style.left=startPosWindow[0]+c.clientX-startEventPos[0]+"px";activeWindow.style.top=startPosWindow[1]+c.clientY-startEventPos[1]+"px"}if(initResizeCounter>=10){var b=Math.max(windowMinSize[0],startWindowSize[0]+c.clientX-startEventPos[0]);var a=Math.max(windowMinSize[1],startWindowSize[1]+c.clientY-startEventPos[1]);activeWindow.style.width=b+"px";activeWindowContent.style.height=a+"px";if(MSIEWIN&&activeWindowIframe){activeWindowIframe.style.width=(b)+"px";activeWindowIframe.style.height=(a+20)+"px"}}if(!document.all){return false}}function initResizeWindow(a){if(document.all){a=event}initResizeCounter=0;switchElement(false,document.getElementById("dhtml_goodies_id"+this.id.replace(/[^\d]/g,"")));startWindowSize=[activeWindowContent.offsetWidth,activeWindowContent.offsetHeight];startEventPos=[a.clientX,a.clientY];if(MSIEWIN){activeWindowIframe=activeWindow.getElementsByTagName("IFRAME")[0]}startResizeWindow();return false}function startResizeWindow(){if(initResizeCounter>=0&&initResizeCounter<=10){initResizeCounter++;setTimeout("startResizeWindow()",5)}}function switchElement(d,c){if(!c){c=this}var b=c.id.replace(/[^0-9]/g,"");var a="0";if(windowStateArray[b]){a="1"}if(activeWindow&&activeWindowContent){Set_Cookie(activeWindow.id+"_attr",activeWindow.style.left.replace("px","")+","+activeWindow.style.top.replace("px","")+","+activeWindow.style.width.replace("px","")+","+activeWindowContent.style.height.replace("px","")+","+activeWindow.style.zIndex+","+a,50)}currentZIndex=currentZIndex/1+1;activeWindow=document.getElementById("dhtml_goodies_id"+b);activeWindow.style.zIndex=currentZIndex;activeWindowContent=document.getElementById("windowContent"+b);Set_Cookie(activeWindow.id+"_attr",activeWindow.style.left.replace("px","")+","+activeWindow.style.top.replace("px","")+","+activeWindow.style.width.replace("px","")+","+activeWindowContent.style.height.replace("px","")+","+activeWindow.style.zIndex+","+a,50)}function hideWindow(){switchElement(false,document.getElementById("dhtml_goodies_id1"));activeWindow.style.display="none"}function initWindows(g,b){var j=document.getElementsByTagName("DIV");if(b){var k=b.getElementsByTagName("DIV");var j=new Array();j[j.length]=b;for(var l=0;l<k.length;l++){j[j.length]=k[l]}}for(var l=0;l<j.length;l++){if(j[l].className=="dhtmlgoodies_window"){if(MSIEWIN){var f=document.createElement("IFRAME");f.style.border="0px";f.frameborder=0;f.style.position="absolute";f.style.backgroundColor="#FFFFFF";f.style.top="0px";f.style.left="0px";f.style.zIndex=100;var h=j[l].getElementsByTagName("DIV")[0];j[l].insertBefore(f,h)}if(b){j[l].style.zIndex=currentZIndex;currentZIndex=currentZIndex/1+1}divCounter=divCounter+1;if(divCounter==1){activeWindow=j[l]}j[l].id="dhtml_goodies_id"+divCounter;j[l].onmousedown=switchElement;if(readSizeFromCookie){var d=Get_Cookie(j[l].id+"_attr")+""}else{d=""}if(b){d=""}var c=new Array();if(d.indexOf(",")>0){c=d.split(",");if(!windowPositionArray[divCounter]){windowPositionArray[divCounter]=new Array()}windowPositionArray[divCounter][0]=Math.max(0,c[0]);windowPositionArray[divCounter][1]=Math.max(0,c[1])}if(c.length==5&&!zIndexSet){j[l].style.zIndex=c[4];if(c[4]/1>currentZIndex){currentZIndex=c[4]/1}}if(windowPositionArray[divCounter]){j[l].style.left=windowPositionArray[divCounter][0]+"px";j[l].style.top=windowPositionArray[divCounter][1]+"px"}var i=j[l].getElementsByTagName("IMG");for(var a=0;a<i.length;a++){if(i[a].className=="resizeImage"){i[a].style.cursor="nw-resize";i[a].onmousedown=initResizeWindow;i[a].id="resizeImage"+divCounter;break}if(i[a].className=="closeButton"){i[a].id="closeImage"+divCounter;i[a].onclick=hideWindow}}}if(j[l].className=="dhtmlgoodies_windowMiddle"||j[l].className=="dhtmlgoodies_window_bottom"){j[l].style.zIndex=1000}if(j[l].className=="dhtmlgoodies_window_top"){j[l].onmousedown=initMove;j[l].id="top_bar"+divCounter;j[l].style.zIndex=1000}if(j[l].className=="dhtmlgoodies_windowContent"){j[l].id="windowContent"+divCounter;j[l].style.zIndex=1000;if(c&&c.length>3){if(!windowSizeArray[divCounter]){windowSizeArray[divCounter]=new Array()}windowSizeArray[divCounter][0]=c[2];windowSizeArray[divCounter][1]=c[3]}if(c&&c.length==5){activeWindowContent=document.getElementById("windowContent"+divCounter)}if(windowSizeArray[divCounter]){j[l].style.height=windowSizeArray[divCounter][1]+"px";j[l].parentNode.parentNode.style.width=windowSizeArray[divCounter][0]+"px";if(MSIEWIN){f.style.width=(windowSizeArray[divCounter][0])+"px";f.style.height=(windowSizeArray[divCounter][1]+20)+"px"}}}}if(!b){document.documentElement.onmouseup=stopMove;document.documentElement.onmousemove=moveWindow;document.documentElement.ondragstart=cancelEvent;document.documentElement.onselectstart=cancelEvent}return divCounter}function createNewWindow(c,k,e,h){var a=document.createElement("DIV");a.className="dhtmlgoodies_window";document.body.appendChild(a);var j=document.createElement("DIV");j.className="dhtmlgoodies_window_top";a.appendChild(j);var f=document.createElement("IMG");f.src="images/popup/top_left.gif";f.align="left";j.appendChild(f);var f=document.createElement("IMG");f.src="images/popup/top_center.gif";f.className="topCenterImage";j.appendChild(f);var i=document.createElement("DIV");i.className="top_buttons";j.appendChild(i);var f=document.createElement("IMG");f.src="images/popup/close.gif";f.className="closeButton";i.appendChild(f);var f=document.createElement("IMG");f.src="images/popup/top_right.gif";i.appendChild(f);var g=document.createElement("DIV");g.className="dhtmlgoodies_windowMiddle";a.appendChild(g);var d=document.createElement("DIV");d.className="dhtmlgoodies_windowContent";g.appendChild(d);var b=document.createElement("DIV");b.className="dhtmlgoodies_window_bottom";a.appendChild(b);var f=document.createElement("IMG");f.src="images/popup/bottom_right.gif";f.className="resizeImage";b.appendChild(f);windowSizeArray[windowSizeArray.length]=[c,k];windowPositionArray[windowPositionArray.length]=[e,h];a.style.width=c+"px";d.style.height=k+"px";a.style.left=e+"px";a.style.top=h+"px";return initWindows(false,a)}function showAjaxContent(b,a){document.getElementById("windowContent"+a).innerHTML=ajaxObjects[b].response}function addContentFromUrl(b,a){var c=ajaxObjects.length;ajaxObjects[c]=new sack();ajaxObjects[c].requestFile=b;ajaxObjects[c].onCompletion=function(){showAjaxContent(c,a)};ajaxObjects[c].runAJAX()}function customFunctionCreateWindow(c,d,a,f,e){var b=createNewWindow(d,a,f,e);addContentFromUrl(c,b)}window.onload=initWindows;