ecran_x=760
ecran_y=500
function TailleEcran(){
//alert('héhéhhééh');
	if (bw.ns5 + bw.ns4 >0 ) 
	 {	ecran_x=window.innerWidth;ecran_y=window.innerHeight;}
	else
	 {ecran_y=document.body.clientHeight;;ecran_x=document.body.clientWidth;}
} 
////////////////////////////////////////////////////////////////////////////////////
// CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////

// Main background color (the large area)
// Usually a bright color (white, yellow etc)
  if (typeof fcolor == 'undefined') { var fcolor = "#ffffff";}
  
// Border color and color of caption
// Usually a dark color (black, brown etc)
  if (typeof backcolor == 'undefined') { var backcolor = "#5773BD";}

// Text color
// Usually a dark color
  if (typeof textcolor == 'undefined') { var textcolor = "#111111";}
  
    if (typeof texttitrecolor == 'undefined') { var texttitrecolor = "#ffffff";}
// Color of the caption text
// Usually a bright color
  if (typeof capcolor == 'undefined') { var capcolor = "#5773BD";}
  
// Color of "Close" when using Sticky
// Usually a semi-bright color
  if (typeof closecolor == 'undefined') { var closecolor = "#FFffff";}

// Width of the popups in pixels
// 100-300 pixels is typical
  if (typeof width == 'undefined') { var width = "100";}
  
// How thick the border should be in pixels
// 1-3 pixels is typical
  if (typeof border == 'undefined') { var border = "0";}

// How many pixels to the right/left of the cursor to show the popup
// Values between 3 and 12 are best
  if (typeof offsetx == 'undefined') { var offsetx = 30;}
  
// How many pixels to the below the cursor to show the popup
// Values between 3 and 12 are best
  if (typeof offsety == 'undefined') { var offsety = 0;}
  
  // taille et style de lécriture
    if (typeof ecriture == 'undefined') { var ecriture = "<FONT face='Arial' size='2'>";}
  
////////////////////////////////////////////////////////////////////////////////////
// END CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////

//Default browsercheck, added to all scripts!
function checkBrowser(){
    //alert(window.)
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()

//Object constructor
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	//this.newsScroll=newsScroll;
	this.moveIt=b_moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
function b_moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var tr = 1;
var isFramed = 1;
var ns6; 
var over0;
//var over;
var overinit=0; 
function onloaddiv(){
    if (!ns4 && !ie4) ns6 = (document.body.innerHTML)? true:false;
    else ns6=false; 
    if ( (ns4) || (ie4) || (ns6) ) {
        if(document.getElementById) over=document.getElementById('overDiv').style;
        else {    
            if (ns6) {   over0 = new makeObj('overDiv') ;over=over0.css ;}
            if (ns4 && (!ns6) )  { over=document.overDiv   }
            if (ie4 && (!ns6))  over = overDiv.style  
        }
        
        document.onmousemove = mouseMove 
        if (ns4||ns6) document.captureEvents(Event.MOUSEMOVE)
        if (ns6){ ns4=true;}
    }  
    overinit=1;
}
//onloaddiv();
var bDisp = 0;

// Public functions to be used on pages.

// Simple popup right
function drs(text) {
  dts(1,text);
}

// Caption popup right
function drc(title1,title2,title3,text1,text2,text3,text4,text5,text6) {
  dtc(1,title1,title2,title3,text1,text2,text3,text4,text5,text6);
}

// Sticky caption right
function src(text,title) {
  stc(1,text,title);
}

// Simple popup left
function dls(text) {
  dts(0,text);
}

// Caption popup left
function dlc(text, title) {
  dtc(0,text,title);
}

// Sticky caption left
function slc(text,title) {
  stc(0,text,title);
}

// Simple popup center
function dcs(text) {
  dts(2,text);
}

// Caption popup center
function dcc(text, title) {
  dtc(2,text,title);
}

// Sticky caption center
function scc(text,title) {
  stc(2,text,title);
}

// Clears popups if appropriate
function nd() {
  if ( cnt >= 1 ) { sw = 0 };
  if ( (ns4) || (ie4) ) {
    if ( sw == 0 ) {
      snow = 0;
      hideObject(over);
	  bDisp = 0;
    } else {
      cnt++;
    }
  }
}

// Non public functions. These are called by other functions etc.

// Simple popup
function dts(d,text) {
  txt = "<TABLE WIDTH="+width+" BORDER=1 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=3 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
  layerWrite(txt);
  dir = d;
  disp();
}

// Caption popup
function dtc(d,title1,title2,title3,text1,text2,text3,text4,text5,text6) {
		var txt = "<table border='0' cellspacing='0' cellpadding='0' width='400'>" +
			"<tr><td bgcolor=#000000 width=1 colspan=3><img src='../shim.gif'width='1'height='1'></td></tr>" +
			"<tr>" +
			"<td bgcolor=#000000 width=1><img src='../shim.gif'width='1'height='1'></td><td>" +
			"<table cellspacing=0 cellpadding=0 border=0 width='100%'>" +
			"<tr>" +
			//"<td valign=middle bgcolor="+backcolor+"><center><b><FONT COLOR="+texttitrecolor+">"+ecriture+ title1 + "</font></font></b></center></td>" +
			//"<td valign=middle bgcolor="+backcolor+"><center><b><FONT COLOR="+texttitrecolor+">"+ecriture+ title2 + "</font></font></b></center></td>" +
			"<td valign=middle bgcolor="+backcolor+"><FONT COLOR="+texttitrecolor+"> "+ecriture+ title3 +//+" ha travaillés" +
			"</font></font></td>" +
			"</tr>" +
			"</table>" +
			"</td>" +
			"<td bgcolor=#000000 width=1><img src='../shim.gif'width='1'height='1'></td></tr>" +
			"<tr><td bgcolor=#000000 width=1 colspan=3><img src='../shim.gif'width='1'height='1'></td></tr>" +
			"<tr><td bgcolor=#000000 width=1><img src='../shim.gif'width='1'height='1'></td><td bgcolor="+ fcolor+ ">"; 
			if (text1.length > 3)
			{
			txt=txt + "<table cellspacing=0 cellpadding=0 border=0 width='100%'>" +
			"<tr>" +
			"<td bgcolor="+ fcolor+ "><b>"+ecriture+ "Intrants</font></b></td>" +
			"<td bgcolor="+ fcolor+ "><b>"+ecriture + "Dose</font></b></td>";
			if (text3!='' && text4!='' && text5!='' && text6!='')
			{
			txt=txt + "<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture +  "N</font></b></td>" +			
			"<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture + "P</font></b></td>" +			
			"<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture +"K</font></b></td>" +
			"<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture + "Mg</font></b></td>";
			}
			else
			{	
			txt=txt + "<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture +  "&nbsp;</font></b></td>" +			
			"<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture + "&nbsp;</font></b></td>" +			
			"<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture +"&nbsp;</font></b></td>" +
			"<td bgcolor="+ fcolor+ " ALIGN='right'><b>"+ecriture + "&nbsp;</font></b></td>";
			}
			txt=txt + "</tr>" +	
			"<tr>" +
			"<td bgcolor=#99CCFF width=1 colspan='6'><img src='../shim.gif'width='1'height='1'></td></tr>" +				
			"<tr>" +
			"<td bgcolor="+ fcolor+ ">"+ecriture+ text1 + "</font></td>" +
			"<td bgcolor="+ fcolor+ ">"+ecriture + text2 + "</font></td>"+
			"<td bgcolor="+ fcolor+ " ALIGN='right'>"+ecriture + text3 + "</font></td>" +			
			"<td bgcolor="+ fcolor+ " ALIGN='right'>"+ecriture + text4 + "</font></td>" +			
			"<td bgcolor="+ fcolor+ " ALIGN='right'>"+ecriture +text5 + "</font></td>" +
			"<td bgcolor="+ fcolor+ " ALIGN='right'>"+ecriture +text6 + "</font></td>"; 
			}
			txt=txt + "</tr>" +
			"</table>"+
			"</td>" +
			"<td bgcolor=#000000 width=1><img src='../shim.gif'width='1'height='1'></td></tr>" +
			"<tr><td bgcolor=#000000 colspan=3><img src='../shim.gif'width='1'height='1'></td></tr>"+
			"</table>";
	
	layerWrite(txt);
	dir = d;
	disp();
}

// Sticky
function stc(d,text, title) {
  sw = 1;
  cnt = 0;
  txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
  layerWrite(txt);
  dir = d;
  disp();
  snow = 0;
}

// Common calls
function disp() {
if (overinit==0){onloaddiv();}
	if (snow == 0) {
		if (isFramed) {
			if (dir == 2) moveTo(over,x+offsetx-(width/2),y+offsety); // Center
			if (dir == 1) { // Right
				if (x<400) moveTo(over,x+offsetx,y+offsety);
	    		if (x>400) moveTo(over,x-width,y+offsety);
			}
			if (dir == 0) moveTo(over,x-offsetx-width,y+offsety); // Left
		}
		else moveTo(over,x+offsetx-(width/2),y+offsety);
		
		snow = 1;
		showObject(over);
		bDisp = 1;
	}
}

// Moves the layer
function mouseMove(e) {
	if (ns4) {x=e.pageX; y=e.pageY}
	if (ie4) {	
	    try { 
				    x=event.clientX+document.body.scrollLeft;
				    var yscrollTop=0;
				    if (document.documentElement && document.documentElement.scrollTop)  yscrollTop = document.documentElement.scrollTop
            else if (document.body && document.body.scrollTop && (yscrollTop==0)) yscrollTop = document.body.scrollTop;
				     y=event.clientY+yscrollTop;
     	      if (snow && !bDisp) {
     	      	if (isFramed) {
     	      		if (x>=450 && x<=550) moveTo(over,x+offsetx-(width/2),y+offsety); // Center
     	      		if (x<400) moveTo(over,x+offsetx,y+offsety); // Right
     	      		if (x>400)  moveTo(over,x-width,y+offsety); // Left
     	      	}
     	      	else moveTo(over,x+offsetx-(width/2),y+offsety);
     	      } 
     	      }
  catch(e) {//alert('catch');					 };
			};
 
  	      }
}

// The Close onMouseOver function for Sticky
function cClick() {
  hideObject(over);
  sw=0;
}

// Writes to a layer
function layerWrite(txt) {
    if(document.getElementById) document.getElementById('overDiv').innerHTML = txt;
    else if (ns4 && (!ns6)) {
            var lyr = document.overDiv.document
            lyr.write(txt)
            lyr.close()
    }
    else if (ie4 || (!ns6)) document.all["overDiv"].innerHTML = txt
    else if (ns6)  over0.el.innerHTML=txt  ;
    if (tr) { trk(); }
}

// Make an object visible
function showObject(obj) {
        if (ns6) obj.visibility = "visible"
        else if (ns4) obj.visibility = "show"
        else if (ie4) obj.visibility = "visible"
}

// Hides an object
function hideObject(obj) {
        if (ns6) obj.visibility = "hidden"
        else if (ns4) obj.visibility = "hide"
        else if (ie4) obj.visibility = "hidden"
}

// Move a layer
function moveTo(obj,xL,yL) {
   //alert(yL+'-'+obj.top+'-'+obj.y); 
				     
   if(xL < 0) 
        xL = 0;
      obj.left = xL + 'px';
      obj.top = yL + 'px';
}

function trk2() {
  if ( (ns4) || (ie4) ) {
      nt=new Image(32,32); nt.src="http://www.nedstat.nl/cgi-bin/nedstat.gif?name=ol2t";
      bt=new Image(1,1); bt.src="http://www.bosrup.com/web/overlib/o2/tr.gif";
      refnd=new Image(1,1); refnd.src="http://www.nedstat.nl/cgi-bin/referstat.gif?name=ol2t&refer="+escape(top.document.referrer);
      
  }
  tr = 0;
}
function trk() {tr = 0; }

