﻿var table_sDiv="";
var table_inEm = .1;
var table_mClick = 1;
var table_closeInEm = 0;

function toggletableDrawer(divId, buttonId, cBlockId)
{

	table_sDiv = document.getElementById(divId);
	var button = document.getElementById(buttonId);
	var handle = document.getElementById(cBlockId);
			
	
	if(table_mClick==1)
	{
		
		if (table_sDiv.style.height=="auto")
		{
			table_sDiv.style.overflow="hidden";
			table_sDiv.style.height=".1em";
			button.src = "img/drawer_expand_table_btn.gif";
			button.alt = "Open";
			//table_sDiv.title = "Open";
			//table_sDiv.style.cursor = "pointer";
			handle.title = "Open";			
		}
		else
		{
			toggleTableDrawerAnim(divId);
			button.src = "img/drawer_close_table_btn.gif";
			button.alt = "Close";
			//table_sDiv.title = "Close";
			//table_sDiv.style.cursor = "default";
			handle.title = "Close";
		}
	}
}

function toggleTableDrawerAnim(){
	if (table_sDiv.offsetHeight < (table_sDiv.scrollHeight-.1))
	{
		table_sDiv.style.height=(table_inEm + "em")
		table_inEm+=1.4;
		setTimeout("toggleTableDrawerAnim()",".1")
	}
	else
	{
		table_sDiv.style.height="auto";
		table_sDiv.style.overflow="visible"
		table_inEm = .1;
	}
}



