
var hauteurFenetre = 75;	// Hauteur de la popup
var largeurFenetre = 270;	// Largeur de la popup
var topFenetre = (window.screen.height - hauteurFenetre) / 4;			// Distance du haut de la fenetre
var leftFenetre= (window.screen.width - largeurFenetre) / 2;	// Distance du bord gauche de la fenetre

var hauteurBarretitre = 21; // Hauteur de la barre de titre
var couleurHaut = "#0058f3"	// Couleur de la barre de titre	
var couleurBas = "#FFFFFF"	// Couleur du corps de la fenetre

var texteBarretitre = "<b>&nbsp;Erreur </b>"	// Texte qui apparait dans la barre de titre
var policeBarretitre = "Arial"					// Police dans la barre de titre
var taillePoliceBarretitre = "12"				// taille de la police dans la barre de titre
var couleurPoliceBarretitre = "#FFFFFF"			// Couleur du texte de la barre de titre

var texteCorps = "Voici la nouvelle popup dhtml<br>"	// Texte du corps de la popup
texteCorps += "Vous pouvez y insérer du code html<br>"	// Editable sur plusieurs lignes
texteCorps += "et même des formulaires<br>"
texteCorps += "<center><input type=text></center>"
var policeCorps = "Arial"								// Police du corps de la popup
var taillePoliceCorps = "12"							// Taille du texte
var couleurPoliceCorps = "#000000"


function mail_valide (email) {
  return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email);
}
function popup_erreur(txt) {
   	texteBarretitre = "<b>&nbsp;Programme happy card </b>"
	largeurFenetre = 250
	hauteurFenetre = 75 
	code = '';
	code += '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="width:250px;">';
	code += '<tr><td align="center"><div style="padding-right:0px;margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;margin-bottom:10px;">' + txt + '</div></td></tr>';
	code += '<tr><td align="center"><p><a href="javascript:javascript:fermerPopup();"><img src="fileadmin/template/main/images/bouton_fermez.gif" style="border:none;padding:2px;margin:0px;" /></a></p></td></tr>';
	code += '</table>';
	texteCorps = code;
	if (document.getElementById('div_erreur')) {
	
		document.getElementById('div_erreur').style.display = "";
		document.getElementById('div_erreur').style.visibility = "visible";
		/*document.getElementById('div_erreur').style.display = "block;";
		document.getElementById('div_erreur').style.visibility = "visible;";*/
		code = '<style type="text/css">';
		code += 'table.popup {';
		code += '	border: 1px solid #0058f3;}';
		code += 'td.titre {';
		code += '	font-family: '+policeBarretitre+';';
		code += '	font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';}';
		code += '	color: '+couleurPoliceBarretitre+';}';
		code += 'td.corps {';
		code += '	font-family: '+policeCorps+';';
		code += '	font-size: '+taillePoliceCorps+'px;';
		code += '	color: '+couleurPoliceCorps+';}';
		code += '</style>';
		code += '<div id=pop_up STYLE="z-index:100;position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;">';
		code += '<table style="border: 1px solid #0058f3;" width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0" class="popup">';
		/*
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #0058f3;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		*/
		
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		code += '<tr>';
		code += '<td  id="handle_pop_up" bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="padding-left:21px;cursor: move;	font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';">' + texteBarretitre +'</td>';
		code += '<td bgcolor="'+couleurHaut+'" style="padding:2px;" class="titre" width="13" height="'+hauteurBarretitre+'"><a href="javascript:fermerPopup()" style="font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';"><img src="fileadmin/template/main/images/iconClose.png" style="border:none;padding:0px;margin:0px;" /></a></td>';
		code += '</tr>';
		code += '<tr valign="top">';
		code += '<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>';
		code += '</tr>';
		code += '</table>';
		code += '</div>';
		document.getElementById('div_erreur').innerHTML = code;
		
		new Draggable('pop_up', {
	    	handle: 'handle_pop_up'
	  	});

		var strChUserAgent = navigator.userAgent;
		var intSplitStart = strChUserAgent.indexOf("(",0);
		var intSplitEnd = strChUserAgent.indexOf(")",0);
		var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
		
		if(strChMid.indexOf("MSIE 6") != -1) {
		  	var inputs=document.getElementsByTagName("input");
		  	for(var i=0;i<inputs.length;i++){
			  	 inputs[i].style.visibility = 'hidden';
		  	}
		  	var selects=document.getElementsByTagName("select");
		  	for(var i=0;i<selects.length;i++){
			  	 selects[i].style.visibility = 'hidden';
		  	}
	  	}
	}
}

function popup_no_burn(){
	txt = "Nous sommes désolés, mais malheureusement vous ne pouvez plus accéder à la commande d'une carte cadeau ou à la réalisation d'un don. Nous vous remercions de bien vouloir contacter votre Conseiller happy card au 0 820 099 040 (0.12 &euro; TTC/mn)."
	popup_erreur(txt);
}

function popup_popup_erreur(txt) {
   	texteBarretitre = "<b>&nbsp;Programme happy card </b>"
	largeurFenetre = 250
	hauteurFenetre = 75 
	code = '';
	code += '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="width:250px;">';
	code += '<tr><td align="center"><div style="padding-right:0px;margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;margin-bottom:10px;">' + txt + '</div></td></tr>';
	code += '<tr><td align="center"><p><a href="javascript:javascript:fermerPopup();"><img src="fileadmin/template/main/images/bouton_fermez.gif" style="border:none;padding:2px;margin:0px;" /></a></p></td></tr>';
	code += '</table>';
	texteCorps = code;
	if (document.getElementById('div_erreur')) {
	
		document.getElementById('div_erreur').style.display = "";
		document.getElementById('div_erreur').style.visibility = "visible";
		/*document.getElementById('div_erreur').style.display = "block;";
		document.getElementById('div_erreur').style.visibility = "visible;";*/
		code = '<style type="text/css">';
		code += 'table.popup {';
		code += '	border: 1px solid #0058f3;}';
		code += 'td.titre {';
		code += '	font-family: '+policeBarretitre+';';
		code += '	font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';}';
		code += '	color: '+couleurPoliceBarretitre+';}';
		code += 'td.corps {';
		code += '	font-family: '+policeCorps+';';
		code += '	font-size: '+taillePoliceCorps+'px;';
		code += '	color: '+couleurPoliceCorps+';}';
		code += '</style>';
		code += '<div id=pop_up STYLE="z-index:100;position:absolute; top:'+ ((document.body.offsetHeight - hauteurFenetre) / 4 ) +'px; left:'+ ((document.body.offsetWidth - largeurFenetre) / 2 ) +'px;">';
		code += '<table style="border: 1px solid #0058f3;" width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0" class="popup">';
		/*
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #0058f3;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		*/
		
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		code += '<tr>';
		code += '<td  id="handle_pop_up" bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="padding-left:21px;cursor: move;	font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';">' + texteBarretitre +'</td>';
		code += '<td bgcolor="'+couleurHaut+'" style="padding:2px;" class="titre" width="13" height="'+hauteurBarretitre+'"><a href="javascript:fermerPopup()" style="font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';"><img src="fileadmin/template/main/images/iconClose.png" style="border:none;padding:0px;margin:0px;" /></a></td>';
		code += '</tr>';
		code += '<tr valign="top">';
		code += '<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>';
		code += '</tr>';
		code += '</table>';
		code += '</div>';
		document.getElementById('div_erreur').innerHTML = code;
		
		new Draggable('pop_up', {
	    	handle: 'handle_pop_up'
	  	});

		var strChUserAgent = navigator.userAgent;
		var intSplitStart = strChUserAgent.indexOf("(",0);
		var intSplitEnd = strChUserAgent.indexOf(")",0);
		var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
		
		if(strChMid.indexOf("MSIE 6") != -1) {
		  	var inputs=document.getElementsByTagName("input");
		  	for(var i=0;i<inputs.length;i++){
			  	 inputs[i].style.visibility = 'hidden';
		  	}
		  	var selects=document.getElementsByTagName("select");
		  	for(var i=0;i<selects.length;i++){
			  	 selects[i].style.visibility = 'hidden';
		  	} 
	  	}
	}
}

function popup_confirm(txt) {
   	texteBarretitre = "<b>&nbsp;Programme happy card </b>"
	largeurFenetre = 350
	hauteurFenetre = 75 
	code = '';
	code += '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="width:350px;">';
	code += '<tr><td align="center"><div style="padding-right:0px;margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;margin-bottom:10px;">' + txt + '</div></td></tr>';
	code += '<tr><td align="center"><p><a href="javascript:javascript:fermerPopup();"><img src="fileadmin/template/main/images/bouton_fermez.gif" style="border:none;padding:2px;margin:0px;" /></a></p></td></tr>';
	code += '</table>';
	texteCorps = code;
	if (document.getElementById('div_erreur')) {
	
		document.getElementById('div_erreur').style.display = "";
		document.getElementById('div_erreur').style.visibility = "visible";
		/*document.getElementById('div_erreur').style.display = "block;";
		document.getElementById('div_erreur').style.visibility = "visible;";*/
		code = '<style type="text/css">';
		code += 'table.popup {';
		code += '	border: 1px solid #0058f3;}';
		code += 'td.titre {';
		code += '	font-family: '+policeBarretitre+';';
		code += '	font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';}';
		code += '	color: '+couleurPoliceBarretitre+';}';
		code += 'td.corps {';
		code += '	font-family: '+policeCorps+';';
		code += '	font-size: '+taillePoliceCorps+'px;';
		code += '	color: '+couleurPoliceCorps+';}';
		code += '</style>';
		code += '<div id=pop_up STYLE="z-index:100;position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;">';
		code += '<table style="border: 1px solid #0058f3;" width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0" class="popup">';
		/*
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #0058f3;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		*/
		
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		code += '<tr>';
		code += '<td  id="handle_pop_up" bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="padding-left:21px;cursor: move;	font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';">' + texteBarretitre +'</td>';
		code += '<td bgcolor="'+couleurHaut+'" style="padding:2px;" class="titre" width="13" height="'+hauteurBarretitre+'"><a href="javascript:fermerPopup()" style="font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';"><img src="fileadmin/template/main/images/iconClose.png" style="border:none;padding:0px;margin:0px;" /></a></td>';
		code += '</tr>';
		code += '<tr valign="top">';
		code += '<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>';
		code += '</tr>';
		code += '</table>';
		code += '</div>';
		document.getElementById('div_erreur').innerHTML = code;
		
		new Draggable('pop_up', {
	    	handle: 'handle_pop_up'
	  	});

		var strChUserAgent = navigator.userAgent;
		var intSplitStart = strChUserAgent.indexOf("(",0);
		var intSplitEnd = strChUserAgent.indexOf(")",0);
		var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
		
		if(strChMid.indexOf("MSIE 6") != -1) {
		  	var inputs=document.getElementsByTagName("input");
		  	for(var i=0;i<inputs.length;i++){
			  	 inputs[i].style.visibility = 'hidden';
		  	}
		  	var selects=document.getElementsByTagName("select");
		  	for(var i=0;i<selects.length;i++){
			  	 selects[i].style.visibility = 'hidden';
		  	} 
	  	}
	}
}


function popup_acceder_espace(txt, url){
  windowWidth = 270
  windowHeight = 75 
  var centerWidth = (window.screen.width - windowWidth) / 2;
  var centerHeight = (window.screen.height - windowHeight) / 2.5;
	
  
  //hc_popup_espace = window.open('about:blank','popup' + Math.random().toString().slice(2) ,'width='+ windowWidth +',height='+ windowHeight +',left='+ centerWidth +',top='+ centerHeight +',toolbar=no,location=no');
  
	/*
  var code = '<html><head><title>Erreur</title></head>';
  code += '<body bgcolor="#ffffff" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">';
  code += '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">';
  code += '<tr><td align="center"><div style="margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;">' + txt + '</div></td></tr>';
  code += '<tr><td align="center"><p><a href="javascript:window.opener.location.href=\''+ url +'\';window.close();"><img src="fileadmin/template/main/images/acceder_espace_hc.png" style="border:none;padding:0px;margin:0px;"></img></a></p></td></tr>';
  code += '</table></body>';
  code += '</html>';
  hc_popup_espace.document.write(code);*/
}
  
// ------------------------NE PAS EDITER SOUS CETTE LIGNE----------------------//

function fermerPopup() {
	document.getElementById('div_erreur').style.display = "none";
	document.getElementById('div_erreur').style.visibility = "hidden";
	document.getElementById('div_erreur').innerHTML = "";
	
	var strChUserAgent = navigator.userAgent;
	var intSplitStart = strChUserAgent.indexOf("(",0);
	var intSplitEnd = strChUserAgent.indexOf(")",0);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
	
	if(strChMid.indexOf("MSIE 6") != -1) {	
	  	var inputs=document.getElementsByTagName("input");
	  	for(var i=0;i<inputs.length;i++){
		  	 inputs[i].style.visibility = 'visible';
	  	}
		var selects=document.getElementsByTagName("select");
		for(var i=0;i<selects.length;i++){
		 	selects[i].style.visibility = 'visible';
		} 
	}
}

function popup_acceder_espace_tst(txt,url) {
	code = '';
	code += '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">';
	code += '<tr><td align="center"><div style="margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;margin-bottom:10px;">' + txt + '</div></td></tr>';
	code += '<tr><td align="center"><p><a href="javascript:window.location.href=\''+ url +'\';"><img src="fileadmin/template/main/images/acceder_espace_hc.png" style="border:none;padding:0px;margin:0px;"></img></a></p></td></tr>';
	code += '</table>';
	texteCorps = code;
	if (document.getElementById('div_erreur')) {
		code = '<style type="text/css">';
		code += 'table.popup {';
		code += '	border: 1px solid #0058f3;}';
		code += 'td.titre {';
		code += '	font-family: '+policeBarretitre+';';
		code += '	font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';}';
		code += '	color: '+couleurPoliceBarretitre+';}';
		code += 'td.corps {';
		code += '	font-family: '+policeCorps+';';
		code += '	font-size: '+taillePoliceCorps+'px;';
		code += '	color: '+couleurPoliceCorps+';}';
		code += '</style>';
		code += '<div id=pop_up STYLE="z-index:100;position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;">';
		code += '<table style="border: 1px solid #0058f3;" width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0" class="popup">';
		/*
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #0058f3;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		*/
		
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		code += '<tr>';
		code += '<td id="handle_pop_up" bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="cursor: move;	font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';">' + texteBarretitre +'</td>';
		code += '<td style="padding:2px;" bgcolor="'+couleurHaut+'" class="titre" width="13" height="'+hauteurBarretitre+'"><a href="javascript:fermerPopup()" style="font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';"><img src="fileadmin/template/main/images/iconClose.png" style="border:none;padding:0px;margin:0px;" /></a></td>';
		code += '</tr>';
		code += '<tr valign="top">';
		code += '<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>';
		code += '</tr>';
		code += '</table>';
		code += '</div>';
		document.getElementById('div_erreur').innerHTML = code;
		
		new Draggable('pop_up', {
	    	handle: 'handle_pop_up'
	  	});
	}
}


function popup_res() {
	
	texteBarretitre = "<b>&nbsp;Programme happy card </b>"
	txt = '<p style=\'text-align: justify ;line-height:12px;padding:5px;padding-top:0px;font-weight:normal;\'><b>Nous avons bien pris en compte votre demande de résiliation. Un email de confirmation vous sera envoyé d\'ici quelques jours.';
	txt += "<br /><br />"; 
	txt += "A bientôt,";
	txt += "<br /><br />";
	txt += "Elisa Jo&euml;lle</b><br />";
	
	txt += "<i>Responsable du programme de fidélité happy card</i></p>";
	code = '';
	code += '<table width="100%" height="100%"  style="width:350px;" cellpadding="0" cellspacing="0" border="0">';
	code += '<tr><td align="center"><div style="margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;margin-bottom:10px;">' + txt + '</div></td></tr>';
	code += '<tr><td align="center"><p><a href="#" onclick="javascript:window.location.href=\'index.php\';"><img src="fileadmin/template/main/images/bouton_fermez.gif" style="border:none;padding:0px;margin:0px;"></img></a></p></td></tr>';
	code += '</table>';
	texteCorps = code;
	if (document.getElementById('div_erreur')) {
		code = '<style type="text/css">';
		code += 'table.popup {';
		code += '	border: 1px solid #0058f3;}';
		code += 'td.titre {';
		code += '	font-family: '+policeBarretitre+';';
		code += '	font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';}';
		code += '	color: '+couleurPoliceBarretitre+';}';
		code += 'td.corps {';
		code += '	font-family: '+policeCorps+';';
		code += '	font-size: '+taillePoliceCorps+'px;';
		code += '	color: '+couleurPoliceCorps+';}';
		code += '</style>';
		code += '<div id=pop_up STYLE="z-index:1000;position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;">';
		code += '<table style="border: 1px solid #0058f3;" width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0" class="popup">';
		/*
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #0058f3;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		*/
		
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		code += '<tr>';
		code += '<td id="handle_pop_up" bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="cursor: move;	font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';">' + texteBarretitre +'</td>';
		code += '<td style="padding:2px;" bgcolor="'+couleurHaut+'" class="titre" width="13" height="'+hauteurBarretitre+'"><a  href="#" onclick="javascript:window.location.href=\'index.php\';" style="font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';"><img src="fileadmin/template/main/images/iconClose.png" style="border:none;padding:0px;margin:0px;" /></a></td>';
		code += '</tr>';
		code += '<tr valign="top">';
		code += '<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>';
		code += '</tr>';
		code += '</table>';
		code += '</div>';
		
		document.getElementById('div_erreur').innerHTML = code;
		document.getElementById('div_erreur').style.display = '';
		document.getElementById('div_erreur').style.visibility = 'visible';
		
		document.getElementById('div_erreur').innerHTML = code;
		
		new Draggable('pop_up', {
	    	handle: 'handle_pop_up'
	  	});

	}
}

function popup_res_non_conf() {

	

	texteBarretitre = "<b>&nbsp;Programme happy card </b>"
	txt += '<p style=\'text-align: justify ;line-height:12px;padding:5px;padding-top:0px;font-weight:normal;\'><b>Un problème est survenu lors de votre résiliation. Veuillez contacter votre conseiller happy card au ';
	txt += "</p>";
	code = '';
	code += '<table width="100%" height="100%"  style="width:350px;" cellpadding="0" cellspacing="0" border="0">';
	code += '<tr><td align="center"><div style="margin-top:15px;font-family:Arial, Helvetica, sans-serif;font-size:11px;color:#000000;font-weight:bold;margin-bottom:10px;">' + txt + '</div></td></tr>';
	code += '<tr><td align="center"><p><a href="#" onclick="javascript:window.location.href=\'index.php\';"><img src="fileadmin/template/main/images/bouton_fermez.gif" style="border:none;padding:0px;margin:0px;"></img></a></p></td></tr>';
	code += '</table>';
	texteCorps = code;
	if (document.getElementById('div_erreur')) {
		code = '<style type="text/css">';
		code += 'table.popup {';
		code += '	border: 1px solid #0058f3;}';
		code += 'td.titre {';
		code += '	font-family: '+policeBarretitre+';';
		code += '	font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';}';
		code += '	color: '+couleurPoliceBarretitre+';}';
		code += 'td.corps {';
		code += '	font-family: '+policeCorps+';';
		code += '	font-size: '+taillePoliceCorps+'px;';
		code += '	color: '+couleurPoliceCorps+';}';
		code += '</style>';
		code += '<div id=pop_up STYLE="z-index:1000;position:absolute; top:'+topFenetre+'px; left:'+leftFenetre+'px;">';
		code += '<table style="border: 1px solid #0058f3;" width="'+largeurFenetre+'"  height="'+hauteurFenetre+'" border="0" cellspacing="0" cellpadding="0" class="popup">';
		/*
		document.write('<style type="text/css">')
		document.write('table.popup {')
		document.write('	border: 1px solid #0058f3;}')
		document.write('td.titre {')
		document.write('	font-family: '+policeBarretitre+';')
		document.write('	font-size: '+taillePoliceBarretitre+'px;')
		document.write('	color: '+couleurPoliceBarretitre+';}')
		document.write('td.corps {')
		document.write('	font-family: '+policeCorps+';')
		document.write('	font-size: '+taillePoliceCorps+'px;')
		document.write('	color: '+couleurPoliceCorps+';}')
		document.write('</style>')
		*/
		
		largeurFenetre -= hauteurBarretitre
		hauteurFenetre -= hauteurBarretitre
		code += '<tr>';
		code += '<td id="handle_pop_up" bgcolor="'+couleurHaut+'" class="titre" width="'+largeurFenetre+'" height="'+hauteurBarretitre+'" style="cursor: move;	font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';">' + texteBarretitre +'</td>';
		code += '<td style="padding:2px;" bgcolor="'+couleurHaut+'" class="titre" width="13" height="'+hauteurBarretitre+'"><a  href="#" onclick="javascript:window.location.href=\'index.php\';" style="font-weight:bold;font-family: '+policeBarretitre+';font-size: '+taillePoliceBarretitre+'px;color: '+couleurPoliceBarretitre+';"><img src="fileadmin/template/main/images/iconClose.png" style="border:none;padding:0px;margin:0px;" /></a></td>';
		code += '</tr>';
		code += '<tr valign="top">';
		code += '<td bgcolor="'+couleurBas+'" width="'+largeurFenetre+'" height="'+hauteurFenetre+'" colspan="2" class="corps">'+texteCorps+'</td>';
		code += '</tr>';
		code += '</table>';
		code += '</div>';
		
		document.getElementById('div_erreur').innerHTML = code;
		document.getElementById('div_erreur').style.display = '';
		document.getElementById('div_erreur').style.visibility = 'visible';
		
		new Draggable('pop_up', {
	    	handle: 'handle_pop_up'
	  	});
	}
}

function comp_equal(str1 , str2){
  
  if(str1 == str2 && str1 != ""){
    return true;
  }
  return false;
}

function isNumeric(sText){
  var ValidChars = "0123456789.";
  var IsNumber=true;
  var Char;
  
  if(sText.length == 0){
  	return false;
  }
  
  for (i = 0; i < sText.length && IsNumber == true; i++){
    Char = sText.charAt(i);
    if (ValidChars.indexOf(Char) == -1){
      IsNumber = false;
    }
  }
  return IsNumber;
} 

function trim (myString)
{
	return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
} 

function mdp_valide(mdp) {
	var i = 0;
	var intValues = new Array();
	var myTab = new Array();
	
	for(i = 0; i <= 9; i++) {
		myTab[i] = 0;
	}
	if(!isNumeric(mdp)){
		return false;
	}
	if(mdp.length!=6){
		return false;
	}
	for(i = 0; i < mdp.length; i++) {
		intValues[i] = parseInt(mdp[i]);
		myTab[intValues[i]]++;

		if(myTab[intValues[i]] > 2){
			return false;
		}
	}
	for(i = 0; i < mdp.length-2; i++) {
		var diff1 = Math.abs(intValues[i+1] - intValues[i]);
		var diff2 = Math.abs(intValues[i+2] - intValues[i+1]);

		if(diff1 == 1 && diff2 == 1){
			return false;
		} else if(diff1 == 0 || diff2 == 0){
			return false;
		}
	}

	var dateTab = [
		parseInt(mdp.slice(0,2)),
		parseInt(mdp.slice(2,4)),
		parseInt(mdp.slice(4,6))
	];

	for(i=0;i<3;i++){
		if(dateTab[i] < 12 && dateTab[i] > 1){
			for(var j=0;j<3;j++){
				if(dateTab[i] < 31 && dateTab[i] > 1) {
					return false;
				}
			}
		}
	}
	return true;
}

function button_correction()
{
	var len;
		
	if ((len = $('pwd').value.length) >= 1) // Si taille du champs "code" >=1     --->  condition d'arret substring(0,0)
		$('pwd').value = $('pwd').value.substring(0, len - 1); // On supprime 1 charactère
}


function mouse_over_auth(img, path)
{
	img.src = path;
}

/**
 * Fonctions pour gérer l'événement "onmouseout" <img>
 *
 * @author Camille Frappin <cfrappin@groupe-belink.fr>
 * @param img	se réfère a "this" et permet de pointer vers la balise <img>
 * @param path	le chemin de la nouvelle source de la balise <img> 
 * @return void 
 */
function mouse_out_auth(img, path)
{
	img.src = path;
}

/**
 * Fonctions pour gérer l'événement "onClick" des <img>
 *
 * @author Camille Frappin <cfrappin@groupe-belink.fr>
 * @param value		chiffre que l'on veux rajouter
 * @param max_len	nombre de chiffres autorisés 
 * @return void 
 */
function click_auth(value, max_len)
{
	if ($('pwd').value.length < max_len) // si la taille du champs "code" < taille autorisée
		$('pwd').value+= value; // On insère le chiffre value dans le champs "code"
}

function select_question(e){
	if(e.parentNode.className!='li_selected'){
		reponses_li = $('questions_li').getElementsByTagName('li');
		for (var i = 0; i < reponses_li.length; i++) { 
    		reponses_li[i].className = 'li_normal';
		}
	}
	all_li = e.parentNode.parentNode.getElementsByTagName('li');
	for (var i = 0; i < all_li.length; i++) { 
    	all_li[i].className = 'li_normal';
	}
	e.parentNode.className='li_selected';
	e.blur();
}
function faq_infos(e){
	$('questions_infos').style.visibility="visible";
	$('questions_programme').style.visibility="hidden";
	$('questions_carte').style.visibility="hidden";
	$('questions_points').style.visibility="hidden";
	$('questions_infos').style.display="";
	$('questions_programme').style.display="none";
	$('questions_carte').style.display="none";
	$('questions_points').style.display="none";
	$('bloc_display_none').style.visibility="hidden";
	select_question(e);
}

function faq_programme(e){
	$('questions_infos').style.visibility="hidden";
	$('questions_programme').style.visibility="visible";
	$('questions_carte').style.visibility="hidden";
	$('questions_points').style.visibility="hidden";
	$('questions_infos').style.display="none";
	$('questions_programme').style.display="";
	$('questions_carte').style.display="none";
	$('questions_points').style.display="none";
	$('bloc_display_none').style.visibility="hidden";
	select_question(e);
}

function faq_carte(e){
	$('questions_infos').style.visibility="hidden";
	$('questions_programme').style.visibility="hidden";
	$('questions_carte').style.visibility="visible";
	$('questions_points').style.visibility="hidden";
	$('questions_infos').style.display="none";
	$('questions_programme').style.display="none";
	$('questions_carte').style.display="";
	$('questions_points').style.display="none";
	$('bloc_display_none').style.visibility="hidden";
	select_question(e);

}

function faq_points(e){
	$('questions_infos').style.visibility="hidden";
	$('questions_programme').style.visibility="hidden";
	$('questions_carte').style.visibility="hidden";
	$('questions_points').style.visibility="visible";
	$('questions_infos').style.display="none";
	$('questions_programme').style.display="none";
	$('questions_carte').style.display="none";
	$('questions_points').style.display="";
	$('bloc_display_none').style.visibility="hidden";
	select_question(e);
}

function question_infos(nb_reponse,e){
	$('bloc3').style.display = "";
	HideReponses();
	var type_question = "infos";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="visible";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.display="";
	select_question(e);
}

function question_programme(nb_reponse,e){
	$('bloc3').style.display = "";
	HideReponses();
	var type_question = "programme";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="visible";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.display="";
	select_question(e);
}

function question_carte(nb_reponse,e){
	$('bloc3').style.display = "";
	HideReponses();
	var type_question = "carte";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="visible";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.display="";
	select_question(e);
}

function question_points(nb_reponse,e){
	$('bloc3').style.display = "";
	HideReponses();
	var type_question = "points";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="visible";
	$('reponse_'+ type_question +'_' + nb_reponse ).style.display="";
	select_question(e);
}

function HideReponses(){
	var type_question = "infos";
	for (nb_reponse=1; nb_reponse<=8; nb_reponse++) {
		if($('reponse_'+ type_question +'_' + nb_reponse )){
			$('reponse_'+ type_question +'_' + nb_reponse ).style.display="none";
			$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="hidden";
		}
	}
	type_question = "programme";
	for (nb_reponse=1; nb_reponse<=5; nb_reponse++) {
		if($('reponse_'+ type_question +'_' + nb_reponse )){
			$('reponse_'+ type_question +'_' + nb_reponse ).style.display="none";
			$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="hidden";
		}
	}
	type_question = "carte";
	for (nb_reponse=1; nb_reponse<=10; nb_reponse++) {
		if($('reponse_'+ type_question +'_' + nb_reponse )){
			$('reponse_'+ type_question +'_' + nb_reponse ).style.display="none";
			$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="hidden";
		}
	}
	type_question = "points";
	for (nb_reponse=1; nb_reponse<=6; nb_reponse++) {
		if($('reponse_'+ type_question +'_' + nb_reponse )){
			$('reponse_'+ type_question +'_' + nb_reponse ).style.display="none";
			$('reponse_'+ type_question +'_' + nb_reponse ).style.visibility="hidden";
		}
	}
}