var ns4 = (document.layers)?true:false;var ie5 = (document.all)?true:false;var interval = 10; //Move 10px every initialization;var x = interval;  //Starting Location - left;var y = interval;  //Starting Location - top;var dest_x = 0;var dest_y = 0;var maxwidth    = 0; // Window Widthvar maxheight   = 0; // Window Heightvar imagewidth  = 0; // Image Widthvar imageheight = 0; // Image Heightvar verDir = 'down';var horDir = 'right';var ufo;function preloadImage($src){	var img = new Image();	img.src=$src;	imagewidth  = img.width;	imageheight = img.height;}function windowSize() {	if( typeof(window.innerWidth) == 'number' ) {		//Non-IE		maxwidth = window.innerWidth;		maxheight = window.innerHeight;	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {		//IE 6+ in 'standards compliant mode'		maxwidth = document.documentElement.clientWidth;		maxheight = document.documentElement.clientHeight;	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {		//IE 4 compatible		maxwidth = document.body.clientWidth;		maxheight = document.body.clientHeight;	}	maxwidth-=imagewidth;	maxheight-=imageheight;}function moveImage(){	// Vertical	y=(verDir == 'down') ? ((y+interval)>dest_y) ? dest_y : (y+interval) : ((y-interval)<interval) ? interval : (y-interval);	ufo.style.top=y+'px';	if ((y==dest_y) && (verDir == 'down')) {		dest_y=0;		verDir='up';		while ((dest_y>parseInt((maxheight/2))) || (dest_y<interval)) { dest_y=(parseInt((Math.random() * maxheight))); }	} else if ((y==interval) && (verDir == 'up')) {		verDir='down';		while (dest_y<parseInt((maxheight/2))) { dest_y=(parseInt((Math.random() * maxheight))); }	}	x=(horDir == 'right') ? ((x+interval)>dest_x) ? dest_x : (x+interval) : ((x-interval)<interval) ? interval : (x-interval);	ufo.style.left=x+'px';	if ((x==dest_x) && (horDir == 'right')) {		dest_x=0;		horDir='left';		while ((dest_x>parseInt((maxwidth/2))) || (dest_x<interval)) { dest_x=(parseInt((Math.random() * maxwidth))); }	} else if ((x==interval) && (horDir == 'left')) {		horDir='right';		while (dest_x<parseInt((maxwidth/2))) { dest_x=(parseInt((Math.random() * maxwidth))); }	}}function moveImageHorizontal(){	x=(horDir == 'right') ? ((x+interval)>dest_x) ? dest_x : (x+interval) : ((x-interval)<interval) ? interval : (x-interval);	ufo.style.left=x+'px';	if ((x==dest_x) && (horDir == 'right')) {		dest_x=0;		horDir='left';		dest_x=interval;	} else if ((x==interval) && (horDir == 'left')) {		horDir='right';		dest_x=maxwidth;	}}function start($id,$src,$opacity,$mode){	ufo=document.getElementById ? document.getElementById($id) :	    document.all ? document.all[$id] : document.layers[$id];	preloadImage($src);	windowSize();	ufo.style.filter='alpha(opacity='+$opacity+');';	setInterval('windowSize()',100);	switch ($mode) {		case 'both':			ufo.style.top=y+'px';			while (dest_y<parseInt((maxheight/2))){ dest_y=(parseInt((Math.random() * maxheight))); }			ufo.style.left=x+'px';			while (dest_x<parseInt((maxwidth/2))) { dest_x=(parseInt((Math.random() * maxwidth))); }			setInterval('moveImage()', 250);			break;		case 'horizontal':			ufo.style.left=x+'px';			dest_x=maxwidth;			setInterval('moveImageHorizontal()', 250);			break;	}}