var theImage1;
var yPos1 = 0;
var xPos1 = 0;
var dSign1 = 1;

function domoveImage1()
{
	if ( document.getElementById )
		theImage1 = document.getElementById("moveImage1");
	else if ( document.layers )
		theImage1 = document.layers["moveImage1"];
	else if ( document.all )
		theImage1 = document.all.item("moveImage1");

	if ( theImage1 )
	{
		hideObj1( theImage1 );
		doLeftToRight1();
	}
}


function moveObjTo1( obj1, x1, y1 )
{
	if ( ! obj1.style )
	{
		obj1.top = y1;
		obj1.left = x1;
	}
	else
	{
		obj1.style.top = y1 + "px";
		obj1.style.left = x1 + "px";
	}
}


function showObj1( obj1 )
{
	if ( ! obj1.style )
		obj1.visibility = "visible";
	else
		obj1.style.visibility = "visible";
}

function hideObj1( obj1 )
{
	if ( ! obj1.style )
		obj1.visibility = "hidden";
	else
		obj1.style.visibility = "hidden";
}


function doLeftToRight1()
{
	xPos1 = 500;
	dSign1 = -1;
	moveObjTo1( theImage1, (xPos1 * dSign1), yPos1 );
	showObj1( theImage1 );
	moveHoriz1();
}

function moveHoriz1()
{
	var dec1 = Math.sqrt(xPos1);
	xPos1 -= dec1;
	if ( 0 < xPos1 )
	{
		moveObjTo1( theImage1, (xPos1 * dSign1), yPos1 );
		setTimeout( "moveHoriz1()", 30 );
	}
	else
	{
		moveObjTo1( theImage1, 0, 0 );
	}
}

var theImage2;
var yPos2 = 0;
var xPos2 = 0;
var dSign2 = 1;

function domoveImage2()
{
	if ( document.getElementById )
		theImage2 = document.getElementById("moveImage2");
	else if ( document.layers )
		theImage2 = document.layers["moveImage2"];
	else if ( document.all )
		theImage2 = document.all.item("moveImage2");

	if ( theImage2 )
	{
		hideObj2( theImage2 );
		doLeftToRight2();
	}
}


function moveObjTo2( obj2, x2, y2 )
{
	if ( ! obj2.style )
	{
		obj2.top = y2;
		obj2.left = x2;
	}
	else
	{
		obj2.style.top = y2 + "px";
		obj2.style.left = x2 + "px";
	}
}


function showObj2( obj2 )
{
	if ( ! obj2.style )
		obj2.visibility = "visible";
	else
		obj2.style.visibility = "visible";
}

function hideObj2( obj2 )
{
	if ( ! obj2.style )
		obj2.visibility = "hidden";
	else
		obj2.style.visibility = "hidden";
}


function doLeftToRight2()
{
	xPos2 = 500;
	dSign2 = -1;
	moveObjTo2( theImage2, (xPos2 * dSign2), yPos2 );
	showObj2( theImage2 );
	moveHoriz2();
}

function moveHoriz2()
{
	var dec2 = Math.sqrt(xPos2);
	xPos2 -= dec2;
	if ( 0 < xPos2 )
	{
		moveObjTo2( theImage2, (xPos2 * dSign2), yPos2 );
		setTimeout( "moveHoriz2()", 40 );
	}
	else
	{
		moveObjTo2( theImage2, 0, 0 );
	}
}

var theImage3;
var yPos3 = 0;
var xPos3 = 0;
var dSign3 = 1;

function domoveImage3()
{
	if ( document.getElementById )
		theImage3 = document.getElementById("moveImage3");
	else if ( document.layers )
		theImage3 = document.layers["moveImage3"];
	else if ( document.all )
		theImage3 = document.all.item("moveImage3");

	if ( theImage3 )
	{
		hideObj3( theImage3 );
		doLeftToRight3();
	}
}


function moveObjTo3( obj3, x3, y3 )
{
	if ( ! obj3.style )
	{
		obj3.top = y3;
		obj3.left = x3;
	}
	else
	{
		obj3.style.top = y3 + "px";
		obj3.style.left = x3 + "px";
	}
}


function showObj3( obj3 )
{
	if ( ! obj3.style )
		obj3.visibility = "visible";
	else
		obj3.style.visibility = "visible";
}

function hideObj3( obj3 )
{
	if ( ! obj3.style )
		obj3.visibility = "hidden";
	else
		obj3.style.visibility = "hidden";
}


function doLeftToRight3()
{
	xPos3 = 500;
	dSign3 = -1;
	moveObjTo3( theImage3, (xPos3 * dSign3), yPos3 );
	showObj3( theImage3 );
	moveHoriz3();
}

function moveHoriz3()
{
	var dec3 = Math.sqrt(xPos3);
	xPos3 -= dec3;
	if ( 0 < xPos3 )
	{
		moveObjTo3( theImage3, (xPos3 * dSign3), yPos3 );
		setTimeout( "moveHoriz3()", 50 );
	}
	else
	{
		moveObjTo3( theImage3, 0, 0 );
	}
}
