function walkImage(){
	moveIt();
		
}

function moveIt(){
	if((thisImage.width * -1) + 700 > document.all('thisImage').style.pixelLeft ){
		moveRightInterval = setInterval('goRight()',1);
	}else{
		moveLeftInterval = setInterval('goLeft()',1);			
	}
}
function goLeft(){
	if((thisImage.width * -1) + 700 < document.all('thisImage').style.pixelLeft ){
		document.all('thisImage').style.pixelLeft -= 1;
	}else{
		clearInterval(moveLeftInterval);	
		moveRightInterval = setInterval('goRight()',1);
	}
}

function goRight(){
			//alert(document.all('thisImage').style.pixelLeft);
//alert(thisImage.width * -1);
	if(document.all('thisImage').style.pixelLeft < 0 ){
		document.all('thisImage').style.pixelLeft += 1;
	}else{
		clearInterval(moveRightInterval);
		moveLeftInterval = setInterval('goLeft()',1);
	}
}

function mouseOverFunction(){
	if(typeof(moveLeftInterval) !== 'undefined')
		clearInterval(moveLeftInterval);
	if(typeof(moveRightInterval) !== 'undefined')
		clearInterval(moveRightInterval);
	//document.body.style.cursor = 'move';
}

function mouseOutFunction(){
	walkImage();
}

function manualMove(){
	
}
//======================================================
function mouseMove(ev){
	ev           = ev || window.event;
	var mousePos = mouseCoords(ev);
	//dragInterval = setInterval('drag()',1000);
	document.getElementById('pos').value=ev.clientX;
}

function drag(){
	ev = ev || window.event;
	var mousePos = mouseCoords(ev);
	document.getElementById('pos').value=ev.clientX;

}

function mouseCoords(ev){
	if(ev.pageX || ev.pageY){
		return {x:ev.pageX, y:ev.pageY};
	}
	return {
		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
		y:ev.clientY + document.body.scrollTop  - document.body.clientTop
	};
}


