function hidediv(whichDiv)
{ 
	if (document.getElementById) // DOM3 = IE5, NS6
	{ 
		document.getElementById(whichDiv).style.visibility = 'hidden'; 
	}
	else
	{ 
		if (document.layers) // Netscape 4
		{ 
			document.hideshow.visibility = 'hidden'; 
		} 
		else // IE 4
		{
			document.all.hideshow.style.visibility = 'hidden'; 
		} 
	}
}

function showdiv(whichDiv)
{ 
	if (document.getElementById) // DOM3 = IE5, NS6
	{
		document.getElementById(whichDiv).style.visibility = 'visible'; 
	} 
	else
	{
		if (document.layers) // Netscape 4 
		{
			document.hideshow.visibility = 'visible'; 
		} 
		else // IE 4
		{ 
			document.all.hideshow.style.visibility = 'visible'; 
		} 
	} 
}


function isIEAgent()
{
	if(navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Opera") == -1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isOpera()
{
	if(navigator.userAgent.indexOf("Opera") != -1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function fitDivHeightToContent(id,extra)
{
	var x = 10;

	while(x > 0)
	{
		if(isOpera())
		{
			parent.document.getElementById("main_frame").style.height=""+(this.document.body.scrollHeight+0)+"px";
			parent.document.getElementById(id).style.height=""+(this.document.body.scrollHeight+0)+"px";
		}
		if(isIEAgent())
		{
			parent.document.getElementById(id).style.height=""+(this.document.body.scrollHeight+0)+"px";
		}
		else
		{
			parent.document.getElementById(id).style.height=""+(this.document.body.offsetHeight+10)+"px";
		}
		/*
		if(!window.opera && !document.mimeType && document.all && document.getElementById)
		{
			var extra2 = 35;
			if(isIEAgent())
			{
				//parent.document.getElementById(id).style.scroLLheight=0+"px";
				parent.document.getElementById(id).style.height=this.document.body.offsetHeight+10+"px";
			}
			else
			{
				//parent.document.getElementById(id).style.scroLLheight=0+"px";
				parent.document.getElementById(id).style.height=(this.document.body.offsetHeight+extra2)+"px";
			}	
		}
		else if(document.getElementById)
		{
			//(this.document.body.scrollHeight+extra)
			var extra2 = 35;
			if(isIEAgent())
			{
				//parent.document.getElementById(id).style.scrollHeight=0+"px";
				parent.document.getElementById(id).style.height=""+(this.document.body.scrollHeight-5)+"px";	
			}
			else
			{
				//parent.document.getElementById(id).style.scrollHeight=0+"px";
				parent.document.getElementById(id).style.height=""+(this.document.body.scrollHeight+extra2-17)+"px";
			}
		}
		*/
		--x;
	}
	parent.window.scrollTo(0,0)
}

function resizeFrame()
{
	fitDivHeightToContent("main_div",0);
}