// Fonctions Javascripts
function bookmark()
{
	netscape="Appuyer sur les touches CTRL+D pour placer cette page dans vos favoris."
	if (navigator.appName=='Microsoft Internet Explorer') {
		window.external.AddFavorite(window.location, document.title);
	} else if (navigator.appName=='Netscape') {
		alert(netscape);
	}
}

function WindowOnload(f) {
	var prev=window.onload;
	window.onload=function(){ if(prev)prev(); f(); }
}

function stat0() { self.status=''; }

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='Adresse e-mail non valide.\nUne adresse valide est du type votrenom@votrefournisseur.com\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('ATTENTION:\n'+errors);
  document.MM_returnValue = (errors == ''); 
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ScanCookie(variable) {
	cook = document.cookie;
	variable += "=";
	place = cook.indexOf(variable,0);
	if (place <= -1)
		return("0");
	else {
		end = cook.indexOf(";",place)
		if (end <= -1)
			return(unescape(cook.substring(place+variable.length,cook.length)));
		else
			return(unescape(cook.substring(place+variable.length,end)));
	}
}

function CreationCookie(nom,valeur,permanent) {
	if(permanent) {
		dateExp = new Date(2020,11,11);
		dateExp = dateExp.toGMTString();
		ifpermanent = '; expires=' + dateExp + ';';
	} else
		ifpermanent = '';
	document.cookie = nom + '=' + escape(valeur) + ifpermanent;
}

/***********************************************
* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
		
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

// Pub Scroller
function pubscroll_makeVars() {
 if(document.all) {
   h=".pixelLeft="; 
   v=".pixelTop="; 
   dS=""; 
   sdm=".style";
   y="document.body.scrollTop"; 
   x="document.body.scrollLeft";
   doWidth="document.body.clientWidth"; 
   doHeight="document.body.clientHeight"
   object="scrollpub120x600";
 } else if(document.getElementById){
   v=".top="; 
   h=".left="; 
   dS="document.";
   sdm=".style";
   y="window.pageYOffset"; 
   x="window.pageXOffset";
   doWidth="window.innerWidth"; 
   doHeight="window.innerHeight"
   object="getElementById(\"scrollpub120x600\")";
 }
 xyz=400
 pubscroll_placeIt()
}

movex=0,movey=0,xdiff=0,ydiff=0,ystart=0,xstart=0

function pubscroll_makeXY(){
 innerX= ((eval(doWidth)-750)/2) + 750 + 5;
 //if (innerX < 760) innerX = 760;
 //innerY=eval(doHeight)-150;
 //innerX = 0;
 innerY = 10;
 yy=eval(y);
 xx=eval(x);
 ydiff=ystart-yy;
 xdiff=xstart-xx;
 if ((ydiff<(-1))||(ydiff>(1))) movey=Math.round(ydiff/10),ystart-=movey;
 if ((xdiff<(-1))||(xdiff>(1))) movex=Math.round(xdiff/10),xstart-=movex;
 eval(dS+object+sdm+v+(ystart+innerY));
 eval(dS+object+sdm+h+(xstart+innerX));
 setTimeout("pubscroll_makeXY()",25);
 //if(document.getElementById) document.getElementById("scrollpub120x600").visibility='show';
 MM_showHideLayers('scrollpub120x600','','show');
}

function pubscroll_placeIt(){ ystart=eval(y); xstart=eval(x); ystart=0; xstart=0; }

function pubscroll_init () {
	MM_showHideLayers('scrollpub120x600','','hide');
	pubscroll_makeVars();
	pubscroll_makeXY();
	MM_showHideLayers('scrollpub120x600','','show');
};

/*************************************************/



if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox

// Ouverture du popup de sondage
/*if(ScanCookie("dejapopup")==0) {
	window.open('http://www.celebrinet.com/pub/nouvelan2005.html','AN2005','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width=640,height=480');
	CreationCookie("dejapopup","oui",false)
}*/

