var move=32;
var y=0;
var counter = 0;
//alert("wtf");
//t=setTimeout("moveContent", 32);

window.onload=function(){
	ran();
	}
function test(){
	alert("test");
	elem = document.getElementById("flying_box");
	elem.style.top = "50px";

	}
function ran(){
	x = Math.random();
	x *= 100;
	x = parseInt(x);
	if (x >= 50 && x <= 65){
	moveContent();
	}
	}
function moveContent(){
	//move=50;
	var a=20, t=0.05;
	var flb = document.getElementById("flying_box");
	move=move-a*t;
	y = y + move;
	//x = x + move;
	flb.style.top = y+"px";
	//flb.style.left = x+"px";
	t=setTimeout("moveContent()", 42);
		if (y >= 308){
			clearTimeout(t);
			}
		//y=y+"px";
		
	//yPos = cont.style.top;
	//alert (yPos);
	counter = 1;
	}

function close_box(){
	flb = document.getElementById("flying_box");
	flb.style.visibility = "hidden";
	}