//**************************************************************************
// pour page d'accueil
function taille_flyer(){
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg = (document.body.clientWidth);
		var haut = (document.body.clientHeight);
	} 
	else
	{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	//
	pozx=(larg/2-225)
	pozy=170
	// on position la pop_msg
	document.getElementById("Layer1").style.left = pozx+"px";
	document.getElementById("Layer1").style.top = pozy+"px";

}
function taille_Pub(){
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg = (document.body.clientWidth);
		var haut = (document.body.clientHeight);
	} 
	else
	{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	//
	pozx=(larg/2-190)
	pozy=240
	// on position la pop_msg
	document.getElementById("LayerPub").style.left = pozx+"px";
	document.getElementById("LayerPub").style.top = pozy+"px";

}

function taille_certif(){
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg = (document.body.clientWidth);
		var haut = (document.body.clientHeight);
	} 
	else
	{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	//
	pozx=(larg/2-200)
	pozy=280
	// on position la pop_msg
	document.getElementById("zone_certif").style.left = pozx+"px";
	document.getElementById("zone_certif").style.top = pozy+"px";

}

function ferme_soiree(){
	document.getElementById("Layer1").style.visibility="hidden"
}

function ferme_Pub(){
	document.getElementById("cont_Pub").innerHTML = "";
	document.getElementById("LayerPub").style.visibility="hidden"
}

function ferme_certif(){
	document.getElementById("zone_certif").style.visibility="hidden"
}

function killlink(){
	if(document.getElementById("bulle")){
document.getElementById("bulle").innerHTML = "";
document.getElementById("bulle").style.visibility = "hidden";
}}
selection=1
function change_onglet(id,action)
{

	if (action=="c"){
		for (i=1;i<=8;i++){
			if (i==id){
				document.getElementById("onglet"+i).style.backgroundColor="#ffffff"
				document.getElementById("t"+i).style.backgroundColor="#993366"
				selection=id
			}else{
				document.getElementById("onglet"+i).style.backgroundColor="#dddddd"
				document.getElementById("t"+i).style.backgroundColor="#F3B1DB"
				
			}
		}
	}
	//
	if (action=="o"){
		document.getElementById("onglet"+id).style.backgroundColor="#eeeeee"
		
	}
	if (action=="s"){
		if (selection==id){
			document.getElementById("onglet"+id).style.backgroundColor="#ffffff"
		}else{
		document.getElementById("onglet"+id).style.backgroundColor="#dddddd"
		}
	}
}
if(navigator.appName.substring(0,3) == "Net"){
	document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = get_mouse;
//
function poplink(msg){
var content="<table class='blanc10' width='10' border='0' cellpadding='3' cellspacing='1' bgcolor='#000000'><tr><td align='center' valign='top' bgcolor='#C4629F'>"+msg+"</td></tr></table>";
if(document.getElementById("bulle")){
document.getElementById("bulle").innerHTML = content;
document.getElementById("bulle").style.visibility = "visible";
}}
//
function get_mouse(e){
	if (document.getElementById("bulle")){
	
	if (document.body)
	{
	var larg = (document.body.clientWidth);
	var haut = (document.body.clientHeight);
	} 
	else
	{
	var larg = (window.innerWidth);
	var haut = (window.innerHeight);
	}
	var x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.documentElement.scrollLeft;
	var y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.documentElement.scrollTop;
	
	document.getElementById("bulle").style.left = x+20+"px";
	document.getElementById("bulle").style.top = y-60+"px";
	}
}
//**********************************************************
//
//
//
//
function change_class(action, nom){
	cible=document.getElementById(nom)
	if (action=='d'){
		cible.style.backgroundColor="#dddddd"
	}
	if (action=='h'){
		if(cible.className=="nonlu"){
			cible.style.backgroundColor="#EDD1E2"
		}else{
			cible.style.backgroundColor="#ffffff"
		}
	}
	if (action=='c'){
		cible.className="lu"
	}
}


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0

  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

//-->
//
//
function getXhr(){
	var xhr = null; 
	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; 
	} 
return xhr
}

function detect_taille(orr){
	
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg = (document.body.clientWidth);
		var haut = (document.body.clientHeight);
	} 
	else
	{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	//
	
	if (orr==1){
	pozx=(larg/2-170)
	pozy=280
	}else{
	pozx=(larg/2-200)
	pozy=230
	}
	// on position la pop_msg
	document.getElementById("pop_msg").style.left = pozx+"px";
	document.getElementById("pop_msg").style.top = pozy+"px";
}
function poz_promo(){
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg_promo = (document.body.clientWidth);
		var haut_promo = (document.body.clientHeight);
	} 
	else
	{
		var larg_promo = (window.innerWidth);
		var haut_promo = (window.innerHeight);
	}
	//
	pozxpromo=(larg_promo/2-315)
	pozypromo=200
	// on position la pop_msg
	document.getElementById("promo").style.left = pozxpromo+"px";
	document.getElementById("promo").style.top = pozypromo+"px";
	affiche_calque('promo')
}
poz_fly=0

function verso(){
	if (poz_fly==0){
		poz_fly=1
		document.getElementById("fly_txt").innerHTML="<a  style='cursor:pointer' onclick='verso()' class='blanc12'>Voir flyer recto</a>"
		document.getElementById("fly").innerHTML="<img src='img/promo/BubbleLuxureV-06-06-08.jpg' border='0'>"
	}else{
		poz_fly=0
		document.getElementById("fly_txt").innerHTML="<a  style='cursor:pointer' onclick='verso()' class='blanc12'>Voir flyer verso</a>"
		document.getElementById("fly").innerHTML="<img src='img/promo/BubbleLuxureR-06-06-08.jpg' border='0'>"
	}
	
}

function detect_taille2(){
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg = (document.body.clientWidth);
		var haut = (document.body.clientHeight);
	} 
	else
	{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	//
	pozx=(larg/2-220)
	pozy=230
	// on position la pop_msg
	document.getElementById("pop_msg").style.left = pozx+"px";
	document.getElementById("pop_msg").style.top = pozy+"px";
}

function detect_taille_inscr(){
	//on detect la taille de l'écran
	if (document.body)
	{
		var larg = (document.body.clientWidth);
		var haut = (document.body.clientHeight);
	} 
	else
	{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	//
	pozx=(larg/2-255)
	pozy=190
	// on position la pop_msg
	document.getElementById("inscr").style.left = pozx+"px";
	document.getElementById("inscr").style.top = pozy+"px";
}

		
/**
* Méthode qui sera appelée sur le click du bouton
*/
function charge_page(mapage,macible,ma_var1,message,lien){

//alert (mapage)
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		document.getElementById(macible).innerHTML='<p align="center"><img src="img/attente3.gif"></p>'
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4){
			if (mapage!="up_affiliation.asp"){
			document.getElementById(macible).innerHTML=xhr.responseText
			}else{
				
				charge_page('aff_banniere.asp','banniere','format=1')
		}
		}
	}
	
	xhr.open("POST","page/"+mapage,true);
	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');
	var data = ma_var1
	
	xhr.send(data);
}

function pop_msg(id,ligne){
	
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		
		//document.getElementById("pop_msg").innerHTML='chargement du message<br><img src="../img/attente2.gif">'
		// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
		if(xhr.readyState == 4){
			document.getElementById("pop_msg").style.visibility="visible"
			document.getElementById("pop_msg").innerHTML=xhr.responseText
			change_class('c',ligne)
			/*if (macible=="compt"){
			charge_page('visites.asp','visites')
			}*/
		}
	}
	xhr.open("POST","page/message_contenu.asp",true);
	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');

	var data="id="+id
	xhr.send(data);
	}
	
	

function repondre(moi,lui){

mon_mess=escape(document.getElementById("mess").value)
mon_lib=escape(document.getElementById("lib").value)
if (mon_lib=="") {
alert("Vous devez remplir le sujet")
}else{
if (mon_mess=="") {
alert("Vous devez remplir le message")
}else{
var xhr = getXhr()
// On défini ce qu'on va faire quand on aura la réponse
xhr.onreadystatechange = function(){

//document.getElementById("pop_msg").innerHTML='chargement<br><img src="../img/attente2.gif">'
// On ne fait quelque chose que si on a tout reçu et que le serveur est ok
if(xhr.readyState == 4){
document.getElementById("pop_msg").innerHTML=xhr.responseText

}
}
xhr.open("POST","page/up_reponse.asp",true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');


var data="mess="+mon_mess+"&lib="+mon_lib+"&id_lui="+lui+"&id_moi="+moi
xhr.send(data);

}
}
	function pop_it(the_form) {
//alert("test")
   my_form = eval(the_form)
   window.open("wait.asp", "popup", "height=440,width=545,menubar='no',toolbar='no',location='no',status='no',scrollbars='no'");
   my_form.target = "popup";
   my_form.submit();
}
	
	}
	
function affiche_calque(id_div){
	document.getElementById(id_div).style.visibility="visible"
}

function cache_calque(id_div){
	document.getElementById(id_div).style.visibility="hidden"
}
function cache_pop_msg(){
	document.getElementById("pop_msg").innerHTML=""
	document.getElementById("pop_msg").style.visibility="hidden"
}
function cache_pop_msg2(){
	document.getElementById("la_photo").innerHTML=""
	document.getElementById("pop_msg").style.visibility="hidden"
}
//
//
function supp_select_recu(ki,deb,fin){

	var les_chk="les_chk="
	
	for (i=deb;i<=fin;i++){
		if (document.getElementById("chk"+i)){
		if (document.getElementById("chk"+i).checked){
		les_chk+=document.getElementById("chk"+i).value+","
		}}

	}
	les_chk+="0&maske="+ki
	charge_page('supp_group_recu.asp','zone_msg',les_chk,'');
	
}
function affiche_photo(id,nom){
	document.getElementById("la_photo").innerHTML="<img src='photos/moy_"+nom+"' border='0' >"
	document.getElementById("pop_msg").style.visibility="visible"
	
		
	var xhr = getXhr()
	// On défini ce qu'on va faire quand on aura la réponse
	xhr.onreadystatechange = function(){
		document.getElementById("pop_msg").style.visibility="visible"

		if(xhr.readyState == 4){
	document.getElementById("la_photo").innerHTML="<img src='photos/moy_"+nom+"' border='0' >"
	document.getElementById("nb_clic").innerHTML="Nombre d'affichages : "+xhr.responseText+" depuis le 23 janvier 2008"
	

		}
	}
	xhr.open("POST","page/clic_photo.asp",true);
	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');

	var data="id="+id
	xhr.send(data);
}
//
//
function affiche_photo_soiree(nom){
	document.getElementById("la_photo").innerHTML="<img src='photo_afrodiziak400/"+nom+"' border='0' >"
	document.getElementById("pop_msg").style.visibility="visible"
}
//
//
function change_coul_note(num) { //v9.0
	for (i=0;i<=10;i++){
		if (i<=num){
			document.getElementById("n"+i).style.backgroundColor="#C1599A"
		}else{
			document.getElementById("n"+i).style.backgroundColor="#FFCCCC"
		}
	}
}
//
//
function valid_note(visiteur,profil,note) { //v9.0
document.getElementById("note").innerHTML="Tu a mis "+note+"/10"
chaine="profil="+profil+"&visiteur="+visiteur+"&note="+note
//alert(chaine)
charge_page("up_note.asp","note_moy",chaine,"")
}
//
//
//
function charge_page_profil(page,profil,visiteur,var1,var2,pseudo){
document.getElementById("pop_msg").style.visibility="visible"
document.getElementById("pop_msg").innerHTML="<img src='img/fond_palette/chargement.png'>"
var xhr = getXhr()
// On défini ce qu'on va faire quand on aura la réponse
xhr.onreadystatechange = function(){

	if(xhr.readyState == 4){
		document.getElementById("pop_msg").innerHTML=xhr.responseText
	}
}
xhr.open("POST","page/"+page,true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');

var data="profil="+profil+"&visiteur="+visiteur+"&var1="+var1+"&var2="+var2+"&pseudo="+pseudo
xhr.send(data);
}
//
//
function demande_acces_div(profil){
	document.getElementById("pop_msg").innerHTML="<img src='img/fond_palette/chargement.png'>"
var xhr = getXhr()
// On défini ce qu'on va faire quand on aura la réponse
xhr.onreadystatechange = function(){
	if(xhr.readyState == 4){
	document.getElementById("pop_msg").style.visibility="hidden"
	document.getElementById("demande_acces").innerHTML='<img src="img/X.gif" width="15" align="absmiddle" alt="zone sexy priv&eacute;e"/> demande en cours'
	}
}
xhr.open("POST","page/demande_acces_div_ok.asp",true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');
var data="profil="+profil
xhr.send(data);
}
//
//
function cache_pop_profil(){
	document.getElementById("pop_msg").style.visibility="hidden"
	document.getElementById("pop_msg").innerHTML='img/fond_palette/chargement.png'
}
//
//
function supp_event(id){
	if (confirm("voulez vous vraiment supprimer l'evenement?")){
		
	location.href="mes_event.asp?supp_id="+id	
		
	}
}

function envoi_mailling_orga(id,codeA,codeB,alea){
	le_titre=escape(document.getElementById("titre").value)
	mailling=escape(document.getElementById("message").value)
	if (mailling==""){
		alert("Votre message est vide !")
	}else{
		var xhr = getXhr()
		// On défini ce qu'on va faire quand on aura la réponse
		xhr.onreadystatechange = function(){
			document.getElementById("reponse_mailling").innerHTML='<p align="center"><img src="img/attente3.gif"></p>'
			if(xhr.readyState == 4){
	document.getElementById("reponse_mailling").innerHTML='<br /><span class="or16bold">Messages PROMO &eacute;v&eacute;nement, envoy&eacute; avec succ&egrave;s</span><br />'
				
			}
		}
		xhr.open("POST","envoi_mailling_orga.asp",true);
		xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');
		var data="id="+id+"&titre="+le_titre+"&mailling="+mailling+"&codeA="+codeA+"&codeB="+codeB+"&alea="+alea
		xhr.send(data);
	}
}












//