
catwalk_speed = 0;
catwalk_shift_interval = 0;
catwalk_speed_limit = 7;
	
function catwalk_over(event,idTable) {
	//start moving
	catwalk_shift_interval = setInterval("catwalk_shift('"+idTable+"')",10);
}
function catwalk_move(event,idContainer,idLeft,idRight,idTable) {
	//reset speed
	var el = event.srcElement;
	if (!el) {
		//MOZILLA
		el = event.target;
	}
	var offsetCount=0;
	while (el.id != idContainer) {//catwalkcontainer
		offsetCount += el.offsetLeft;
		el = el.parentNode;
	}
	var mouseX = event.offsetX + offsetCount;
	if (typeof event.offsetX == "undefined") {
		if (event.target.id.match(idLeft)) {//catwalkleft
			mouseX = event.layerX;
		} else {
			if (event.target.id.match(idRight)) {//catwalkright
				mouseX = event.layerX;
			} else {
				mouseX = event.layerX + parseInt(document.getElementById(idTable).offsetLeft) + 40 ;//catwalktable
			}
		}
	}
	catwalk_speed = (mouseX - (487/2)) / (487/2) * 10;
	if (catwalk_speed > catwalk_speed_limit) catwalk_speed = catwalk_speed_limit;
}
function catwalk_out() {
	//stop movement
	clearInterval(catwalk_shift_interval);
}
function catwalk_shift(idTable) {
	
	//actually move the catwalk
	var actual_speed = Math.abs(catwalk_speed) - 2;
	if (actual_speed<0) actual_speed=0;
	if (catwalk_speed<0) actual_speed = -1 * actual_speed;
	
	var mytable = document.getElementById(idTable); 
	if(mytable != null)
	{
		if (parseInt(mytable.offsetLeft)>=0 && actual_speed<0) {
			return;
		}
		
		if (parseInt(mytable.offsetLeft)<=(487-mytable.offsetWidth) && actual_speed>0) {
			return;
		}
		
		mytable.style.left = (parseInt(mytable.offsetLeft) - actual_speed) + "px";
	}
}