// JavaScript Document

var folding_div = document.getElementById('main_header_over');
var interval_listener = null;
var height = 0;
var over_count = 0;

function displayContentDetails()
{
	interval_listener = null;
	setTimeout(initExpand, 1000);
}

function initExpand()
{
		folding_div.style.visibility = 'visible';
		folding_div.style.height = '0px';
		intervalAnimation();	
}

function intervalAnimation()
{
	/*if (interval_listener != null)
	{
		interval_listener = null; // Clear previous listeners for animation	
	}*/
	if (folding_div.style.visibility == 'visible')
	{
		interval_listener = setInterval(scrollOpen, 10);	
	}
}

function scrollOpen()
{	
	if (height < 156)
	{
	height += Math.round((160 - height)/10);
	folding_div.style.height = height + "px";
	}
	else
	{
		folding_div.style.height = 160 + "px";
		interval_listener = null;	
		//height = 0;
	}
}