/***********************************************************************************
*	(c) pffactory 2007 version 1.0.0 14 April 2001	          *
*	For info write to pau.fores@gmail.com		          *
*	You may remove all comments for faster loading	          *		
***********************************************************************************/

	var xPos = 10;					// Submarine x-Position
	var yPos = 10;					// Submarine y-Position
	var dir  = 0;					// 0: left to right, 1: right to left
	var windowWidth=screen.width-20;		// Window end point for image movement
	//var windowHeight=screen.height - 200;


document.onmousemove = mouseMove;
//document.onmousemove = animaSubmari;

function mouseMove(ev){
        eld=document.getElementById("desti");
	ev           = ev || window.event;
	var mousePos = mouseCoords(ev);
	var imagePos = document.getElementById("submarim").style.left;
	var imageLen = document.getElementById("submarim").width;

	imagePos = imagePos.substr(0, imagePos.length-2);
	//eld.innerHTML='2#'+imagePos+'#'+mousePos.x+'#'+mousePos.y+'#'+imageLen+'#'+document.getElementById("submarim").src+'#';
	
}

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
	};
}

  
  function animaSubmari() {
  	var i;
  }
  function animaSubmari() {
  	var dobj=document.getElementById("submarim");
	if (dir==0) {
		if (xPos < windowWidth-dobj.width) {
			xPos = xPos + 1;
    			dobj.style.left = xPos;
		}
		else {
			dobj.src = 'img/sml.gif';
			dir = 1;
		}
	}
	else {
		if (xPos > 1) {
			xPos = xPos - 1;
    			dobj.style.left = xPos;
		}
		else {
			dobj.src = 'img/smr.gif';
			dir = 0;
		}
	}
    setTimeout("animaSubmari()", 50);
  }