var menuNames = new Array(9);
menuNames[0] = "menu1";
menuNames[1] = "menu2";
menuNames[2] = "menu3";
menuNames[3] = "menu4";
menuNames[4] = "menu5";
menuNames[5] = "menu6";
	
function replaceInnerHTML(elementFrom, elementTo)
{
	var e1 = document.getElementById(elementFrom);
	var e2 = document.getElementById(elementTo);
		e2.innerHTML = e1.innerHTML;
}

function activateMenu(menuSelected)
{
	var x=0;
	var e1 = document.getElementById(menuSelected);
	e1.className = 'over';
	
	for (x=0; x<6; x++)
	{
		if(menuNames[x] != menuSelected)
		{
			e1 = document.getElementById(menuNames[x]);
			e1.className = 'over2';
		}
	}
}

function nav_to(url)
{
	var height;
	height="900px";
	nav_to2(url,height);
}

function nav_to2(url,height)
{

	set_iframe_url("content_frame",url);
	set_iframe_height(height);
}

function set_iframe_height(new_height)
{
	var frm=document.getElementById("content_frame");
	//frm.style.height=new_height ;
}

function set_iframe_url(frame_id,url)
{
	var frm=document.getElementById(frame_id);
	frm.src=url;
}

function nav(navurl)
{
	document.location.href=navurl;
}

function strrep(strIn,strOld, strNew)
{
	strIn=strIn.replace(strOld,strNew);
	return strIn;
}

function size_to_fit()
{
	
	var tRows=document.getElementById('content_table').rows;
	var winHeight=document.body.clientHeight;
	var headHeight=tRows[0].style.height;
	headHeight=strrep(headHeight,'px',' ');
	var footHeight=tRows[2].style.height;
	footHeight=strrep(footHeight,'px','');
	var bodyHeight=winHeight-footHeight-headHeight-5;
	var vDiv=document.getElementById('scroll_pane');
	vDiv.style.height=bodyHeight-45;
}