var lastHeight = null;

function getHeight (elm, hashName)
{	
	var h = location.hash.toLowerCase().indexOf(hashName) > -1;
	var iframeheight = null;
	var newHeight = location.hash.split('=')[1];
	if (h && lastHeight != newHeight)
	{
		$(elm).css('height', newHeight+'px');
		//window.clearInterval(inter);
		lastHeight = newHeight;
		if(!$.browser.msie)
			history.go(-1);
	}
}

$(document).ready (
	function ()
	{
		var iFrameLink = $('#externalFace').attr('src');
		
		if(iFrameLink.indexOf('?') > -1)
			$('#externalFace').attr('src', iFrameLink+'&iframeTopLocation=' + escape(document.location.href));
		else
			$('#externalFace').attr('src', iFrameLink+'?iframeTopLocation=' + escape(document.location.href));
		
		inter = setInterval("getHeight('#externalFace', 'iframeheight')", 200);
		
		
		
		
		//Detect if leftNavigation is avaible
		var leftMenu = $('#sideBarLeft').size();
		
		if(leftMenu == 0)
		{
			$('#contentArea').css('width', '100%');
			$('#mainContent').css('width', '100%');
			$('.textBlock').css('width', '700px');
			$('#IframeNormal').css('width', '100%');
			$('#IframeNormal iframe').css('width', '100%');
		}
	}
);
