function controlerCONTACT() {
	var erreur = '';
    ctl = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/;
    if (document.mailsender.sender.value.search(ctl) == -1) { erreur = 'Votre adresse mail n\'est pas valide.' + '\n'; }
	if (!document.mailsender.sujet.value) { erreur += 'Vous devez spécifier un sujet à votre message.' + '\n';	}
	if (!document.mailsender.message.value) { erreur += 'Vous devez spécifier un message.'; }
	
	if (!erreur) { document.mailsender.sujet.disabled=true; return true; }
    else { alert(erreur); return false; }
}
function popmailingwindow(){
  window.open('','mailingwindow','width=300, height=150, scrollbars=1');
}
function actdesact() 
{ 
    if (document.proposition.ishomme.checked) {
        document.proposition.pfch1.disabled=true;
		document.proposition.pfch2.disabled=true;
		document.proposition.pfch3.disabled=true;
        document.proposition.pfch4.checked='checked';
		}
    else {
        document.proposition.pfch1.disabled=false;
		document.proposition.pfch1.checked='checked';
		document.proposition.pfch2.disabled=false;
		document.proposition.pfch3.disabled=false;
        document.proposition.pfch4.disabled=false;
		}
} 
function flashTest(Anim)
{
	//detection de flash !!
	var UseFlash = 0;
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
	{
	 var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
	 if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=3)
		UseFlash = 1;
	}
	else if (navigator.appName && navigator.appName.indexOf("Microsoft")!= -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
	{
	 UseFlash = 1;
	}
	if (UseFlash) 
	{
	 //visiteur a flash!! bien !!
	 if (Anim == 1) {
		document.write("<div id='flashcontent'></div>");
		var so = new SWFObject("regardx.swf", "regardx", "288", "75", "7", "#85A4CC");
		so.addParam("quality", "low");
		so.addParam("loop", "false");
		so.write("flashcontent");
	 }
	  if (Anim == 2) {
		document.write("<div id='flashcontente'></div>");
		var so = new SWFObject("images.swf", "icones", "482", "125", "7", "#85A4CC");
		so.addParam("quality", "low");
		so.write("flashcontente");
	 }
	 if (Anim == 3) {
		document.write("<div id='flashcontentee'></div>");
		var so = new SWFObject("accueil.swf", "presentation", "550", "220", "7", "#85A4CC");
		so.addParam("quality", "low");
		so.addParam("loop", "false");
		so.addParam("wmode", "transparent");
		so.write("flashcontentee");
	 }
	}
}
function open_chat() {
   if (document.getElementById("chat").age.value == 0)
   {
   alert ("Vous devez spécifier âge");return;
   }

   if (document.getElementById("chat").ville.value == "SDF")
   {
   alert ("Vous devez spécifier la région");return;
   }
   if (document.getElementById("chat").pseudo.value.length == 0) 
   { 
   alert ("Vous devez spécifier un pseudo");return;
   }
   else{ 
    pseudo = document.getElementById("chat").pseudo.value ;
    age = document.getElementById("chat").age.value ;
    if (document.getElementById("chat").sexe[0].checked==true)
		{ sexe = "h"; }
		else { sexe = "f"; }
    ville = document.getElementById("chat").ville.value ;
    province = document.getElementById("chat").province.value ;
    if (screen.width <= 800) {
	applet_size = 1
    }
    else {
	applet_size = 2
    }
	if (applet_size == 1) {
	    window_app = 
"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=800,height=550";
	} else {
	    window_app = 
"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=920,height=620";
	}
	url="chat.php?nick="+escape(pseudo)+"&age="+escape(age)+"&sexe="+escape(sexe)+"&ville="+escape(ville)+"&province="+escape(province)+"&lesite=http://regardX.com&tous_salons=%23sexe,&letitre=regardX.com Le paradis du X amateur.&mainbg=%2385A4CC&mainfg=%23000000&textbg=%23FFFF99&selbg=%23FFFF99&selfg=%23FFFF99&con_salon=&con_age=&infos=infos_cu&rbutton=0&radio=0&ledomain=regardX.co";

	window.open(url, "chat", window_app);
  return;
 }
}
function verif_post() {
	if(document.getElementById('post_pseudo').value.length < 3){
		alert('Votre pseudo est trop court');
		return false;
	}
	if(! check_email(document.getElementById('post_email').value)){
		alert('Votre adresse email n\'est pas valide');
		return false;
	}
	if(document.getElementById('post_password').value.length < 4){
		alert('Votre mot de passe doit contenir au minimum 4 caractères');
		return false;
	}
	if(!document.getElementById('post_titre').value){
		alert('Votre devez spécifier le titre de votre galerie.');
		return false;
	}
	if(document.getElementById('post_message').value.length < 50){
		alert('Votre message est trop court');
		return false;
	}
	if(document.getElementById('post_message').value.length > 200){
		alert('Votre message est trop long');
		return false;
	}
	if(!document.getElementById('post_certificat').checked){
		alert('Vous devez certifier que les photos vous appartiennent');
		return false;
	}
	return true;
}
function check_email(t){
  var test_email = /^[\w-\.]{2,}@[\w-]{1,}\./;
  return test_email.test(t);
}
function ejs_nodroit() { return(false); } 
document.oncontextmenu = ejs_nodroit; 

function calcCharLeft(target) {
	if (target.value.length < 50) { document.getElementById("msg_stat").innerHTML = "Il est trop court"; }
	else if (target.value.length >= 200) { target.value = target.value.substring(0,200); document.getElementById("msg_stat").innerHTML = "Vous avez atteint le maximum"; }
	else { document.getElementById("msg_stat").innerHTML = "Vous pouvez l'envoyer"; }
	document.getElementById("msg_len").innerHTML = target.value.length;
}


function redir()  { setTimeout("pdv()", 3000); }
function pdv()  { window.location = 'http://visios-tchat.com'; }


function pop_msg(img, txt)	{
	var url = 'http://outils.yes-messenger.com/download.php?tracker=regardX&id=44499&picType=sexy&img_path=' + img + '&pseudo=' + txt;
	window.open(url,"YesMessenger" , "toolbar=0,status=0,menubar=0,titlebar=0,scrollbars=0,resizable=0, top="+(screen.height-740)/2+", left="+(screen.width-710)/2+",width=710,height=620");
 
}
