var vOnloadFunction = "onLoad()";
var vResizeCnt = 0;

function nav_to(url)
{
	vOnloadFunction = "-";
	var height;
	height="900px";
	nav_to2(url,height);
	setTimeout("delayedResize()",500);
	vResizeCnt = 0;
}



function nav_to3(url,function_name)
{
	vOnloadFunction = function_name;
	var height;
	height="900px";
	nav_to2(url,height);
}

function nav_to2(url,height)
{

	if(url.substring(7,0) == 'http://')
		window.open(url,'blank');
	else
	{
		loadXMLDoc(url,loadPageByAjax); //	set_iframe_url("content_frame",url);
	}

}


function set_iframe_url(frame_id,url)
{
	var frm=document.getElementById(frame_id);
	frm.src=url;
}

function loadPageByAjax(xmlResult)
{
	//var vContentDiv = document.getElementById("content_frame");
	var vContentDiv = document.getElementById("content");
	vContentDiv.innerHTML = xmlResult;
	//vContentDiv.style.top="0px";
	//setTimeout("autoResize('content_frame',1,-3)",500);
	//setTimeout("autoResize('content_frame',1,-3)",1000);
	//setTimeout("autoResize('content_frame',1,-3)",1500);
	if(vOnloadFunction != "-")
		setTimeout(vOnloadFunction,500);

}

function delayedResize()
{
	autoResizeContent();
	vResizeCnt = vResizeCnt + 1;
	if(vResizeCnt < 5)
		setTimeout("delayedResize()",500);
	
}

function swapBG(id,direction)
{
	var vUrl = "URL(images/" + id + direction + ".jpg)";

	var vObj = document.getElementById(id);
	vObj.style.backgroundImage = vUrl;
}
