var xPos1 = 800;
var yPos1 = 500; 
var step1 = 1;
var delay1 = 30; 
var height1 = 0;
var Hoffset1 = 0;
var Woffset1 = 0;
var yon1 = 0;
var xon1 = 0;
var pause1 = true;
var interval1;
img2.style.top = yPos1;
function changePos1() 
{
	width = document.body.clientWidth;
	height = document.body.clientHeight;
	Hoffset1 = img2.offsetHeight;
	Woffset1 = img2.offsetWidth;
	img2.style.left = xPos1 + document.body.scrollLeft;
	img2.style.top = yPos1 + document.body.scrollTop;
	if (yon1) 
		{yPos1 = yPos1 + step1;}
	else 
		{yPos1 = yPos1 - step1;}
	if (yPos1 < 0) 
		{yon1 = 1;yPos1 = 0;}
	if (yPos1 >= (height - Hoffset1)) 
		{yon1 = 0;yPos1 = (height - Hoffset1);}
	if (xon1) 
		{xPos1 = xPos1 + step1;}
	else 
		{xPos1 = xPos1 - step1;}
	if (xPos1 < 0) 
		{xon1 = 1;xPos1 = 0;}
	if (xPos1 >= (width - Woffset1)) 
		{xon1 = 0;xPos1 = (width - Woffset1);   }
	}
	
	function start1()
	 {
	 	img2.visibility = "visible";
		interval1 = setInterval('changePos1()', delay1);
	}
	function pause_resume1() 
	{
		if(pause1) 
		{
			clearInterval(interval);
			pause1 = false;}
		else 
		{
			interval = setInterval('changePos1()',delay1);
			pause1 = true; 
			}
		}
	start1();