(function(undefined){ // functions from jQuery framework window.GIGA=window.GIGA||{}; GIGA.noop=function(){}; GIGA.each = function(object, iterator){ var _isFunction=function(obj){ var toString = Object.prototype.toString; return toString.call(obj) === "[object Function]"; } ,name, i = 0, length = object.length, isObj = length === undefined || _isFunction(object); if ( isObj ) { for ( name in object ) { if ( iterator.call( object[ name ], name, object[ name ] ) === false ) { break; } } } else { for ( var value = object[0]; i < length && iterator.call( value, i, value ) !== false; value = object[++i] ) {} } } // cross-browsers CONSOLE window.CONSOLE={enable:false}; (function($c, $j){ var $fn=['log','debug','info','warn','error']; if (!$c) return $j.each($fn, function(i,$s){ CONSOLE[$s]=$j.noop; }); try{ $j.each($fn, function(i,$s){ CONSOLE[$s]=function(){ $c[$s].apply($c,arguments) }; }); // works on FF, Safari, Chrome, Opera, IE/CompanionJS CONSOLE.log('CONSOLE enabled'); CONSOLE.enable=true; }catch(err){ try{ // try native function on IE8 $j.each($fn, function(i,$s){ CONSOLE[$s]=$c[$s]; }); CONSOLE.log('CONSOLE enabled'); CONSOLE.enable=true; }catch(err){ // native function doesn't work $j.each($fn, function(i,$s){ CONSOLE[$s]=$j.noop; }); CONSOLE.enable=false; } } })(window.console, GIGA); GIGA.CONSOLE=window.CONSOLE; window.GigaButton = function(id, text, click) { var box; if (!(box=document.getElementById(id))) return false; else { box.className='bouton'; var BT=document.createElement('input'); BT.type='button'; BT.value=text; BT.className='bouton'; box.appendChild(BT); var fct; if (click!="") fct = new Function(click); this.setFunction=function(f){fct=f;} BT.onmouseover=function(){BTon(box)} BT.onmouseout=function(){BToff(box)} BT.onclick=function(){BT.blur();BToff(box);fct() } this.BT=BT; this.box=box; this.W=function(w){box.style.width=w};this.S=function(s){BT.style.fontSize=s}; return ; } //function BTon(e) {e.style.backgroundColor= /*"FF6600"*/"F50000";return true} //function BToff(e) {e.style.backgroundColor= "transparent";return true} // nouvelles fonction v1.8b pour tester une nv mise en forme function BTon(e) {BT.className='bouton-ON';/*e.style.backgroundColor='000066'*/;return true} function BToff(e) {BT.className='bouton';/*e.style.backgroundColor= 'transparent'*/;return true} } window.div_object=function(name) { var div_element=document.getElementById(name); div_element.style.display='none'; this.Off=function(){div_element.style.display='none'; return this} this.On=function(){div_element.style.display=''; return this} this.Change=function(){div_element.style.display==''?div_element.style.display='none':div_element.style.display=''; return this} this.$=div_element; } GIGA.$ = function(id){ var elt = document.getElementById(id) || {}; elt.hide=function(){elt.style.display='none'; return elt} elt.show=function(){elt.style.display=''; return elt} elt.Visible=function(v){ if (v || v==undefined) elt.style.visibility='visible'; else elt.style.visibility='hidden'; return elt} return elt } // fonctions pour le menu - DEPRECATED window.init_menu = function(){ if (PHP_wrong_id) document.getElementById("wrong_id").style.visibility='visible' else document.getElementById("wrong_id").style.visibility='hidden'; if (ID_auth){ // true si le client est authentifie dans la session div_id.style.visibility='hidden'; div_logon.style.display='none'; div_logoff.style.display=''; wrong_id.style.visibility='hidden'; } else { // sinon afficher le menu d'identification div_id.style.visibility='visible'; div_logon.style.display=''; div_logoff.style.display='none'; } return true } window.MenuON = function(num) { document.getElementById("menu"+(num)).bgColor= "99CCFF"; return true; } window.MenuOFF = function(num) { BgC=document.getElementById("centre_left").bgColor; document.getElementById("menu"+(num)).bgColor=BgC; return true; } window.logon = function() { //test de l'identite et du mot de passe. Si ok alors : div_id.style.visibility='hidden'; div_logon.style.display='none'; div_logoff.style.display=''; wrong_id.style.visibility='hidden'; return true; } window.logoff = function(){ div_id.style.visibility='visible'; form_id.reset(); div_logon.style.display=''; div_logoff.style.display='none'; wrong_id.style.visibility='hidden'; return true; } // fonctions pour les boutons window.bgON = function(nom) { //document.getElementById(nom).bgColor= "F50000"; var N=document.getElementById(nom).firstChild; while (N.nodeName!='BUTTON') N=N.nextSibling; N.className='bouton-ON' ; return true; } window.bgOFF=function(nom) { //document.getElementById(nom).bgColor=""; var N=document.getElementById(nom).firstChild; while (N.nodeName!='BUTTON') N=N.nextSibling; N.className='bouton' ; return true; } // transforme une date en string window.DateString=function(time_value,format){ time_value_str=""; time_value_str=time_value.toLocaleString(); if (format){ // retravaille le format en enlevant les heures pos=time_value_str.indexOf(':'); if (pos >= 3){ time_value_str=time_value_str.substring(0,pos-3) }; }; return time_value_str } // transforme des octest en Mo window.ToMo=function(octets,decimale) {return (octets/1024/1024).toFixed(decimale)} window.Str_octets = function(octets,decimale) { s=Array("Octets","Ko", "Mo", "Go"); t=new Array(2); i=0; t[i]=octets; while (t[i]>999) { t[i+1]=t[i]/1024 ; if (i