// JavaScript Document
function event_handler()
{
	if(anim_event=='animate')
		show_div();
	else if(anim_event=='end_animate')
		hide_div();
}

function show_div()
{
	divObj = document.getElementById('drop_div');
	dv = divObj;
	divObj.style.display = 'block';
	setTimeout("animate()",1);
}
function animate()
{
	timectr++;
	dv.style.width = divWidth+'px';
	height = (divHeight/animationLength)*timectr;
	if(height <= divHeight)
	{
		dv.style.height = ((divHeight/animationLength)*timectr)+'px';
		setTimeout("animate()",1);
	}
	else
	{
		timectr = 1;
		anim_event = 'end_animate';
	}
}
function hide_div()
{
	divObj = document.getElementById('drop_div');
	dv = divObj;
	setTimeout("end_animate()",1);
}
function end_animate()
{
	timectr2--;
	if(timectr2>=0)
	{
		dv.style.width = divWidth+'px';
		dv.style.height = ((divHeight/animationLength)*timectr2)+'px';
		setTimeout("end_animate()",1);
	}
	else
	{
		dv.style.display = 'none';
		timectr2 = animationLength-1;
		timectr=1;
		anim_event = 'animate';
	}
}
function check_flag()
{
	if(onFlag==0)
		hide_div();
}
function set_flag(val)
{
	onFlag=val;
}