/*
***************************************************************
* Created 1999 isaka studio (Israel Alvarez)                  *
*                                                             *
* Hey, if you wanna copy anything, just ask us - we're not    *
* tools and will probably even help if we can.                *
***************************************************************
*/

// Array Extensions  v1.0
// http://www.dithered.com/javascript/array/index.html
// code by Chris Nott (chris@dithered.com)


// Join two arrays
function _Array_concat(secondArray) {
	var firstArray = this.copy();
	for (var i = 0; i < secondArray.length; i++) {
		firstArray[firstArray.length] = secondArray[i];
	}
	return firstArray;
}


// Copy an array
function _Array_copy() {
	var copy = new Array();
	for (var i = 0; i < this.length; i++) {
		copy[i] = this[i];
	}
	return copy;
}


// Remove the last element of an array and return it
function _Array_pop() {
	var lastItem = this[this.length - 1];
	this.length--;
	return lastItem;
}


// Add an element to the end of an array
function _Array_push() {
	var currentLength = this.length;
	for (var i = 0; i < arguments.length; i++) {
		this[currentLength + i] = arguments[i];
	}
	return arguments[arguments.length - 1];
}


// Remove the first element of an array and return it
function _Array_shift() {
	var firstItem = this[0];
	for (var i = 0; i < this.length - 1; i++) {
		this[i] = this[i + 1];
	}
	this.length--;
	return firstItem;
}


// Copy several elements of an array and return them
function _Array_slice(start, end) {
	var temp;
	
	if (end == null || end == '') end = this.length;
	
	// negative arguments measure from the end of the array
	else if (end < 0) end = this.length + end;
	if (start < 0) start = this.length + start;
	
	// swap limits if they are backwards
	if (end < start) {
		temp  = end;
		end   = start;
		start = temp;
	}
	
	// copy elements from array to a new array and return the new array
	var newArray = new Array();
	for (var i = 0; i < end - start; i++) {
		newArray[i] = this[start + i];
	}
	return newArray;
}


// Splice out and / or replace several elements of an array and return any deleted elements
function _Array_splice(start, deleteCount) {
	if (deleteCount == null || deleteCount == '') deleteCount = this.length - start;
	
	// create a temporary copy of the array
	var tempArray = this.copy();
	
	// Copy new elements into array (over-writing old entries)
	for (var i = start; i < start + arguments.length - 2; i++) {
		this[i] = arguments[i - start + 2];
	}
	
	// Copy old entries after the end of the splice back into array and return
	for (var i = start + arguments.length - 2; i < this.length - deleteCount + arguments.length - 2; i++) {
		this[i] = tempArray[i + deleteCount - arguments.length + 2];
	}
	this.length = this.length - deleteCount + (arguments.length - 2);
	return tempArray.slice(start, start + deleteCount);
}


// Add an element to the beginning of an array
function _Array_unshift(the_item) {
	for (loop = this.length-1 ; loop >= 0; loop--) {
		this[loop+1] = this[loop];
	}
	this[0] = the_item;
	return this.length;
}


// For those browsers that don't define these Array methods, make functions Array instance methods
var agent = navigator.userAgent.toLowerCase(); 
if (Array && !((agent.indexOf('mozilla')!=-1) && (agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera')==-1) && (agent.indexOf('webtv')==-1) && parseInt(navigator.appVersion) > 4)) {
	Array.prototype.pop     = _Array_pop;
	Array.prototype.push    = _Array_push;
	Array.prototype.shift   = _Array_shift;
	Array.prototype.splice  = _Array_splice;
	Array.prototype.unshift = _Array_unshift;
	
	if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) < 4) {
		Array.prototype.concat = _Array_concat;
		Array.prototype.slice  = _Array_slice;
	}
}
Array.prototype.copy = _Array_copy;

///////////////////////////////////////
// is functions
///////////////////////////////////////

		function netscapeResize(theURL) {
			if (isNS4) {
				self.nav.location.reload() 
				self.content.location.href = theURL 
			}
		} 

		// get browser version
		isNS4 = (document.layers) ? true : false;
		isIE4 = (document.all && !document.getElementById) ? true : false;
		isIE5 = (document.all && document.getElementById) ? true : false;
		isNS6 = (!document.all && document.getElementById) ? true : false;
		divCap = (isIE4 || isIE5 || isNS6) ? true : false
		
		// function to get reference to DIV
		function getRef(theDiv) {
			if (isNS4){
			   obj = document.layers[theDiv];
			} else if (isIE4) {
			   obj = document.all[theDiv];
			} else if (isIE5 || isNS6) {
			   obj = document.getElementById(theDiv);
			}
			return obj;
		}
  		
  		// function to hide DIV
  		function hideDiv(theDiv) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				divRef.visibility 		= "hidden";
  			} else if (divCap) {	
  				divRef.style.visibility 	= "hidden";
  			}
  		}
  		
  		// function to show DIV
  		function showDiv(theDiv) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				divRef.visibility 		= "visible";
  			} else if (divCap) {	
  				divRef.style.visibility 	= "visible";
  			}
  		}
  		
  		// function to get top of DIV
  		function getTopDiv(theDiv) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				theTop = divRef.top;
  			} else if (divCap) {
  				theTop = parseInt(divRef.style.top);
  			}
  			return theTop;
  		}
  		
  		// function to set top of DIV
  		function setTopDiv(theDiv, theLoc) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				divRef.top = theLoc;
  			} else if (divCap) {	
  				divRef.style.top = theLoc + "px";
  			}
  		}
  		
  		// function to get left of DIV
  		function getLftDiv(theDiv) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				theLft = divRef.left;
  			} else if (divCap) {	
  				theLft = parseInt(divRef.style.left);
  			}
  			return theLft;
  		}
  		
  		// function to set left of DIV
  		function setLftDiv(theDiv, theLoc) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				divRef.left = theLoc;
  			} else if (divCap) {	
  				divRef.style.left = theLoc + "px";
  			}
  		}
  		
  		// function to set loc of DIV
  		function setLocDiv(theDiv, theTop, theLft) {
  			divRef = getRef(theDiv);
  			if (isNS4) {
  				divRef.top = theTop;
  				divRef.left = theLft;
  			} else if (divCap) {
  				nuX = theTop + "px";
  				divRef.style.top  = parseInt(theTop) + "px";
  				divRef.style.left = parseInt(theLft) + "px";
  			}
  		}