function HabilitaText(idproducto,nombreproducto){
			$("#numcel").removeAttr("disabled");
			$("#email").removeAttr("disabled");	
			$("#idproducto").attr("value",idproducto);
			$("#nombreproducto").attr("value",nombreproducto);			
	}

function ValidarPromocion(){
		
		
		var tel=$("#numcel").val();
		var email=$("#email").val();
		var idproducto=$("#idproducto").val();
		var nombreproducto=$("#nombreproducto").val();
		

		if(tel==""){
			alert("Ingresa tu número telefónico");
		}else if(tel.length<10){
			alert("El numero no puede ser menor  10 digitos");
		}else if(!/^([0-9])*$/.test(tel)==true){
			alert("Solo se permite numeros");
		}else if(Valmail(email)==false){
			
		}else{
			$.ajax({
	        	type: "POST",
	        	url: "../tiempoaire/validarpromocion.php?tel="+tel+"&email="+email+"&idproducto="+idproducto+"&nombreproducto="+nombreproducto,
	        	beforeSend: function(objeto){
	        			$("#mensaje").hide();
	        			$("#botonValida").html("<img border=0 src=../img_secciones/tiempoaire/PASO2botoninhabilitado.jpg>");
	        			$("#validacion").show();
	        	},
	        	success: function(datos){
	        			//$("#botonValida").html("<img border=0 src=../img_secciones/tiempoaire/PASO2boton.jpg onClick=ValidarPromocion(); >");
	             		$("#validacion").html(datos);
	         	}
	    	});
	    }

}

function validarSiNumero(numero){
	if (!/^([0-9])*$/.test(numero))
		alert("Solo se permiten numeros");
}


function Valmail(str) {

    var at="@"
    var dot=".";
    var lat=str.indexOf(at)
    var lstr=str.length
    var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Ingrese un formato de email válido")
	   return false
	}

 	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Ingrese un formato de email válido")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    alert("Ingrese un formato de email válido")
	    return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	    alert("Ingrese un formato de email válido")
	    return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    alert("Ingrese un formato de email válido")
	    return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	    alert("Ingrese un formato de email válido")
	    return false
	 }
		
	 if (str.indexOf(" ")!=-1){
	    alert("Ingrese un formato de email válido")
	    return false
	 }

	 return true					
}