<!--
isIE=document.all;
isNS=!document.all&&document.getElementById;
isNS4=document.layers;
isHot=false;

function popInit(e) {
	topPop=isIE?"BODY":"HTML";
	whichPop=isIE ? document.all.popLayer : document.getElementById("popLayer");
	hotPop=isIE ? event.srcElement : e.target;
	if(hotPop.id && hotPop.id!="undefined") {
		while(hotPop.id!="titleBar" && hotPop.tagName!=topPop) {
			hotPop=isIE ? hotPop.parentElement : hotPop.parentNode;
		}
		if(hotPop.id=="titleBar") {
			offsetx=isIE ? event.clientX : e.clientX;
			offsety=isIE ? event.clientY : e.clientY;
			nowX=parseInt(whichPop.style.left);
			nowY=parseInt(whichPop.style.top);
			dragEnabled=true;
			document.onmousemove=drag;
		}
	}
}

function drag(e) {
	if(!whichPop || whichPop=="undefined") {
		whichPop=document.getElementById("popLayer");
	}
  if(!dragEnabled) return;
  whichPop.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
  whichPop.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;
}

function dragNS4(whatPop) {
  if(!isNS4) return;
  NS4=eval(whatPop);
  NS4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  NS4.onmousedown=function(e) {
    NS4.captureEvents(Event.MOUSEMOVE);
    NS4x=e.x;
    NS4y=e.y;
  }
  NS4.onmousemove=function(e) {
    if(isHot) {
      NS4.moveBy(e.x-NS4x,e.y-NS4y);
      return false;
    }
  }
  NS4.onmouseup=function() {
    NS4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hidePop() {
	if(!whichPop || whichPop=="undefined") {
		whichPop=document.getElementById("popLayer");
	}
  if(isIE||isNS) whichPop.style.visibility="hidden";
  else if(isNS4) document.popLayer.visibility="hide";
}

function showPop() {
	if(!whichPop || whichPop=="undefined") {
		whichPop=document.getElementById("popLayer");
	}
  if(isIE||isNS) whichPop.style.visibility="visible";
  else if(isNS4) document.popLayer.visibility="show";
}

document.onmousedown=popInit;
document.onmouseup=Function("dragEnabled=false");
//-->
