function getTotalHeight()
{
	if (self.innerHeight) {
		return parseInt(self.innerHeight);
	} else if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientHeight;
	} else if (document.body) {
		return document.body.clientHeight;
	}
}

function getTotalWidth()
{
	if (self.innerWidth) {
		return parseInt(self.innerWidth);
	} else if (document.documentElement && document.documentElement.clientWidth) {
		return document.documentElement.clientWidth;
	} else if (document.body) {
		return document.body.clientWidth;
	}
}

Browser = {};

var agt = navigator.userAgent.toLowerCase();
Browser.isIE =  ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

var resize = function()
{
 
  var occupedHeight = Element.getHeight('top') + Element.getHeight('navigation') + 20; // fixer le 20 selon les marges
	var newMainHeight = getTotalHeight() - occupedHeight;

	var isIE = ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1));
	
	if(getTotalWidth() < 1018 && !isIE){
	newMainHeight-=19;
	}

  $('content').style.height = 'auto';
	$('content').style.overflow = 'auto';
	document.body.style.overflow = 'hidden';
	//document.getElementsByTagName('html')[0].style.overflow = 'hidden';
	
	var contentHeight = Element.getHeight('content');
	
	//alert(contentHeight);
	//alert(newMainHeight);
	
  if(newMainHeight < Element.getHeight('content')) {
		
		$('content').style.height = newMainHeight + 'px';
		$('left').style.height = newMainHeight + 'px';
		//$('content').style.overflow = 'auto';
		//$('content').style.display = 'none';
  } else {
		$('content').style.height = newMainHeight + 'px';
		$('left').style.height = newMainHeight + 'px'
	}

 if(getTotalWidth() < 1018) {
    $('content').style.width = '803px';
		document.body.style.width = '1018px';
		document.body.style.overflow = 'auto';
		//document.getElementsByTagName('html')[0].style.overflow = 'auto';
  } else {
    $('content').style.width = (getTotalWidth() - 215) +'px';
		document.body.style.width = '100%';
  }
	
}



Event.onDOMReady(function() {
	try { resize(); } catch(e) { };
	
});

window.onload = function() {
	resize();
	
	var location = String(document.location);
  var startFragment = location.indexOf('#');
  if (startFragment != -1)
  {
		document.location = location;
  }
	

}

window.onresize = function() {
	resize();
}


function popupcentree(page,largeur,hauteur,options) {

  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);

}