function getViewPortHeight(){ 
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight - 31;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight - 35;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return y;
}

function setFooterPosition(contentId, footerHeight, minHeight){ 
	var height = getViewPortHeight() - footerHeight;
	if (height < minHeight) height = minHeight;
	document.getElementById(contentId).style.height = height + 'px';
}

function setContentHeight(contentId, footerHeight, headerHeight){ 
	var height = getViewPortHeight() - footerHeight - headerHeight;
	//alert(height);
	document.getElementById(contentId).style.height = height + 'px';
}