var xPos1 = 800;
var yPos1 = 300; 
var step = 1;
var delay = 30; 
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img2.style.top = yPos1;
function changePos1() 
{
	width = document.body.clientWidth;
	height = document.body.clientHeight;
	Hoffset = img2.offsetHeight;
	Woffset = img2.offsetWidth;
	img2.style.left = xPos1 + document.body.scrollLeft;
	img2.style.top = yPos1 + document.body.scrollTop;
	if (yon) 
		{yPos1 = yPos1 + step;}
	else 
		{yPos1 = yPos1 - step;}
	if (yPos1 < 0) 
		{yon = 1;yPos1 = 0;}
	if (yPos1 >= (height - Hoffset)) 
		{yon = 0;yPos1 = (height - Hoffset);}
	if (xon) 
		{xPos1 = xPos1 + step;}
	else 
		{xPos1 = xPos1 - step;}
	if (xPos1 < 0) 
		{xon = 1;xPos1 = 0;}
	if (xPos1 >= (width - Woffset)) 
		{xon = 0;xPos1 = (width - Woffset);   }
	}
	
	function start1()
	 {
	 	img2.visibility = "visible";
		interval = setInterval('changePos1()', delay);
	}
	function pause_resume1() 
	{
		if(pause) 
		{
			clearInterval(interval);
			pause = false;}
		else 
		{
			interval = setInterval('changePos1()',delay);
			pause = true; 
			}
		}
	start1();