<!--
// general functions
var isIE = document.all;
var isHot = false;
var ddEnabled=false;
var whichDog;
var nowX, nowY;
var offsetx, offsety;

function ddInit(e) {
  document.onselectstart = new Function ("return false");

  var topDog = isIE?"BODY":"HTML";
  whichDog = document.getElementById(isHot);
  var hotDog = isIE ? event.srcElement : e.target;
  while (hotDog.className!="titleBar"&&hotDog.tagName!=topDog){
	hotDog = isIE ? hotDog.parentElement : hotDog.parentNode;
  }
  if (hotDog.className=="titleBar"){
	offsetx=isIE ? event.clientX : e.clientX;
	offsety=isIE ? event.clientY : e.clientY;
	nowX=parseInt(whichDog.style.left);
	nowY=parseInt(whichDog.style.top);
	ddEnabled=true;
	document.onmousemove=dd;
}}

function dd(e) {
  if (!ddEnabled) return;
  whichDog.style.left = (isIE ? (nowX+event.clientX-offsetx) : (nowX+e.clientX-offsetx))+'px';
  whichDog.style.top  = (isIE ? (nowY+event.clientY-offsety) : (nowY+e.clientY-offsety))+'px';

  showElement('SELECT');
  hideElement('SELECT', whichDog);
}

function hideMe(obj) {
  whichDog = document.getElementById(obj);
  whichDog.style.display='none';
  showElement('SELECT');
}

function showMe(obj) {
  if(whichDog) {
	whichDog.style.zIndex = '99';
  }

  whichDog = document.getElementById(obj);
  whichDog.style.zIndex = '100';
  whichDog.style.display='block'
  hideElement('SELECT', whichDog);

  isHot=obj;
}

function dropMe() {
  isHot=false;
}

function minimizeMe(obj, inputObj) {
  if(inputObj.src.indexOf('minimize')>=0) {
	inputObj.src = inputObj.src.replace('minimize','maximize');
	document.getElementById(obj+'_content').style.display='none';
  } else {
	inputObj.src = inputObj.src.replace('maximize','minimize');
	document.getElementById(obj+'_content').style.display='block';
}}

document.onmousedown = ddInit;
document.onmouseup = Function("ddEnabled=false; document.onselectstart = new Function (\"return true\");");
//-->
