//cursor constants
var titleMove			= 0;
var titleText			= 1;
var byMove				= 2;
var byText				= 3;
var copyMove			= 6;
var copyText			= 7;
var prevMove			= 8;
var prevPointer			= 9;
var closeMove			= 10;
var closePointer		= 11;
var nextMove			= 12;
var nextPointer			= 13;

//lt constants
var _left		= 0;
var _right		= 1;
var _center		= 2;

//layer type booleans
var wordlayer;
var imglayer;

//objects
var wordobj;
var imgobj;

//image type constants
var p	= "photo";
var a	= "artwork";
var r = "article";

//artist constants
var al = "alacartoona";



/***********************************************
* Image Thumbnail viewer- c Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var ie  = document.all;
var ns6 = document.getElementById && !document.all;

//===========================================================================
// *** ietruebody ***		
//---------------------------------------------------------------------------
//      WRITTEN BY:  visit http://www.dynamicdrive.com/
//===========================================================================
function ietruebody(){
	return (document.compatMode && document.compatMode != "BackCompat" && !window.opera) ? document.documentElement : document.body;
}
//end ietruebody

//===========================================================================
// *** drag_drop ***		
//---------------------------------------------------------------------------
//      WRITTEN BY:  visit http://www.dynamicdrive.com/
//===========================================================================
/*
function drag_drop(e){
	if (ie&&dragapproved){
		if (wordlayer){
			wordobj.style.left=tempx+event.clientX-offsetx+"px";
			wordobj.style.top=tempy+event.clientY-offsety+"px";
		}else if (imglayer){
			imgobj.style.left=tempx+event.clientX-offsetx+"px";
			imgobj.style.top=tempy+event.clientY-offsety+"px";
		}
	}else if (ns6&&dragapproved){
		if (wordlayer){
			wordobj.style.left=tempx+e.clientX-offsetx+"px";
			wordobj.style.top=tempy+e.clientY-offsety+"px";
		}else if (imglayer){
			imgobj.style.left=tempx+e.clientX-offsetx+"px";
			imgobj.style.top=tempy+e.clientY-offsety+"px";
		}
	}
	return false;
}
//end drag_drop
*/

//===========================================================================
// *** initializedrag ***		
//---------------------------------------------------------------------------
//      WRITTEN BY:  visit http://www.dynamicdrive.com/
//===========================================================================
/*
function initializedrag(e){
	if ((ie&&isvalidid(ie))||(ns6&&isvalidid(ns6))){
		offsetx=ie? event.clientX : e.clientX;
		offsety=ie? event.clientY : e.clientY;

	if (wordlayer){
			wordobj
			tempx=parseInt(wordobj.style.left);
			tempy=parseInt(wordobj.style.top);
		}else if (imglayer){
			imgobj
			tempx=parseInt(imgobj.style.left);
			tempy=parseInt(imgobj.style.top);
		}
		
		dragapproved=true;
		document.onmousemove=drag_drop;
	}
}
//end InitializeDrag
*/
//===========================================================================
// *** isvalidid ***		
//---------------------------------------------------------------------------
//     CALLED WITH:  browser	
//         PURPOSE:  Checks the id of the element targetted by the event.  If
//                   the id is a match, return true, else false.
//      WRITTEN BY:  visit http://www.dynamicdrive.com/
//		 MODIFIED BY:	 Christian Hankel
//===========================================================================
function isvalidid(browser){
	if(browser==ie){
		switch(event.srcElement.id){
			case "imgtitle"	: 
			case "imgby"	:
			case "imgimage"	:
			case "imgcopy"	:
			case "imgprev"	:
			case "imgclose"	:
			case "imgnext"	:
			case "wrdtitle"	:
			case "wrdby"	:
			case "wrdcopy"	:
			case "wrdprev"	:
			case "wrdclose"	:
			case "wrdnext"	:
				return true;
			default:
				return false;
		}//endswitch
	}else if(browser==ns6){
		switch(e.target.id){
			case "imgtitle"	:
			case "imgby"	:
			case "imgimage"	:
			case "imgcopy"	:
			case "imgprev"	:
			case "imgclose"	:
			case "imgnext"	:
			case "wrdtitle"	:
			case "wrdby"	:
			case "wrdcopy"	:
			case "wrdprev"	:
			case "wrdclose"	:
			case "wrdnext"	:	
				return true;
			default:
				return false;
		}//endswitch
	}else{
		return false;
	}
}
//end isvalidid

//===========================================================================
// *** closepreview ***		
//---------------------------------------------------------------------------
//      WRITTEN BY:  Christian A. Hankel
//===========================================================================
function closepreview(){
	if (wordlayer){
		wordobj.style.visibility="hidden";
		wordlayer = false;
	}else if (imglayer){
		imgobj.style.visibility="hidden";
		imglayer = false;
	}
}
//end closepreview

//===========================================================================
// *** initbools ***		
//---------------------------------------------------------------------------
//      WRITTEN BY:  Christian A. Hankel
//===========================================================================
function initbools(){
	wordlayer = false;
	imglayer = false;
}
//end initbools

//===========================================================================
// *** wraparray ***		
//---------------------------------------------------------------------------
//         PURPOSE:  Check for out-of-bound values and wrap to front or 
//					 back of array.
//      WRITTEN BY:  Christian A. Hankel
//===========================================================================
function wraparray(pos, arrayLength, bound){
	
	if (pos < 0){
		return (arrayLength - bound) / bound;
	}
	else if ((pos * bound) > arrayLength - 1){
		return 0;
	}else{
		return pos;
	}
}
//end wraparray


//document.onmousedown=initializedrag
//document.onmouseup=new Function("dragapproved=false")
