/* - - - - - - - - - - - - - - - - - - - - - - -
 JavaScript
 RAMBAUD Thomas
 - - - - - - - - - - - - - - - - - - - - - - - */
function Run_globe() {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="295" height="339">');
document.write('<param name=movie value="style/photo_csspill.swf">');
document.write('<param name=quality value=high>');
document.write('<embed src="style/photo_csspill.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="295" height="339">');
document.write('</embed>');
document.write('</object>');
}
function Run_defiTerre() {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="90" height=120">');
document.write('<param name=movie value="style/defiPourLaTerre.swf">');
document.write('<param name=quality value=high>');
document.write('<param name="wmode" value="transparent">');
document.write('<embed wmode="transparent" src="style/defiPourLaTerre.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="90" height="120">');
document.write('</embed>');
document.write('</object>');
}
// - - - - - -
/* Routines */
// - - - - - -
function go(c){
           if(!c.data.replace(/\s/g,''))
           c.parentNode.removeChild(c);
           }



function clean(d){
        var bal=d.getElementsByTagName('*');

        for(i=0;i<bal.length;i++){
          a=bal[i].previousSibling;
          if(a && a.nodeType==3)
            go(a);
          b=bal[i].nextSibling;
          if(b && b.nodeType==3)
            go(b);
        }
        return d;
      } 


function writediv(texte,queldiv)
  {
    document.getElementById(queldiv).innerHTML = texte;
  }
var xhr = null;
   
function getXhr(){
        if(window.XMLHttpRequest)
           xhr = new XMLHttpRequest();
        else if(window.ActiveXObject){
           try {
                      xhr = new ActiveXObject("Msxml2.XMLHTTP");
                  } catch (e) {
                      xhr = new ActiveXObject("Microsoft.XMLHTTP");
                  }
        }
        else {
           alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...vous n'aurez donc pas accès aux mises à jour, installez un navigateur plus récent (Mozilla Firefox, Internet Explorer 5 [...])");
           xhr = false;
        } 
      }
/* Fin des routines */
// Fonctions liées aux news
function afficherNews(id_info,position) {
    getXhr();
    xhr.onreadystatechange = function()
    {
      if(xhr.readyState == 4 && xhr.status == 200)
      {
        var reponseHttp = xhr.responseText;
        writediv(reponseHttp,id_info);
      }
    }
    xhr.open("POST","ajax_showNews.php",true);
    xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    var truc = "";
    xhr.send("id_info="+id_info+"&position="+position);
}