/// GERER LES WINDOWS.ONLOAD function addOnloadEvent(fnc){ if ( typeof window.addEventListener != "undefined" ) window.addEventListener( "load", fnc, false ); else if ( typeof window.attachEvent != "undefined" ) { window.attachEvent( "onload", fnc ); } else { if ( window.onload != null ) { var oldOnload = window.onload; window.onload = function ( e ) { oldOnload( e ); window[fnc](); }; } else window.onload = fnc; } }//////// function MM_jumpMenu(targ,selObj,restore){ eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } ////// function ShowHide(id, visibility) { obj = document.getElementsByTagName("div"); obj[id].style.visibility = visibility; } /// DECOMPTE TEXTE TEXTAREA var ns6=document.getElementById&&!document.all function restrictinput(maxlength,e,placeholder){ if (window.event&&event.srcElement.value.length>=maxlength) return false else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){ var pressedkey=/[a-zA-Z0-9\.\,\/]/ if (pressedkey.test(String.fromCharCode(e.which))) e.stopPropagation() } } function countlimit(maxlength,e,placeholder){ var theform=eval(placeholder) var lengthleft=maxlength-theform.value.length var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder) if (window.event||e.target&&e.target==eval(placeholder)){ if (lengthleft<0) theform.value=theform.value.substring(0,maxlength) placeholderobj.innerHTML=lengthleft } } function displaylimit(thename, theid, thelimit){ var theform=theid!=""? document.getElementById(theid) : thename var limit_text=''+thelimit+' caracteres Maximum.' if (document.all||ns6) document.write(limit_text) if (document.all){ eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)} eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)} } else if (ns6){ document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); } } //NEWS DEFILEMENT var DOM = (document.getElementById ? true : false); var DelayDefil = 15; // Delai pour defilement Msg var DelayPause = 3000; // Delai pour pause sur le Msg var IncY = 2; // Pas Incrementation du Msg var bFirst = false; var MsgTimer = null; // Timer du Msg var OfsY; // OfsY du Msg pour clipping var DeltaY; // Compteur pour pause Msg var PosX; // Positon d'affichage X du Msg var PosY; // Positon d'affichage Y du Msg var MsgClip; // Hauteur visible du Msg var MsgEnCours; // Numero du Msg en cours d'affichage var MsgNbr; // Nbr Ligne à afficher var MsgZone; // Div ou l'on affichage var MsgLarg; // Largeur Msg var MsgHaut; // Hauteur Msg var MsgOK = false; // Flag pour Init correct var Clip = new RECT(); // Zone de clipping du Msg var Message = new Array(); //---------------------------- function RECT( l_, t_, r_, b_){ var Arg = arguments; this.Left = ( Arg[0] ? l_: 0); this.Top = ( Arg[1] ? t_: 0); this.Right = ( Arg[2] ? r_: 0); this.Bottom = ( Arg[3] ? b_: 0); } //--------------------- function GetObjet(div_){ if( DOM) return document.getElementById(div_); } //--------------------- function GetStyle(div_){ var Obj = GetObjet(div_); if( Obj) return( Obj.style); return( null); } //--------------------------- function ObjGetLargeur( div_){ var Larg = 0; var Obj = GetObjet( div_); if( Obj) Larg = Obj.scrollWidth; return( Larg); } //--------------------------- function ObjGetHauteur( div_){ var Haut = 0; var Obj = GetObjet( div_); if( Obj) Haut = Obj.scrollHeight; return( Haut); } //----------------------------- function ObjWrite( div_, html_){ var Obj = GetObjet( div_); if( Obj) Obj.innerHTML = html_; } //------------------------- function ObjShow( div_, z_){ var Obj = GetStyle( div_); if( Obj){ Obj.visibility = "visible"; if( arguments[1] != null) Obj.zIndex = z_; } return(true); } //------------------------------- function ObjMoveTo( div_, x_, y_){ var Arg = arguments; var Obj = GetStyle( div_); if( Obj){ if( Arg[1] != null) Obj.left = x_ +"px"; if( Arg[2] != null) Obj.top = y_ +"px"; } } //-------------------------------------------- // ATTENTION à l'ordre des paramètres // Top Right Bottom et Left // Nota: ne convient pas pour NS4 //-------------------------------------------- function ObjSetClipping( div_, t_, r_, b_, l_){ var Obj = null; var Clipping = "rect("; var Arg = arguments; if( div_){ Obj = GetStyle( div_); if( Obj){ for( i=1; i< Arg.length; i++){ if( Arg[i] != null) Clipping += " "+Arg[i] + "px"; else Clipping += " auto"; } Clipping += ")"; Obj.clip = Clipping; } } } //------------------------------------------------- // Creation d'un div lorsque le document est charge //------------------------------------------------- function Add_Div( div_){ var Html =""; var NewDiv; var Obj = GetObjet( MsgZone); with( Obj){ //-- pour eviter le mouseover sous Opera notamment style.overflow = 'hidden'; //-- Pb d'héritage if( style.textAlign == "") style.textAlign="left"; } Html = '