var initH = 0;

function setContentHeight()
{
	var content = document.getElementById('content');
	var nav = document.getElementById('nav');
	var browser = detectMobile();
	
	if( browser == 'iPhone'  ||  browser == 'not mobile'  ||  browser == 's600' )
	{
		if( content != null ) content.style.height = '1000px';
	}
	//if( browser == 'android' ) content.style.height = getWindowHeight() - nav.offsetHeight + 'px';
	
	if( browser != 'android'  &&  browser != 'iPhone'  &&  browser != 'not mobile'  &&  browser != 's600' )
	{
		document.getElementById("navul").style.visibility = 'hidden';
	}
	
	if( nav != null )
	{
		if( getWindowHeight() > 300 + nav.offsetHeight )	document.documentElement.style.overflowY = "hidden";
		else												document.documentElement.style.overflowY = "visible";
	}
}


function loaded() 
{
	if( detectMobile() == 'iPhone' ) alert('iPhone users scroll content using 2 fingers.');
	
	document.body.style.overflow = 'visible';
	
	if( document.getElementById('content') != null ) 
		initH = document.getElementById('content').offsetHeight;
		
	setContentHeight();
}


function getInitH()
{
	return initH;
}


function getWindowHeight()
{
	var winH;
	
	if (navigator.appName.indexOf("Microsoft")!=-1) 
	{
		winH = document.documentElement.clientHeight;
	}
	else
	{
		winH = window.innerHeight - 5;
	}
	
	return winH;
}

