// JavaScript Document

function Request(url,cadre) {
	 var XHR = null;
	 if(window.XMLHttpRequest) 
	   XHR = new XMLHttpRequest();
	 else if(window.ActiveXObject) // Internet Explorer
	   XHR = new ActiveXObject("Microsoft.XMLHTTP");
	 else 
	 { 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest");
	   return;
	 }
	 XHR.open("GET",url, true);
	 XHR.onreadystatechange = function attente() {
	 	if(XHR.readyState == 4) {
	 		document.getElementById(cadre).innerHTML = XHR.responseText;
	 	}
	 }
	 XHR.send(null);
	 return;
}

function counterclik(url, add) {
	var counting = 'misc/annonce_regie.php?url='+url+'&add='+add ;
	Request(counting, 'regie_annonce') ;
}

function OuvrirPopup(page,nom,option) {
       window.open(page,nom,option);
    }

function Recover() {
	OuvrirPopup('recup.php','popup','width=500,height=250,scrollbars=yes,menubar=no,status=no,resizable=no');	
}

function myprofile() {
	var w = window.open('profile.php','popup','width=500,height=450,scrollbars=yes,menubar=no,status=no,resizable=no');
	w.document.close();
    w.focus();
}

function mygallery() {
	var w = window.open('gallery.php','popup','width=500,height=450,scrollbars=yes,menubar=no,status=no,resizable=no');
	w.document.close();
    w.focus();
}

function initialise(url) {
	window.location.replace(url) ;
}

function valider_form_lien(){
  if(document.liens.categorie.value != "") {
    return true;
  }
  else {
    alert("Choisissez une valeur dans la liste");
    return false;
  }
}

function goback(){
	history.back();	
}


