function popup(page, larg, haut) {
		var top=(screen.height-haut)/2;
		var left=(screen.width-larg)/2;
		var options="top="+top+",left="+left+",width="+larg+",height="+haut+",toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,menuBar=0";
		popuperreur = window.open(page,'_blank',options);
}

function popup2(page, larg, haut) {
	var top=(screen.height-haut)/2;
	var left=(screen.width-larg)/2;
	var options="top="+top+",left="+left+",width="+larg+",height="+haut+",toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0";
	popuperreur = window.open(page,'_blank',options);
}

function alert_html (erreur, larg, haut) {
			var left=(screen.width-larg)/2;
			var top=(screen.height-haut)/2;
			var options="top="+top+",left="+left+",width="+larg+",height="+haut+",toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=yes,copyhistory=0,menuBar=0";
			var html  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Document sans nom</title><base href=\"http://www.blackmetisslove.com/\" /><link href=\"css/popup.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body onload=\"window.resizeTo(470, document.getElementById(\'contener\').clientHeight + 70);self.focus();\" id=\"contener\" onblur= \"self.focus()\" ><table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">  <tr>    <td style=\"background:#e3dbca\"><img src=\"img/logo_popup.gif\" width=\"170\" height=\"57\" /></td>  </tr>  <tr>    <td><img src=\"img/mrpixel.gif\" width=\"10\" height=\"10\" /></td>  </tr>  <tr>    <td><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"contenu\">      <tr>        <td><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"bg\">          <tr>            <td style=\"background:url(img/coin_hg.gif) no-repeat; height:9px; width:9px;\"></td>            <td style=\"background:url(img/bg_haut.gif) repeat-x top;\"></td>            <td style=\"background:url(img/coin_hd.gif) no-repeat; height:9px; width:10px;\"></td>          </tr>          <tr>            <td rowspan=\"2\" style=\"width:9px; background:url(img/bg_gauche.gif) repeat-y left;\"><img src=\"img/mrpixel.gif\" alt=\"\" width=\"9\" height=\"1\" /></td>            <td><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"bg\">              <tr>                <td width=\"20\"><img src=\"img/picto-attention-popup.gif\" width=\"16\" height=\"18\" /></td>                <td>&nbsp;</td>                <td>&nbsp;</td>              </tr>              <tr>                <td valign=\"top\">&nbsp;</td>                <td>{CONTENT}</td>                <td>&nbsp;</td>              </tr>              <tr>                <td>&nbsp;</td>                <td>&nbsp;</td>                <td width=\"20\" align=\"right\"><a href=\"#\" onclick=\"window.close();\"><img src=\"img/bt_fermer.gif\" width=\"12\" height=\"12\" border=\"0\" /></a></td>              </tr>            </table></td>            <td rowspan=\"2\" style=\"width:9px; background:url(img/bg_droite.gif) repeat-y left;\"><img src=\"img/mrpixel.gif\" alt=\"\" width=\"9\" height=\"1\" /></td>          </tr>          <tr>            <td style=\"background:url(img/bg_bas.gif) top;\"></td>          </tr>          <tr>            <td style=\"background:url(img/coin_bg.gif) no-repeat; height:9px; width:9px;\"></td>            <td style=\"background:url(img/bg_bas.gif) repeat-x top;\"></td>            <td style=\"background:url(img/coin_bd.gif) no-repeat; height:9px; width:10px;\"></td>          </tr>        </table></td>      </tr>    </table></td>  </tr></table></body></html>";
			var remplacement = /{CONTENT}/;
			html = html.replace(remplacement, erreur);
			popuperreur = window.open('','_blank',options);
			popuperreur.document.open();
			popuperreur.document.write(html);
			popuperreur.document.close();
}

function zoom(chemin, hauteur, largeur){
	i1 = new Image;
	i1.src = chemin;
	var winl = (screen.width - largeur) / 2;
	var wint = (screen.height - hauteur) / 2;
	winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,menuBar=0'
	html = '<HTML><HEAD><TITLE>zOOm</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest></CENTER></BODY></HTML>';
	popupImage = window.open('','_blank',winprops);
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
}

function ouverture_chat() {
	var largeur=700;
	var hauteur=500;
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	var options="toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,menuBar=0";
	chat = window.open('chat/chat.php?','chat',"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	if(chat.window.focus){chat.window.focus();}
}

function ouverture_invitation(id_dest) {
	var largeur=700;
	var hauteur=500;
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	var options="toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,menuBar=0";
	chat = window.open('chat/invitation.php?id_dest='+id_dest,'chat',"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	if(chat.window.focus){chat.window.focus();}
}

function ouverture_chat2(id_dest,id_chat) {
	var largeur=700;
	var hauteur=500;
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	var options="toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,menuBar=0";
	chat = window.open('chat/acceptation.php?id_dest='+id_dest,'chat',"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	if(chat.window.focus){chat.window.focus();}
}

