
function checksize(x,y) { 
	resizeTo(x,y);
	self.focus(); 
}

function popupresize() {
//	checksize('500','650');
//	document.location = document.location.href;
//	self.focus(); 

}

function div(x,y) {
	
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function attacherAction() { 
  if (document.getElementById) { 
    if (document.getElementById('monAction')) { 
      leLien = document.getElementById('monAction'); 
      leLien.onclick = function() { 
		 //popup.location.replace(this.href);
		 //var popup
		 //popup.load=this.href;
		 //SetDiv('popup',toto);

		 SetDiv('popup',this.href);
         affCache('popup'); return false;

//popup.include("GET", Content, true);
//		 affCache('popup');return false;
		 //SetDiv('popup',this.href);
		 //return false;
        } 
      } 
    } 
  } 

/* this.href */

function affCache(idpr)
{
var pr = document.getElementById(idpr);

if (pr.style.display == "") {
pr.style.display = "none";
} else {
pr.style.display = "";
}
}

   function SetDiv(ID,Content) {
      if (dom) {
      //obj.open("get", Content, true);
	  //#INCLUDE VIRTUAL=Content;
	  
	  //document.getElementById(ID).innerHTML = Content;
      
	  //Content.open(content);

	  //document.getElementById(ID).appendChild('http://localhost/?content=108&popup#a.auriol');

	  
	  document.getElementById(ID).innerHTML = Content;

	
	
	//document.getElementById(ID).replace.innerHTML(Content);
//		popup.include("GET", Content, true);
//       popup.send(null);
         return;
      }
      if (ie4) {
          document.all[ID].innerHTML = Content;
         return;
      }
      if (ns4) {
          with (eval('document.'+ID+'.document')) {
             open();
			 write(Content);
             close();
         }
         return;
      }
   }

/*

// définition du navigateur pour la fct SetDiv
  var ns4 = (document.layers)? true:false;         //NS 4
   var ie4 = (document.all)? true:false;         //IE 4
   var dom = (document.getElementById)? true:false;   //NS 6 ou IE 5


addLoadEvent(attacherAction); 
*/

function ahah(url,target) {
    document.getElementById(target).innerHTML = 'loading data...';
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {ahahDone(target);};
        req.open("GET", url, true);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {ahahDone(target);};
            req.open("GET", url, true);
            req.send();
        }
    }
}

function ahahDone(target) {
   // only if req is "loaded"
   if (req.readyState == 4) {
       // only if "OK"
       if (req.status == 200 || req.status == 304) {
           results = req.responseText;
           document.getElementById(target).innerHTML = results;
       } else {
           document.getElementById(target).innerHTML="ahah error:\n" +
               req.statusText;
       }
	document.getElementById(target).style.display = "" ;
   }
}

function visibilite(thingId)
{
var targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none")
{
targetElement.style.display = "" ;
} else {
targetElement.style.display = "none" ;
}
}
