function detectNav()
{
var agt=navigator.userAgent.toLowerCase();
var ns4=document.layers;

	if(document.all){
		if(agt.indexOf('opera')>-1) var opera=true;else var ie=true; 
		}
	else if(document.getElementById){
		if(agt.indexOf('netscape')>-1) var ns6=true;else
		if(agt.indexOf('firefox')>-1) var ffx=true;else var moz=true; 
		}
if(ie){
return "ie";
}			
else if(ns4){
return "ns4";
}else if(opera){
return "opera";
}else if(ns6){ 
return "ns6";
}else if(ffx){ 
return "ffx";
}else if(moz){
return "moz";
}else{
return "other";
}
}
function scollY()
{
Nav=detectNav();	

if(Nav==ie){

}			
else if(Nav==ns4){
sy = (navigator.appName.substring(0,3) == "Net") ? e.pageY : document.body.scrollTop;
}else if(Nav==opera){
sy = (navigator.appName.substring(0,3) == "Net") ? e.pageY : document.body.scrollTop;
}else if(Nav==ns6){ 
sy = (navigator.appName.substring(0,3) == "Net") ? e.pageY : document.body.scrollTop;
}else if(Nav==ffx){ 
sy = (navigator.appName.substring(0,3) == "Net") ? e.pageY : document.body.scrollTop;
}else if(Nav==moz){
sy = (navigator.appName.substring(0,3) == "Net") ? e.pageY : document.body.scrollTop;
}else{
	
}
return sy;
}
function GetBodyWidth() {
  var BodyWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    BodyWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    BodyWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    BodyWidth = document.body.clientWidth;
  }
  return BodyWidth;
}
// cacule la hauteur de la fenetre
function GetBodyHeight() {
  var BodyHeight = 0, BodyHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    BodyWidth = window.innerWidth;
    BodyHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    BodyWidth = document.documentElement.clientWidth;
    BodyHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    BodyWidth = document.body.clientWidth;
    BodyHeight = document.body.clientHeight;
  }
  return BodyHeight;
}
// Positionne le conteneur au millieu
function adaptCont()
{
BodyHeight=GetBodyHeight();
ContHeight2=document.getElementById("contenu").offsetHeight;
ContHeight=BodyHeight-155;
if(ContHeight>ContHeight2) {
document.getElementById("contenu").style.height=(ContHeight+30)+'px';
adaptContext(ContHeight);
adaptH_R(0);
}
else {
Nav=detectNav();
if(Nav=="ns4"){
adaptH_R(15);
}else if(Nav=="opera"){
adaptH_R(0);
}else if(Nav=="ns6"){ 
adaptH_R(15);
}else if(Nav=="ffx"){ 
adaptH_R(19);
}else if(Nav=="moz"){
adaptH_R(0);
}else{
adaptH_R(0);	
}	
}
}
function adaptContext(ContHeight)
{
document.getElementById("text").style.height=ContHeight+'px';
}
function adaptH_R(scr)
{
BodyWidth=GetBodyWidth();
h_rWidth=(BodyWidth-604)-scr;
document.getElementById("h_r").style.width=h_rWidth+'px';
}
addToStart(adaptCont);
window.onresize = function() {
adaptCont();
}