// JavaScript Document

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHotTwo=false;

function ddInitTwo(e){
  topDog=isIE ? "body" : "html";
  whichDogTwo=isIE ? document.all.theLayerTwo : document.getElementById("theLayerTwo");  
  hotDog=isIE ? event.srcElement : e.target;  
  if (hotDog.id) {
    while (hotDog.id!="titleBarTwo"&&hotDog.tagName!=topDog){
      hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
    }  
  }
  if (hotDog.id=="titleBarTwo"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDogTwo.style.left);
    nowY=parseInt(whichDogTwo.style.top);
    ddEnabledTwo=true;
    document.onmousemove=ddTwo;
  }
}

function ddTwo(e){
  if (!ddEnabledTwo) return;
  whichDogTwo.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx+"px"; 
  whichDogTwo.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety+"px";
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHotTwo){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMeTwo(){
  if (isIE||isNN) whichDogTwo.style.visibility="hidden";
  else if (isN4) document.theLayerTwo.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDogTwo.style.visibility="visible";
  else if (isN4) document.theLayerTwo.visibility="show";
}

function addEvent(elm, evType, fn, useCapture)
// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
//    alert("Handler could not be removed");
  }
} 

addEvent(document, "mousedown", ddInitTwo);
//document.onmousedown=ddInit;
addEvent(document, "mouseup", Function("ddEnabledTwo=false"));
//document.onmouseup=Function("ddEnabled=false");