// JavaScript Document

var imgmcho, timer, timer02;
var dx=6, dy=4, x=0, y=0;
var flag;

function startMove() {
    if (document.getElementById) {
        imgmcho = document.getElementById("mcho");
        timer = setInterval("moveImg()", 50);
    }
}

function moveImg() {
    imgmcho.style.left = x + "px";
    imgmcho.style.top = y + "px";
    x += dx;
    y += dy;
    if (x <= 0 || x >= 770) { dx = -dx; }
    if (y <= 0 || y >= 450) { dy = -dy; }
}

function stopTimer() {
    if (window.clearInterval) { clearInterval(timer); }
}


function stopStart() {
		if (timer02) {
		clearTimeout(timer02);
		}
		if (moveImg) {
		clearInterval(timer);
		}
		
		timer02 = setTimeout("startMove();", 2000);
}

function reImg() {
    imgmcho.style.left = 0 + "px";
    imgmcho.style.top = 0 + "px";
	if (moveImg) {
	clearInterval(timer);
	}
	dx=6, dy=4, x=0, y=0;
}
















  
  
  
