// JavaScript Document
var xhr = null; 

/////////////////////////////////////////////////////////
function GrandePhoto(titre,photo,W,H) {
  myWin=window.open("Photo","newin","width="+W+",height="+H+",resizable=1,scrollbars=0,status=0");
  myWin.document.open();
  if (myWin.blur) myWin.focus();
  myWin.resizeTo(W+9,H+52);
  
  myWin.document.write('<html><head><title>'+titre+'</title></head><body BGCOLOR="#ffffff" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">');
  myWin.document.write('<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><tr><td>');
  myWin.document.write('<A HREF="javascript:window.close();" ALT="Cliquez pour fermer">');  
  myWin.document.write('<IMG SRC="'+photo+'" WIDTH="'+W+'" HEIGHT="'+H+'" BORDER="0">');
  myWin.document.write('</A>');
  myWin.document.write("</table></tr></td>");
  myWin.document.write("</body></html>");
  myWin.document.close();
}
/////////////////////////////////////////////////////////
function Envoie_Codes() {
	var window2=window.open('../popup_envoie_codes.php','PopUpEnvoiCodes','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=380,height=120,top=0,left=0');
}
/////////////////////////////////////////////////////////
function Opacite(cur,which) {
	if (document.getElementById) {
		if (which==0) {
			if(document.all) cur.filters.alpha.opacity=100;
			else cur.style.setProperty("-moz-opacity", 1, "");
		}
		else {
			if(document.all) cur.filters.alpha.opacity=(which*10);
			else cur.style.setProperty("-moz-opacity", (which/10), "");
		}
	}
}
////////////  AFFICHER UNE IMAGE ET LA POPUP UP S'ADAPTE /////////////////
function AfficherImage(img){
  Image1= new Image();
  Image1.src=(img);
  Control(img);
}
function Control(img){
  if((Image1.width!=0)&&(Image1.height!=0)){
    VoirImage(img);
  }
  else{
    fonction="Control('"+img+"')";
    intervalle=setTimeout(fonction,20);
  }
}
function VoirImage(img){
  largeur=Image1.width+20;
  hauteur=Image1.height+20;
  proprietes="width="+ largeur +",height="+ hauteur;
  win=window.open(img,"",proprietes);
}
////////////////////////////////////////////////////////////
function getXhr() {
	if (window.XMLHttpRequest) // Firefox et autres
		xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ // Internet Explorer 
	   try {
          xhr = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
          xhr = new ActiveXObject("Microsoft.XMLHTTP");
	     }
				}
	else { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   xhr = false; 
	} 
}