/*
Flying Image Script-
By Dylan Coldblatt (codeboy14@yahoo.com)
Submitted to Dynamicdrive.com for featuring in it's archive
*/

	var yend;
	var ystart;
	var ydiff;
	var xincrement;
	var yincrement;
	var screenwidth;
	var screenheight;

function Ypick(){

   if (!document.all)
   return
	screenwidth = screensize.offsetWidth;
	screenheight = screensize.offsetHeight;
	xincrement = (screenwidth/10);
	ystart = Math.round(Math.random()*(screenheight-91));
	yend = Math.round(Math.random()*(screenheight-91));
	document.all.ball.style.top=ystart;
	document.all.ball.style.left=-100;
	if (ystart > yend){
		ydiff = (ystart-yend);
		yincrement = (ydiff/xincrement);
		Moveneg();
	}
	else {
		ydiff = (yend-ystart);
		yincrement = (ydiff/xincrement);
		Movepos();
	}
}
function Moveneg(){
	if (screenwidth > parseInt(document.all.ball.style.left)) {
        with (document.all.ball) {
		style.left = parseInt(style.pixelLeft + 4);
		style.top = parseInt(style.pixelTop - yincrement);
		}
        setTimeout('Moveneg()',30);
    }
	else {
		with (document.all.ball) {
		style.left = parseInt(style.pixelLeft - screenwidth);
		style.top = parseInt(style.pixelTop - yend);
		}
		Ypick();
	}
}
function Movepos(){
	if (screenwidth > parseInt(document.all.ball.style.left)) {
        with (document.all.ball) {
		style.left = parseInt(style.pixelLeft + 4);
		style.top = parseInt(style.pixelTop + yincrement);
		}
        setTimeout('Movepos()',30);
    }
	else {
		with (document.all.ball) {
		style.left = parseInt(style.pixelLeft - screenwidth);
		style.top = parseInt(style.pixelTop - yend);
		}
		Ypick();
	}
}