var headerLoaded, contentLoaderInt, theContentHeight, theAdjustmentInt, theCurrentContent

theCurrentContent = 'homepage.asp'

function headerIsLoaded()
{
	headerLoaded = true 
}

function adjustTheIFrame(theDirection)
{
	if(document.all.theIFrame.height >= theContentHeight)
	{
		clearInterval(theAdjustmentInt)
		document.all.theIFrame.height = theContentHeight
	}else if (document.all.theIFrame.height >= 800){
		clearInterval(theAdjustmentInt)
		document.all.theIFrame.height = theContentHeight
	}else{
		document.all.theIFrame.height = Number(document.all.theIFrame.height)+theDirection
	}
}

function displayContent()
{
	if(headerLoaded)
	{
		clearInterval(contentLoaderInt)
		loaderTD.style.display = 'none'
		var theIFrameHeight = document.all.theIFrame.height
		iframeTR.style.display = ''
		if(theIFrameHeight < theContentHeight)
		{
			clearInterval(theAdjustmentInt)
			theAdjustmentInt = setInterval('adjustTheIFrame(5)',10)
		}
	}
}	

function theContentIsReady(theHeight)
{
	theContentHeight = theHeight
	contentLoaderInt = setInterval('displayContent(5)',1000)
}

function loadNewContent (theLink)
{
		if(theCurrentContent != theLink)
		{
			theCurrentContent = theLink
			iframeTR.style.display = 'none'
			loaderTD.style.display = ''
			document.all.theIFrame.src = 'WS/'+theLink
			document.all.theIFrame.height = 300
		}			
}