function ICW(div){
	this.slideframe=div;
	this.posi = 1;
	this.mrate = 2;
	this.bgwidth = 441;
	this.move = "";
	this.mouseX = 0;
	this.mouseY = 0;
	this.marX = 0;
	this.marY = 0;
	this.rmp = (this.mouseX-this.marX)-this.posi;
	this.marImage = [
		["110.htm",51,"Ultra 110"],
		["cpu.htm",97,"CPU Mount"],
		["65.htm",142,"Ergovision 65"],
		["elite.htm",207,"Elite Arm"],
		["610.htm",224,"Ergovision 610"],
		["25.htm",252,"Fixed Mount"],
		["gx.htm",302,"Galaxy 250"],
		["t2er.htm",336,"Titan Elite Arm"],
		["t2s.htm",383,"T2 Short w/ Keyboard"],
		["90c.htm",400,"Ultra 90"],
		["t2.htm",441,"T2 Long w/ Keyboard"]];
	document.getElementById(this.slideframe).that=this;
}

ICW.prototype.changeBackgroundPosition = function (){
	var slidefrme=document.getElementById(this.slideframe);
	slidefrme.style.backgroundPosition=this.posi+"px 0px";
	this.rmp = (this.mouseX-this.marX)-this.posi;
	if (this.posi>=(this.bgwidth-this.mrate)){
		this.posi=1;
	}else{this.posi=this.posi+this.mrate}
	if (this.rmp<0)this.rmp=this.rmp+this.bgwidth;
}

ICW.prototype.updateStatus = function(){
	var m = this.marImage;
	for (var i=0;i < m.length;i++){
		var l = m[i][2];
		var s = m[i][1];
		var b = i-1;
		var t;
		b >= 0?t = m[b][1]:t = 0;
		if (this.rmp < s && this.rmp > t){
			window.status=l;
		}
	}
}

ICW.prototype.startSlider = function(mil){
	this.changeBackgroundPosition();
	clearInterval(this.move);
	this.move=setInterval("document.getElementById(\""+this.slideframe+"\").that.changeBackgroundPosition()",mil);
}

ICW.prototype.stopSlider = function(){
	clearInterval(this.move);
}

ICW.prototype.mouseMove_IE = function(){
	this.mouseY=document.body.scrollTop+event.clientY+1;
	if(event.clientX<document.body.clientWidth-2)
		this.mouseX=document.body.scrollLeft+event.clientX+1;
	else
		this.mouseX=document.body.clientWidth-2;
}

ICW.prototype.mouseMove_NS6 = function(e){ 
	this.mouseX=e.pageX+1; 
	this.mouseY=e.pageY+1; 
} 

ICW.prototype.trackMouse = function(){
	var me=this;
	if(document.all){
		document.onmousemove=function() {me.mouseMove_IE();}
	} else if(document.getElementById){
		document.addEventListener("mousemove", function(e) {me.mouseMove_NS6(e);}, true);
	}
}

ICW.prototype.findPos = function(eli){
	obj=document.getElementById(eli);
	if (obj.offsetParent){
		this.marX = obj.offsetLeft;
		this.marY = obj.offsetTop;
		while (obj = obj.offsetParent){
			this.marX += obj.offsetLeft;
			this.marY += obj.offsetTop;
		}
	}
	return [this.marX,this.marY];
}

ICW.prototype.getLink = function(){
	var m = this.marImage;
	for (var i=0;i < m.length;i++){
		var l = m[i][0];
		var s = m[i][1];
		var b = i-1;
		var t;
		b >= 0?t = m[b][1]:t = 0;
		if (this.rmp < s && this.rmp > t){
			document.location.href=l;
		}
	}
}

var Slider;  

function slideInit(){
	Slider = new ICW("header-center");
	Slider.trackMouse();
	Slider.startSlider('50');
}
function slideStart(){
	Slider.startSlider('50');
}
function slideStop(){
	Slider.stopSlider();
}
function findPosition(){
	Slider.findPos('marframe');
} 
function getClickedLink(){
	Slider.getLink();
}

document.onload=slideInit();