/* tirada */
<!-- Variables de estado -->
var baraja = new Array("major0.png","major1.png","major2.png","major3.png","major4.png","major5.png","major6.png","major7.png","major8.png","major9.png","major10.png","major11.png","major12.png","major13.png","major14.png","major15.png","major16.png","major17.png","major18.png","major19.png","major20.png","major21.png");

function darCarta(id){
	if(posicionMax >=posicion){
		var imagensrc = "img/cartas/" + baraja[id];
		$("#carta" + posicion).html("<img src=\"" + imagensrc + "\" width=\"56\" height=\"97\" class=\"cartaTirada\" alt=\"tarot carta "+posicion+1+"\"/>");
		posicion++;
	}
}

<!-- funcion para hacer aparecer el revalite mail  -->
function calcularAltura(){
	altura = $(window).height()/2 + $(window).scrollTop() - 120;
	return altura;
}

//funcion fadeToIn
function fadeIn(){
	//para #supercapa
	$("#superCapa").css("opacity", 0.00);
	$("#superCapa").css("visibility", "visible");
	$("#superCapa").fadeTo(500, 0.85);
	//para #cajaRevalidate
	calcularAltura
	$("#cajaRevalidate").css("top", calcularAltura()+"px");
	$("#cajaRevalidate").css("opacity", 0.00);
	$("#cajaRevalidate").css("visibility", "visible");
	$("#cajaRevalidate").fadeTo(500, 1.00);
}
//funcion fadeToOut
function fadeOut(){
	//para #supercapa
	$("#superCapa").fadeTo(500, 0.00, function ocultar() { $("#superCapa").css("visibility", "hidden"); });
	//para #cajaRevalidate
	$("#cajaRevalidate").fadeTo(500, 0.00, function ocultar() { $("#cajaRevalidate").css("visibility", "hidden"); });
	
}

<!-- envío del mail -->
//******************************
function NumTel(evt)
{
	if(navigator.appName == "Netscape")
	{
		
		if (evt.which == 32 || evt.which == 0  || evt.which == 8)  evt.preventDefault= true; 
		else if (evt.which < 48 || evt.which > 57) evt.preventDefault()// les nombre de 48 -> 57
	}

	if (navigator.appName=="Microsoft Internet Explorer")
	{ 
		 if (evt.keyCode == 32 || evt.keyCode == 8) evt.returnValue = true; // l'espace & précédent
		 else if (evt.keyCode < 48 || evt.keyCode > 57) evt.returnValue = false;
	}
}

			
function choisir(nom_fichier,id)
{
	
	document.getElementById('image_'+id).value=nom_fichier;
}



//*************test Nejem*********************
function ajx()
{
	var ajax;
	
	if(window.XMLHttpRequest) 
		  ajax = new XMLHttpRequest();
	 else if(window.ActiveXObject) 
		  ajax = new ActiveXObject("Microsoft.XMLHTTP");
	 else
		  return(false);
		  
	return ajax;      
	
}

function vld(){
	if($("#carta0 img").hasClass("cartaTirada") == true && $("#carta1 img").hasClass("cartaTirada") == true && $("#carta2 img").hasClass("cartaTirada") == true){
		valid();
	}else{
		alert("Choose three cards");
	}
}

function valid(){
	
	var nom=document.getElementById('nom'); 
	var prenom=document.getElementById('prenom');
	//var tel=document.getElementById('tel_portable');
	var email=document.getElementById('email');
	var message=document.getElementById('message');
	var sex=document.getElementById('sex');
	var jour=document.getElementById('jour').options[document.getElementById('jour').selectedIndex].value;
	var mois=document.getElementById('mois').options[document.getElementById('mois').selectedIndex].value;
	var annee=document.getElementById('annee').options[document.getElementById('annee').selectedIndex].value;
	var pays=document.getElementById('pays').options[document.getElementById('pays').selectedIndex].value;
	
	var validform= new ajx();
	var chaine="";
	
	initcntr();
	
	if(message.value=="")
	{
		document.getElementById('message').style.backgroundColor="#FFC";	
		alert("Question's Field is empty");
		message.focus();
		return false;		
	}
	
	if(nom.value==""){
		alert("Name's Field is empty");
		nom.focus();
		return false;		
	}
	
	if(prenom.value==""){
		alert("Last Name's Field is empty");
		prenom.focus();
		return false;		
	}
	
	/*if(tel.value=="")
	{
		format_tel();
		tel.focus();
		return false;		
	}*/

	if(email.value=="")
	{
		mail_format(1);
		email.focus();
		return false;		
	}
	
	if(pays=="")
	{
		alert("Country's Field is empty");
		document.getElementById("pays").focus();
		return false;		
	}
	
	
	/*if(isNaN(tel.value))
	{
		format_tel();
		tel.focus();
		return false;		
	}*/


		

	if(sex.selectedIndex==0)
	{
		alert("Sex's Field is empty");
		sex.focus();
		return false;		
	}
	
	
	//Comprobamos si se ha marcado el check de privacidad.
	if (document.forms[0].cbx_privacidad.checked===false)        
	{
  		alert("You must accept the privacy Policy");
		return false;	
	}
	
	chaine="?nom="+nom.value+"&prenom="+prenom.value+"&email="+email.value+"&sex="+sex.value+"&pays="+pays+"&jour="+jour+"&mois="+mois+"&annee="+annee;
	
	//alert(chaine);
	
	 validform.open("GET", "library/php/verif_form.php"+chaine, false);
     validform.send(null);
	
     if(validform.readyState == 4) 
     {
	     
     		if(validform.responseText!='')
     		{
	     		
	     		
	     		eval(validform.responseText);
	     		return false;
	     		
     		}else{
	     		fadeIn();
	     		
				document.getElementById('email_vrf').focus();

     		}
		 }else return(false);
		 
	
return false;
}

function format_tel()
{
	alert("Mobile's Field is empty");
	document.getElementById('tel_portable').focus();
	document.getElementById('tel_portable').style.backgroundColor="#FFC";
}

function anniv()
{
	alert("Over 18s only");
	document.getElementById('annee').focus();
	document.getElementById('annee').style.backgroundColor="#FFC";
	
}

function mail_format(i)
{
	
	
	if(i==1) {
		alert("Emails's Field is empty");
	}else if(i==2){
		 alert("Emails's Field is empty");
	 }else
	 alert("Error on the E-mail Confirmation");
	 
	document.getElementById('email').focus();
	document.getElementById('email').style.backgroundColor="#FFC";	
}

function initcntr()
{
	
	
	var ln=document.form.length;
	
	for(i=0;i<ln;i++)
	document.form.elements[i].style.backgroundColor="";
	
}


function verifmail()
{
	if(document.getElementById('email').value!=document.getElementById('email_vrf').value)
		{
			fadeOut();
			mail_format(3);
		}else{
			
		document.form.submit();	
			
		}
}
