// JavaScript Document

// Layer Script

var sURL = unescape(window.location.pathname);

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  pilotDog=isIE ? document.all.PilotLayer : document.getElementById("PilotLayer");  
  hotDog=isIE ? event.srcElement : e.target;   
}


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 (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}


function showPilot(){
  if (isIE||isNN) pilotDog.style.visibility="visible";
  else if (isN4) document.PilotLayer.visibility="show";
}

function hidePilot(){
  if (isIE||isNN) pilotDog.style.visibility="hidden";
  else if (isN4) document.PilotLayer.visibility="hide";
}


// Gallery Script
var lastID = 0;
function SelectImg(id) {
	if (lastID > 0) {
		document.getElementById(lastID).className = "thumbNormal";
	}
	if (id == lastID) {
		// hide enlarged
		document.getElementById(id).className = "thumbNormal";
		document.getElementById(0).src = "../dotclear.gif";
		hideMe();		
		lastID = 0;		
	}
	else {
		// show enlarged
		document.getElementById(id).className = "thumbSelected";
		document.getElementById(0).src = document.getElementById(id).src;
		showMe();		
		lastID = id;
	}
}

function HideLarge() {
		document.getElementById(lastID).className = "thumbNormal";
		document.getElementById(0).src = "../dotclear.gif";
		hideMe();		
		lastID = 0;		
}


function LoadTrigger() {
	document.getElementById(0).src = "../dotclear.gif";
	ddInit();
	hideMe();
}

// Open New Windows
function newWin(theURL,winName,features) { 
	window.open(theURL,winName,features);
}
