var div_name = 'fl_banner_click';
var div_obj = document.getElementById(div_name);
var is_stop = false;



//////////////////////////////
// ÇÃ·ÎÆÃ¹è³Ê À§Ä¡ ·£´ýÃâ·Â
//////////////////////////////
function rand_point( pnt )
{	
	var rand_tmp = 0; 

	// ÇØ»óµµ¸¦ ÀÐ¾îµéÀÎÈÄ À¥ºê¶ó¿ìÁ®°¡ Â÷ÁöÇÏ´Â ºñÀ²¸¸Å­(´ë·«300)»«´Ù.
	if( pnt=='top') var screen_pnt = screen.height - 400;
	if( pnt=='left') var screen_pnt = screen.width - 10;	
	
	// ·£´ýÃßÃâ	
	rand_tmp = parseInt(Math.random()*1000);
	if( screen_pnt < rand_tmp ) rand_tmp = parseInt(Math.random()*100);	
	
	return rand_tmp;
}


/*
div_obj.style.top = yPos; 
div_obj.style.left = xPos;
*/

//////////////////////////////
// ÇÃ·ÎÆÃ¹è³Ê ½Ç½Ã°£ ¿òÁ÷ÀÌ±â
//////////////////////////////
//var yPos = rand_point('top');
var xPos = rand_point('left');
var yPos = 10;
//var xPos = 10;
var xVel=14;
var yVel=0;
var xAcc=0;
var yAcc=10;
var T=0.1;
var isNetscape = navigator.appName=="Netscape";


function BallClicked(){yVel=-30}  // ÀÌ¹ÌÁö Å¬¸¯½Ã onmousedown="BallClicked();" 

function animate() 
{
	if( is_stop ){ return false; }

    xVel+=xAcc*T; yVel+=yAcc*T;
    xPos+=xVel*T; yPos+=yVel*T;

    if (xPos<15) xVel=Math.abs(xVel);
    if (xPos>315) xVel=-Math.abs(xVel);
    //if (yPos<20) yVel=Math.abs(yVel);
    if ((yVel>0)&&((yPos>90))){ yVel=-0.95*yVel; yPos=180-yPos;}  

    div_obj.style.left=xPos;
    div_obj.style.top=yPos;
  
}

function anistop()
{	
	is_stop = true;
}

function ani_restart()
{	
	is_stop = false;
	animate();
}

div_obj.style.display = "block";

setInterval("animate()", 5);  //½ºÇÇµå ¼³Á¤ ÀÛÀ»¼ö·Ï »¡¶óÁü
