sliding = false;
function left() {
	/*
		moves the sliding element to the left
	*/
	elm=window[this.id].mkElm();
	x = window[this.id].gX(elm);
	numLength = window[this.id].aNumLength - 1;
	
	this.viewable++;
	if (this.viewable > numLength) {
		this.viewable = numLength;
		
	} else {
		if (x == 0)
			this.pos = x - this.howFar;	
		else
			this.pos = this.pos - this.howFar;
		sliding = true;
		window[this.id].slideExplore(this.pos);
	}	
	this.changeDirectionImage();
}
function right() {
	/*
		moves the sliding element to the right
	*/
	elm=window[this.id].mkElm();
	x = window[this.id].gX(elm);
	
	this.viewable--;
	if (this.viewable < 0) {
		this.viewable = 0;
	} else {
		if (x == 0)
			this.pos = x + this.howFar;	
		else
			this.pos = this.pos + this.howFar;
		sliding = true;
		window[this.id].slideExplore(this.pos);
	}
	this.changeDirectionImage();
}
function slideIt(direction) {
	/*
		initalizing the slide direction
	*/
	if (sliding == false) {
		if (direction == "left")
			this.left();
		else
			this.right();		
	}
}
function changeDirectionImage() {
	/*
		changes the images out for the sliding direction
	*/
	numLength = window[this.id].aNumLength - 1;		
	
	objL = document.getElementById(this.id + 'Left');
	objR = document.getElementById(this.id + 'Right');
	
	objL.innerHTML = '<img src="/media/explore-ca/btn-arrow-off.gif" width="15" height="190" alt="" border="0" />';
	objR.innerHTML = '<img src="/media/explore-ca/btn-arrow-off.gif" width="15" height="190" alt="" border="0" />';
			
	if (this.viewable != numLength)
		objL.innerHTML = '<a href="javascript:' + this.name + '.slideIt(\'left\')" onMouseover="changeImage(\'img' + this.name +  'Left\',\'exLeftOn\')" onMouseout="changeImage(\'img' + this.name +  'Left\', \'exLeftOff\')"><img src="/media/explore-ca/btn-arrow-left.gif" width="15" height="190" alt="" border="0" name="img' + this.name + 'Left" /></a>';
	
	if (this.viewable != 0)
		objR.innerHTML = '<a href="javascript:' + this.name + '.slideIt(\'right\')" onMouseover="changeImage(\'img' + this.name +  'Right\',\'exRightOn\')" onMouseout="changeImage(\'img' + this.name +  'Right\', \'exRightOff\')"><img src="/media/explore-ca/btn-arrow-right.gif" width="15" height="190" alt="" border="0" name="img' + this.name + 'Right" /></a>';
		
	objL.style.backgroundColor="#cccccc";
	
	objL.style.width='15px';
	objR.style.width='15px';
	objL.style.height='190px';
	objR.style.height='190px';
}

function slideOnload() {
	/*
		onload changes the slide direction images if it is not IE Mac 
	*/
	if ((this.browser == "Internet Explorer") && (this.OS == "Mac")) {
		return;
	} else {
			this.changeDirectionImage();
	}
}
function slideObj(id, objName) {
	/*
		the object that initalizes the sliding items
	*/
	this.detect = navigator.userAgent.toLowerCase();
	this.id = id;
	this.name = objName;
	this.viewable = 0;
	this.pos=0;
	this.howFar = 682;
	this.OS = OS;
	this.browser = browser;
	
	this.left = left;
	this.right = right;
	this.slideIt = slideIt;
	this.changeDirectionImage = changeDirectionImage;
	
	this.onload = slideOnload;
}

var detect = navigator.userAgent.toLowerCase();
var OS = "";
var browser = "";
boCheck();
function boCheck() {
	if (this.checkIt('konqueror')) {
		browser = "Konqueror";
		OS = "Linux";
	}
	else if (checkIt('safari')) browser = "Safari"
	else if (checkIt('omniweb')) browser = "OmniWeb"
	else if (checkIt('opera')) browser = "Opera"
	else if (checkIt('webtv')) browser = "WebTV";
	else if (checkIt('icab')) browser = "iCab"
	else if (checkIt('msie')) browser = "Internet Explorer"
	else if (checkIt('firefox')) browser = "Firefox"
	else if (checkIt('netscape')) browser = "Netscape Navigator"
	else if (!checkIt('compatible')) {
		browser = "Netscape Navigator"
	} else 
		browser = "An unknown browser";
	
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string) {
	place = detect.indexOf(string) + 1;
	return place;
}