function getMailto(mail){
	document.location.href="mailto:"+mail;
}
function getToContact(){
	document.location.href="pageSondage.php?item=contact";
}
function goToSondage(){
	document.location.href="pagesondage.php?item=indexsondage";
}
function goToForum(){
	document.location.href="pageforum.php?item=indexforum";
}

function cgOpen(a){
var param = 'status:no;scroll:yes;resizable:no;help:no;dialogWidth:600px;dialogHeight:700px;';
var lien = 'propcg.php?lang='+a;
	window.showModalDialog(lien, "", param)
}

function ctrl_Contact(){
	n = document.getElementsByName('nom')[0];
	lang = document.getElementsByName('lang')[0];
	m = document.getElementsByName('email')[0];
	msg = document.getElementsByName('message')[0];

	msgNom = "Veuillez saisir votre nom";
	msgMail = "Veuillez saisir votre e-mail";
	msgMailValide = "Entrez une adresse e-mail valide !";
	msgMessage = "Veuillez saisir votre message";

	if(n.value == ""){
		alert(msgNom);
		n.focus();
		return 0;
	}
	if(m.value == ""){
		alert(msgMail);
		m.focus();
		return 0;
	}
	if ((m.value != "")&&(!VerifMail(m.value))){
		alert(msgMailValide);
		m.focus();
		return 0;	
	}
	if(msg.value == ""){
		alert(msgMessage);
		msg.focus();
		return 0;
	}else{
		document.rent.submit();
	}
}


function laDateDujour(){ 

/*

SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT

http://www.editeurjavascript.com

*/

navvers = navigator.appVersion.substring(0,1);

if (navvers > 3)

	navok = true;

else

	navok = false;



today = new Date;

jour = today.getDay();

numero = today.getDate();

if (numero<10)

	numero = "0"+numero;

mois = today.getMonth();

if (navok)

	annee = today.getFullYear();

else

	annee = today.getYear();

TabJour = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");

TabMois = new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","aout","sept.","octobre","nov.","déc.");

messageDate = TabJour[jour] + " " + numero + " " + TabMois[mois] + " " + annee;
return messageDate;
}

function retourSimple(){
	history.back();
}
function goVoter(){
	document.location="pageSondage.php?item=voter";
}
function ctrl_sondes(){
document.sondes.submit();
}
function ctrl_insertQuestion(){
	var p = document.getElementsByName('pays')[0];
	var id = document.getElementsByName('identifiant')[0];
	var pass = document.getElementsByName('password')[0];
	var quest = document.getElementsByName('question')[0];	
	var rep = document.getElementsByName('reponse')[0];	
	fcompte = file('verifcompte.php?ident='+escape(id.value)+'&pass='+escape(pass.value));

	msgPays="Veuillez choisir le pays";
	msgId="Veuillez renseigner votre identifiant";
	msgRep="Veuillez saisir votre réponse";
	msgPass="Veuillez saisir votre mot de passe";
	msgQuest="Veuillez saisir votre question";
		
	if(p.value == ""){
		alert(msgPays);
		p.focus();
		return 0;
	}	
	if(id.value == ""){
		alert(msgId);
		id.focus();
		return 0;
	}
	if(pass.value == ""){
		alert(msgPass);
		pass.focus();
		return 0;
	}
	if(fcompte == 1){
		alert("Vous n'etes pas encore inscrit sur notre site\nMerci de vous inscrire !");
		ident.focus();
		return 0;
	}
	if(quest.value == ""){
		alert(msgQuest);
		quest.focus();
		return 0;
	}
	if(rep.value == ""){
		alert(msgRep);
		rep.focus();
		return 0;
	}
	else{
		document.fproposer.submit();
	}

}
function ctrl_insertMessage(){
	var p = document.getElementsByName('pays')[0];
	var id = document.getElementsByName('identifiant')[0];
	var pass = document.getElementsByName('password')[0];
	var msg = document.getElementsByName('message')[0];	
	var suj = document.getElementsByName('sujet')[0];	
	fcompte = file('../../sondage/africain/verifcompte.php?ident='+escape(id.value)+'&pass='+escape(pass.value));


	msgPays="Veuillez choisir le pays";
	msgId="Veuillez renseigner votre identifiant";
	msgMsg="Veuillez saisir votre message";
	msgPass="Veuillez saisir votre mot de passe";
	msgSuj="Veuillez saisir votre sujet";
		
	if(p.value == ""){
		alert(msgPays);
		p.focus();
		return 0;
	}	
	if(id.value == ""){
		alert(msgId);
		id.focus();
		return 0;
	}
	if(pass.value == ""){
		alert(msgPass);
		pass.focus();
		return 0;
	}
	if(fcompte == 1){
		alert("Vous n'etes pas encore inscrit sur notre site\nMerci de vous inscrire !");
		ident.focus();
		return 0;
	}
	if(suj.value == ""){
		alert(msgSuj);
		suj.focus();
		return 0;
	}
	if(msg.value == ""){
		alert(msgMsg);
		msg.focus();
		return 0;
	}
	else{
		document.fdepotmsg.submit();
	}
}
function ctrl_insertParticulier(){

	var p = document.getElementsByName('pays')[0];
	var n = document.getElementsByName('nationalite')[0];
	var v = document.getElementsByName('ville')[0];
	var pass1 = document.getElementsByName('password')[0];
	var pass2 = document.getElementsByName('password2')[0];	
	var m = document.getElementsByName('mail')[0];
	var titre = document.getElementsByName('titre')[0];
	var an = document.getElementsByName('an')[0];
	var csp = document.getElementsByName('csp')[0];
	var ident = document.getElementsByName('identifiant')[0];

	msgPays="Veuillez choisir le pays";
	msgIdent="Veuillez renseigner votre identifiant";
	msgNat="Veuillez choisir votre nationalité";
	msgMail="Veuillez renseigner l'adresse mail";
	msgVille="Veuillez choisir la ville";
	msgPass="Veuillez saisir le mot de passe";
	msgPass2="Veuillez retaper le mot de passe";
	msgPass12="Veuillez saisir le même mot de passe";
	msgPrenom="Veuillez saisir le prénom";
	msgMailValide="Entrez une adresse e-mail valide !";
	msgCsp="Veuillez choisir une catégorie socio-professionnelle";
	msgAn="Veuillez choisir votre année de naissance";
	msgTitre="Veuillez choisir votre civilité";
		
	if(titre.value == ""){
		alert(msgTitre);
		titre.focus();
		return 0;
	}	
	if(ident.value == ""){
		alert(msgIdent);
		ident.focus();
		return 0;
	}				
	if(m.value == ""){
		alert(msgMail);
		m.focus();
		return 0;
	}				
	if((m.value != "")&&(!VerifMail(m.value))){
		alert(msgMailValide);
		m.focus();
		return 0;
	}		
	if(m.value != ""){
		fmail = file('verifmail.php?adresse='+escape(m.value));
		if(fmail == 2){
			alert("Ce compte mail existe déjà");
			m.focus();
			return 0;
		}
	}
	if(pass1.value == ""){
		alert(msgPass);
		pass1.focus();
		return 0;
	}
	if(pass2.value == ""){
		alert(msgPass2);
		pass2.focus();
		return 0;
	}
	if(pass1.value != pass2.value){
		alert(msgPass12);
		pass2.focus();
		return 0;
	}
	if(an.value == ""){
		alert(msgAn);
		an.focus();
		return 0;
	}
	if(csp.value == ""){
		alert(msgCsp);
		csp.focus();
		return 0;
	}		
	/*if(v.value == ""){
		alert(msgVille);
		v.focus();
		return 0;
	}
		*/
	if(p.value == ""){
		alert(msgPays);
		p.focus();
		return 0;
	}	
	if(n.value == ""){
		alert(msgNat);
		n.focus();
		return 0;
	}
	else{
		document.ciblage.submit();
	}
}

function ctrl_envoiContact(){
	n = document.getElementsByName('nom')[0];
	lang = document.getElementsByName('lang')[0];
	m = document.getElementsByName('mail')[0];
	s = document.getElementsByName('sujet')[0];
	msg = document.getElementsByName('message')[0];

	msgNom = "Veuillez saisir votre nom";
	msgMail = "Veuillez saisir votre e-mail";
	msgMailValide = "Entrez une adresse e-mail valide !";
	msgSujet = "Veuillez saisir le sujet";
	msgMessage = "Veuillez saisir votre message";

	if(n.value == ""){
		alert(msgNom);
		n.focus();
		return 0;
	}
	if(m.value == ""){
		alert(msgMail);
		m.focus();
		return 0;
	}
	if ((m.value != "")&&(!VerifMail(m.value))){
		alert(msgMailValide);
		m.focus();
		return 0;	
	}
	if(s.value == ""){
		alert(msgSujet);
		s.focus();
		return 0;
	}
	if(msg.value == ""){
		alert(msgMessage);
		msg.focus();
		return 0;
	}else{
		document.contact.submit();
	}
}

function ctrl_katula()
{
	m = document.getElementsByName('email')[0];
	msgMail = "Veuillez saisir votre e-mail";
	fcompte = file('../pages/verifkatula.php?mail='+escape(m.value));
		
	if(m.value == ""){
		alert(msgMail);
		m.focus();
		return 0;
	}
	
	if(fcompte == 1){
		alert("Cet email n'existe pas");
		m.focus();
		return 0;
	}else{
		//document.voter.submit();
	//	document.location="okmanga.php?idmail="+fcompte;
		document.location="okmanga.php?mail="+m.value;
	}
}
function ctrl_envoipass(arg)
{
	m = document.getElementsByName('mail')[0];
	msgMail = "Veuillez saisir votre e-mail";
	msgMailValide = "Entrez une adresse e-mail valide !";
	if (arg=="sondage"){
	fmail = file('verifcomptemail.php?mail='+escape(m.value));
	} else {
	fmail = file('../../sondage/africain/verifcomptemail.php?mail='+escape(m.value));
	}
	if(m.value == ""){
		alert(msgMail);
		m.focus();
		return 0;
	}
	if ((m.value != "")&&(!VerifMail(m.value))){
		alert(msgMailValide);
		m.focus();
		return 0;		
	}
	if(fmail == 1){
		alert("Cette adresse mail n'existe pas sur notre site\nInscrivez-vous !");
		m.focus();
		return 0;
	}else{
	if (arg=="sondage"){
		document.location="pagesondage.php?item=envoipass&compte="+fmail;
		} else {
		document.location="pageforum.php?item=envoipass&compte="+fmail;
		}
	}

}
function ctrl_login()
{
	ident = document.getElementsByName('identifiant')[0];
	p = document.getElementsByName('password')[0];
	msgIdent = "Veuillez saisir votre identifiant";
	//msgMailValide = "Entrez une adresse e-mail valide !";
	msgPassword = "Veuillez saisir votre mot de passe";
//	fcompte = file('verifcompte.php?mail='+escape(m.value)+'&pass='+escape(p.value));
	fcompte = file('verifcompte.php?ident='+escape(ident.value)+'&pass='+escape(p.value));

	if(ident.value == ""){
		alert(msgIdent);
		ident.focus();
		return 0;
	}
	/*if ((m.value != "")&&(!VerifMail(m.value))){
		alert(msgMailValide);
		m.focus();
		return 0;	
	}*/
	if(p.value == ""){
		alert(msgPassword);
		p.focus();
		return 0;
	}
	if(fcompte == 1){
		alert("Ce compte n'existe pas");
		m.focus();
		return 0;
	}else{
		document.location="pagesondage.php?item=votersondage&electeur="+fcompte;
	}
}
function goEnvoipass(){
		document.location="pagesondage.php?item=fpass";
}

function ctrl_comptef(){
		document.location="pageforum.php?item=askcompte";
}
function goEnvoipassf(){
		document.location="pageforum.php?item=fpass";
}
function ctrl_compte(arg)
{
	ident = document.getElementsByName('identifiant')[0];
	pass = document.getElementsByName('password')[0];
	msgIdent = "Veuillez saisir votre identifiant";
	msgPass = "Veuillez saisir votre mot de passe";
	if (arg=="forum") {
	fcompte = file('../../sondage/africain/verifcompte.php?ident='+escape(ident.value)+'&pass='+escape(pass.value));
	} else {
	fcompte = file('verifcompte.php?ident='+escape(ident.value)+'&pass='+escape(pass.value));
}
	if(ident.value == ""){
		alert(msgIdent);
		ident.focus();
		return 0;
	}
	if(pass.value == ""){
		alert(msgPass);
		pass.focus();
		return 0;
	}
	if(fcompte == 1){
		alert("Cet identifiant n'existe pas sur notre site\nInscrivez-vous !");
		ident.focus();
		return 0;
	}else{
	if (arg=="sondage") {
		document.location="pagesondage.php?item=compte&idcompte="+fcompte;
		} else {
		document.location="pageforum.php?item=compte&idcompte="+fcompte;
		}
	}
}
function ctrl_askcompte()
{
	document.location="pagesondage.php?item=askcompte";
}
/*
function ctrl_comptePass()
{
//	m = document.getElementsByName('email')[0];
	ident = document.getElementsByName('identifiant')[0];
	msgMail = "Veuillez saisir votre e-mail";
	msgMailValide = "Entrez une adresse e-mail valide !";
	fmail = file('verifcomptemail.php?mail='+escape(m.value));

	if(ident.value == ""){
		alert(msgMail);
		ident.focus();
		return 0;
	}
	if ((m.value != "")&&(!VerifMail(m.value))){
		alert(msgMailValide);
		m.focus();
		return 0;		
	}
	if(fmail == 1){
		alert("Cette adresse mail n'existe pas sur notre site\nInscrivez-vous !");
		m.focus();
		return 0;
	}else{
		document.location="pagesondage.php?item=compte&compte="+fmail;
	}
}
*/
/*
function VerifMail(mail)
{
	valide = false;
	for(var j=1;j<(mail.length);j++){
		if(mail.charAt(j)=='@'){
			if(j<(mail.length-4)){
				for(var k=j;k<(mail.length-2);k++){
					if(mail.charAt(k)=='.') valide=true;
				}
			}
		}
	}
	return valide;
}
*/
function VerifMail(email)
{
/*
	valide = true;
 //  	var verif 	= /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
   	var verif 	= /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
   	if (verif.exec(email) == null)
	{
		valide = false;
	}
	return valide;
	*/
	var reg = /^([a-zA-Z0-9_-])+([.]?[a-zA-Z0-9_-]{1,})*@([a-zA-Z0-9-_]{2,}[.])+[a-zA-Z]{2,3}$/;
    return (reg.test(email));

}

function isNumberKey(){
	var charCode = event.keyCode;
	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;
	return true;
}
function isLettreValablePourNom(){
	var charCode = event.keyCode;
	var ok = true;
	var tabCode = new Array(33,34,35,36,37,38,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,91,93,94,95,96,123,124,125,126,167,176,178);
	for (var i=0;i<tabCode.length;i++){
		if(charCode == tabCode[i]){
			ok = false;
			break;
		}
	}
	if (!ok)
		return false;
	
	return true;
}

function appli()

{

  newWindow=open("","inscription","width=340,height=120,scrolling=no,resizable=no,scrollbars=yes");

  newWindow.focus() ;

}

function click() {
	if (event.button==2) {
		alert('Pas de Clique droit sur cette page');
	}
}
function confirmVote()
{
	var v = document.getElementsByName('idvote');
	var q = document.getElementsByName('idquestion')[0];
	var idv = document.getElementsByName('votant')[0];
	var code = document.getElementsByName('codevote')[0];
	var test = document.getElementsByName('testcodevote')[0];
	var nb = v.length;
	var j=0;
	var idvote;
	for (var i=0; i<nb;i++)
	{
		if(!v[i].checked){
			j++;
		}else{
			idvote=v[i].value;
		}
	}
	if(j==nb){
		alert("Veuiller cocher votre vote !");
		return 0;
	}
	if(test.value == ""){
		alert("veuillez recopier le code de sécurité, \n en respectant les majuscules");
		return 0;
	}
	if (test.value != ""){
		if (code.value != test.value){
			alert("Le code recopié n'est pas exact, \nveuillez recommencer en respectant les majuscules");
			return 0;
		}
	}
	if(confirm("Etes vous sûre de confirmer votre vote ?")){
		//document.votequestion.submit();
		document.location='pagesondage.php?item=avotersondage&votant='+idv.value+'&monvote='+idvote+'&laquestion='+q.value;
	}
}

 function file(fichier)
 {
	 if(window.XMLHttpRequest) // FIREFOX
		  xhr_object = new XMLHttpRequest(); 
	 else if(window.ActiveXObject) // IE
		  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	 else 
		  return(false); 
	 xhr_object.open("GET", fichier, false); 
	 xhr_object.send(null); 
	 if(xhr_object.readyState == 4) return(xhr_object.responseText);
	 else return(false);
 }
function verifvotant(pays, question, votant)
{
	fvotant = file('verifelecteur.php?id='+escape(votant)+'&question='+question);

	if(fvotant == 2){
		alert("Vous avez déjà voter !");
		return 0;
	}else{
		document.location='pagesondage.php?item=voterreponsesondage&idquestion='+question+'&votant='+votant+'&idpays='+pays;
	}
}
var nAjoutligne=2;
function ajout()
{
	nAjoutligne++;
	if(nAjoutligne<=10){
		idajoutligne.innerHTML+="<table width='100%' cellpadding=0 cellspacing=0><tr><td width=25%'>Réponse"+nAjoutligne+"</td><td width=75%'><input type='text' name='reponse" + nAjoutligne+"' " + " /></td></tr></table>";
	}
}
function writediv(texte, inputName)
{
    document.getElementById(inputName).innerHTML = texte;
}
function getDivModif(div1, div2){
	var	tr1 = document.getElementById(div1);
	var	tr2 = document.getElementById(div2);
	
	tr1.style.display="block";
	tr2.style.display="none";
} 
function annuleblocpass(){
	getDivModif("vueblocpass", "modifblocpass");
}
function annuleblocville(){
	getDivModif("vueblocville", "modifblocville");
}
function annuleblocCsp(){
	getDivModif("vuebloccsp", "modifbloccsp");
}
function annuleblocpays(){
	getDivModif("vueblocpays", "modifblocpays");
}
function verifComptePass(){
	var id = document.getElementsByName('id')[0];
	var pass1 = document.getElementsByName('pass1')[0];
	var pass2 = document.getElementsByName('pass2')[0];	
	msgPass="Veuillez saisir le mot de passe";
	msgPass2="Veuillez retaper le mot de passe";
	msgPass12="Veuillez saisir le même mot de pass";

	//texte=file('../commun/setsocietestructure.php?id='+escape(id.value)+'&cap='+escape(cap.value)+'&eff='+escape(eff.value));

	if(pass1.value == ""){
		alert(msgPass);
		pass1.focus();
		return 0;
	}
	if(pass2.value == ""){
		alert(msgPass2);
		pass2.focus();
		return 0;
	}
	if(pass1.value != pass2.value){
		alert(msgPass12);
		pass2.focus();
		return 0;
	}else{
		setpass = file('setpassword.php?id='+escape(id.value)+'&pass='+escape(pass1.value));
		//annuleblocpass();
		document.location="pagesondage.php?item=compte&compte="+id.value;
	}

}
function verifCompteVille(){
	var id = document.getElementsByName('id')[0];
	var ville = document.getElementsByName('ville')[0];
	msgVille="Veuillez saisir la ville";

	if(ville.value == ""){
		alert(msgVille);
		ville.focus();
		return 0;
	}
	else{
		setville = file('setville.php?id='+escape(id.value)+'&ville='+escape(ville.value));
		document.location="pagesondage.php?item=compte&compte="+id.value;
	}

}
function verifCompteCsp(){
	var id = document.getElementsByName('id')[0];
	var csp = document.getElementsByName('csp')[0];
	msgCsp="Veuillez saisir la categorie socio professionnelle";

	if(csp.value == ""){
		alert(msgCsp);
		csp.focus();
		return 0;
	}
	else{
		setcsp = file('setcsp.php?id='+escape(id.value)+'&csp='+escape(csp.value));
	//	alert(setcsp);
		document.location="pagesondage.php?item=compte&compte="+id.value;
	}
}
function verifComptePays(){
	var id = document.getElementsByName('id')[0];
	var pays = document.getElementsByName('pays')[0];
	msgPays="Veuillez saisir votre pays de résidence";

	if(pays.value == ""){
		alert(msgPays);
		pays.focus();
		return 0;
	}
	else{
		setpays = file('setpays.php?id='+escape(id.value)+'&pays='+escape(pays.value));
		document.location="pagesondage.php?item=compte&compte="+id.value;
	}
}
function modifComptePassword(id){	
		mytrville='<table width="100%" border="0">';
		mytrville+='<tr>';
		mytrville+='<td align="right" width="48%">Votre mot de passe :</td>';
		mytrville+='<td align="left" width="2%">&nbsp;</td>';
		mytrville+='<td align="left" width="50%"><input type="text" name="pass1"></td>';
		mytrville+='</tr>';
		mytrville+='<tr>';
		mytrville+='<td align="right" width="48%">Retaper votre mot de :</td>';
		mytrville+='<td align="left" width="2%">&nbsp;</td>';
		mytrville+='<td align="left" width="50%"><input type="text" name="pass2"></td>';
		mytrville+='</tr>';
		mytrville+='<tr>';
		mytrville+='<td align="right" colspan="2"><input type="hidden" value="'+id+'" name="id"></td>';
		mytrville+='<td align="center" width="50%"><span onclick="annuleblocpass();" style="cursor:hand">[ Annuler ]</span>&nbsp;&nbsp;&nbsp;<span onclick="verifComptePass()" style="cursor:hand">[ Valider ]</span></td>';
		mytrville+='</tr>';
		mytrville+='</table>';	

		writediv(mytrville, 'idmodifblocpass');
		
		getDivModif('modifblocpass', 'vueblocpass');
}
function modifCompteVille(id){	
		mytrville='<table width="100%" border="0">';
		mytrville+='<tr>';
		mytrville+='<td align="right" width="48%">Votre ville de résidence :</td>';
		mytrville+='<td align="left" width="2%">&nbsp;</td>';
		mytrville+='<td align="left" width="50%"><input type="text" name="ville"></td>';
		mytrville+='</tr>';
		mytrville+='<tr>';
		mytrville+='<td align="right" colspan="2"><input type="hidden" value="'+id+'" name="id"></td>';
		mytrville+='<td align="center" width="50%"><span onclick="annuleblocville();" style="cursor:hand">[ Annuler ]</span>&nbsp;&nbsp;&nbsp;<span onclick="verifCompteVille()" style="cursor:hand">[ Valider ]</span></td>';
		mytrville+='</tr>';
		mytrville+='</table>';	

		writediv(mytrville, 'idmodifblocville');
		
		getDivModif('modifblocville', 'vueblocville');
}

function modifCompteCsp(id){	

		listcsp=file('getCsp.php');

		var mytab = new Array();
		var nb = listcsp.length;

		mytrville='<table width="100%" border="0">';
		mytrville+='<tr>';
		mytrville+='<td align="right" class="lbltitre" width="48%">Votre categorie socio profesionnelle :';
		mytrville+='</td>';
		mytrville+='<td align="left" width="2%">&nbsp;</td>';
		mytrville+='<td align="left" class="lbltitre" width="50%">';
		mytrville+='<select name="csp" style="width:200px;" class="lblchamp">';
		mytrville+='<option value="">Choisir une csp</option>';
		mytrville+='<option value="">- - - - - - - - - - -</option>';
			for (var j=0; j<nb;j++){
				x = listcsp.indexOf("$");
				ligne = listcsp.substring(0,x);

					if (ligne == ""){
						break;
					}
				myligne = ligne.split(',');
				idom = myligne[0];
				ldom = myligne[1];
				mytrville+=	'<option class="lblchamp" value="'+idom+'">'+ldom+'</option>';
		
				listcsp = listcsp.substring(x+1);
			}
			
		mytrville+='</select>';
		mytrville+='</td>';
		mytrville+='</tr>';
		mytrville+='<tr>';
		mytrville+='<td align="right" colspan="2"><input type="hidden" value="'+id+'" name="id"></td>';
		mytrville+='<td align="center" width="50%"><span onclick="annuleblocCsp();" style="cursor:hand">[ Annuler ]</span>&nbsp;&nbsp;&nbsp;<span onclick="verifCompteCsp()" style="cursor:hand">[ Valider ]</span></td>';
		mytrville+='</tr>';
		mytrville+='</table>';	

		writediv(mytrville, 'idmodifbloccsp');
		
		getDivModif('modifbloccsp', 'vuebloccsp');
}

function modifComptePays(id){	

		listpays=file('getpays.php');

		var mytab = new Array();
		var nb = listpays.length;

		mytrville='<table width="100%" border="0">';
		mytrville+='<tr>';
		mytrville+='<td align="right" class="lbltitre" width="48%">Votre pays de résidence :';
		mytrville+='</td>';
		mytrville+='<td align="left" width="2%">&nbsp;</td>';
		mytrville+='<td align="left" class="lbltitre" width="50%">';
		mytrville+='<select name="pays" style="width:200px;" class="lblchamp">';
		mytrville+='<option value="">Choisir un pays</option>';
		mytrville+='<option value="">- - - - - - - - - - -</option>';
			for (var j=0; j<nb;j++){
				x = listpays.indexOf("$");
				ligne = listpays.substring(0,x);

					if (ligne == ""){
						break;
					}
				myligne = ligne.split(',');
				idom = myligne[0];
				ldom = myligne[1];
				mytrville+=	'<option class="lblchamp" value="'+idom+'">'+ldom+'</option>';
		
				listpays = listpays.substring(x+1);
			}
			
		mytrville+='</select>';
		mytrville+='</td>';
		mytrville+='</tr>';
		mytrville+='<tr>';
		mytrville+='<td align="right" colspan="2"><input type="hidden" value="'+id+'" name="id"></td>';
		mytrville+='<td align="center" width="50%"><span onclick="annuleblocpays();" style="cursor:hand">[ Annuler ]</span>&nbsp;&nbsp;&nbsp;<span onclick="verifComptePays()" style="cursor:hand">[ Valider ]</span></td>';
		mytrville+='</tr>';
		mytrville+='</table>';	

		writediv(mytrville, 'idmodifblocpays');
		
		getDivModif('modifblocpays', 'vueblocpays');
}
function creerSondage(){
	var code = document.getElementsByName('code')[0];
	var r = file('../metier/setcode.php');
	//if(code.value==r){
		if(confirm("Etes vous sûre d'enregistrer la question ?")){
			document.creersondage.submit();
		}
	//}
}
function seloguer(){
			document.identification.submit();
}
function modifierSondage(){

	var nb_accueil=document.getElementsByName('nbaccueil')[0];
	var flag_accuei1_oui=document.getElementById('accoui').checked;
	var flag_accueil_non=document.getElementById('accnon').checked;
	
	if ((nb_accueil.value == 3) && (flag_accuei1_oui==true)){
		alert("Il ne doit y avoir que 3 sondages sur la page d'accueil");
	}
	else{
		document.modifiersondage.submit();
	}
}
function IsAnnuleSondage(){

	alert("Vous allez annuler ce sondage !!");

}
