function submit_form (form_id)
{
   var frm = document.getElementById(form_id);
   frm.submit();
    
}


function loadCSS(css_file)
{
    
    var css = document.createElement('link');
    css.setAttribute('href',css_file);
    css.setAttribute('rel','stylesheet');
    css.setAttribute('type','text/css');
    var heads = document.getElementsByTagName('head');
    heads[0].appendChild(css);
    
    
}

function changeButtonState(button,state) {
		//changement de l'image de fond en fonction de l'etat du bouton ( normal rollover, ou down)
		document.getElementById(button.id + "_root").className="button_root br_" + state;
		document.getElementById(button.id + "_left").className="button_left bl_" + state;
		document.getElementById(button.id + "_right").className="button_right bri_" + state;
		document.getElementById(button.id + "_center").className="button_center bc_" + state;

	}
	
function initIE()
{
	var temp;
	divs = document.getElementsByTagName('div')
	temp = 0;
	while (temp < divs.length) {
		
		if(divs[temp].currentStyle.cursor =="pointer"){
			//objExplorer(divs[temp].currentStyle);
			alert(divs[temp].currentStyle.cursor);
			divs[temp].currentStyle.cursort = 'hand';
		}
	temp++;	
	}
}
	
  /*
  fonction retournant le texte contenu dans un element html
  */
  function objText(obj) {
        var text = '';
        var ok =false;
        // cas IE 
        if(obj.innerText) {
            
            text = obj.innerText;
            ok = true;
        }
        // cas Fx 
        if ((obj.textContent) &&(!ok))
        {
           text = obj.textContent;
           ok = true;
        }
        // nettoyage des retour chariot
        text = text.replace(/rn/g," ");
        return text; 
  } 

function objExplorer(obj,notNull) {
    msg = ''
    var k = 0;
    for (var i in obj)
    {
     if(!notNull)    {
         msg = msg + i + ' = ' + obj[i]+ ' | ';
       } else {   
           if(obj[i] != null) {
            msg = msg + i + ' = ' + obj[i]+ ' | ';
         }
       }  
         k++;
         if(k == 5 ) {
             msg = msg + "\n";
             k = 0;
         }
    
    }
    alert(msg);
}	
 function checkObj(obj_id,func_todo) 
 {
      var obj = document.getElementById(obj_id)
      if(obj) {
          eval(func_todo);
          
      } else {
           window.setTimeout('checkObj("'+obj_id+'","'+func_todo+'")',100); 
      }
     
 }
function favorites(){ 
if (navigator.appName.indexOf("Netscape") > -1) {
   window.alert("Pour ajouter cette page à vos signets tapez CTRL-D  Merci.")
}
else {
   window.external.AddFavorite('http://media-alarme.absolunet-demo.com/','Media Alarme - "sécurité - fiabilité - réactivité"');
}}

function setClass(obj,classe) {
    

    
    if ((document.all)) {
        
        obj.setAttribute('className',classe);
         
    } else {
        
        obj.setAttribute('class',classe);
        
    }
}
function setTrans(id,trans)
{
    
    if(document.getElementById){
       obj = document.getElementById(id);
       if(obj)
       {
           if(typeof obj.style.MozOpacity != "undefined") {
               
                obj.style.MozOpacity = trans;
           }
           if(typeof obj.style.opacity != "undefined") {
               
                obj.style.opacity = trans;
           }
           if(typeof obj.style.KhtmlOpacity  != "undefined") {
               
                obj.style.KhtmlOpacity  = trans;
                alert('bopuh"');
           }
           if(typeof obj.style.filter != "undefined") {
               
              obj.style.filter ="progid:DXImageTransform.Microsoft.Alpha(opacity="+parseInt(100* trans)+")";
           }
           
       }
      
    }
}

function setCursorHand(obj) {
        if(document.all) {
         obj.style.cursor="hand";
       } else {
         obj.style.cursor="pointer";
       }
}