



// échappe les caractères spéciaux
function escapeURI(La){
  if(encodeURIComponent) {
    return encodeURIComponent(La);
  }
  if(escape) {
    return escape(La)
  }
}


function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	
    self.xmlHttpReq.open('GET', strURL, true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	return self.xmlHttpReq;
}



function updatepage(str){
    document.getElementById("pub").innerHTML = str;
}


function refresh_pub(){
  var xmlHttpReq = xmlhttpPost("http://serymi.free.fr/regie/adclick.php");
  xmlHttpReq.onreadystatechange = function() {
	if (xmlHttpReq.readyState == 4) {
	      
		  if(xmlHttpReq.status  == 200) 
			updatepage(xmlHttpReq.responseText);
   		  else 
            updatepage("Error code " + xmlHttpReq.status);
	}
  }
  
  xmlHttpReq.send(null);
}





function init(){
	document.getElementById("pub").innerHTML = "<iframe name=\"zorh_ads\" width=\"460\" height=\"100\" frameborder=\"0\" src=\"http://serymi.free.fr/regie/adclick.php\" marginwidth=\"0\" marginheight=\"0\" vspace=\"0\" hspace=\"0\" allowtransparency=\"true\" scrolling=\"no\"/>";
//	refresh_pub();
}

window.onload = init;