

function GetDocumentHeight()
{
	var height = self.innerHeight;
    var mode = document.compatMode;
    
	// Detecting browser
	var ua = navigator.userAgent.toLowerCase(), 
		isOpera = (ua.indexOf('opera') > -1),
		isIE = (!isOpera && ua.indexOf('msie') > -1);
		
	
    if ( (mode || isIE) && !isOpera ) { 
       height = (mode == 'CSS1Compat') ?
               document.documentElement.clientHeight : // Standarts
               document.body.clientHeight; // Quirks
    }
	
	var scrollHeight = (document.compatMode != 'CSS1Compat') ? document.body.scrollHeight : document.documentElement.scrollHeight;
	
	
	//alert(height);
    var h = Math.max(scrollHeight, height);
	
	h = height;
	
	return h;
}

function ResizeLayer(height)
{
	
	var contentLayerName = 'content';
	
	if(!height) {
		height = 0;
	}
	/*	
	if( window.innerHeight != undefined)
	{
		var windowHeight = window.innerHeight;
	}
	else
	{
		var windowHeight = (document.documentElement.clientHeight != undefined) ? document.documentElement.clientHeight :  document.body.clientHeight;
	}*/
	var windowHeight = GetDocumentHeight();
	
	var obj_content;
	if( obj_content = getLayerRef(contentLayerName) ) {
		var newHeight = (windowHeight-310 > 0) ? windowHeight - 250 - parseInt(height) : 310;
		
		obj_content.style.height = newHeight + "px";
	}
}


window.onresize = function () { 
	ResizeLayer(0);
}
window.onload = function () { 
	ResizeLayer(0);
}