var xPos = 300;
var yPos = 200; 
var step = 1;
var delay = 20; 
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;

img1.style.top = yPos;

function changePos()
{
	width = document.body.clientWidth;
	height = document.body.clientHeight;
	Hoffset = img1.offsetHeight;
	Woffset = img1.offsetWidth;
	img1.style.left = xPos + document.body.scrollLeft;
	img1.style.top = yPos + document.body.scrollTop;
	if (yon) 
		{yPos = yPos + step;}
	else 
		{yPos = yPos - step;}
	if (yPos < 0) 
		{yon = 1;yPos = 0;}
	if (yPos >= (height - Hoffset)) 
		{yon = 0;yPos = (height - Hoffset);}
	if (xon) 
		{xPos = xPos + step;}
	else 
		{xPos = xPos - step;}
	if (xPos < 0) 
		{xon = 1;xPos = 0;}
	if (xPos >= (width - Woffset)) 
		{xon = 0;xPos = (width - Woffset);   }
	}
	
	function start()
	 {
	 	img1.visibility = "visible";
		interval = setInterval('changePos()', delay);
	}
	function pause_resume() 
	{
		if(pause) 
		{
			clearInterval(interval);
			pause = false;
			}
		else 
		{
			interval = setInterval('changePos()',delay);
			pause = true; 
			}
		 }
	start();
	
var xPos_2 = 300;
var yPos_2 = 500; 
var step_2 = 1;
var delay_2 = 30; 
var height_2 = 0;
var Hoffset_2 = 0;
var Woffset_2 = 0;
var yon_2 = 0;
var xon_2 = 0;
var pause_2 = true;
var interval_2;

img_2.style.top = yPos_2;

function changePos_2()
{
	width_2 = document.body.clientWidth;
	height_2 = document.body.clientHeight;
	Hoffset_2 = img_2.offsetHeight;
	Woffset_2 = img_2.offsetWidth;
	img_2.style.left = xPos_2 + document.body.scrollLeft;
	img_2.style.top = yPos_2 + document.body.scrollTop;
	if (yon_2) 
		{yPos_2 = yPos_2 + step_2;}
	else 
		{yPos_2 = yPos_2 - step_2;}
	if (yPos_2 < 0) 
		{yon_2 = 1;yPos_2 = 0;}
	if (yPos_2 >= (height_2 - Hoffset_2)) 
		{yon_2 = 0;yPos_2 = (height_2 - Hoffset_2);}
	if (xon_2) 
		{xPos_2 = xPos_2 + step_2;}
	else 
		{xPos_2 = xPos_2 - step_2;}
	if (xPos_2 < 0) 
		{xon_2 = 1;xPos_2 = 0;}
	if (xPos_2 >= (width_2 - Woffset_2)) 
		{xon_2 = 0;xPos_2 = (width_2 - Woffset_2);   }
	}
	
	function start_2()
	 {
	 	img_2.visibility = "visible";
		interval_2 = setInterval('changePos_2()',delay_2);
	}
	function pause_resume_2() 
	{
		if(pause_2) 
		{
			clearInterval(interval_2);
			pause_2 = false;
		}
		else
		{
			interval_2 = setInterval('changePos_2()',delay_2);
			pause_2 = true; 
			}
		}
	start_2();