// JavaScript Document
var params = {
	quality: "high",
    scale: "noscale",
    wmode: "transparent",
    allowscriptaccess: "always",
    bgcolor: "#7DD3EF"
};
var flashvars = {
    fb_apiKey: "640854fdc42a616ee1ddf29f307cf9e8"            
};
var attributes = {
    id: "my_flash",
    name: "my_flash"
};


function limpia(elemento)
{
	elemento.value = "";
}

function validarFormulario () {
   
	var p1 = document.getElementById("nombre").value;
  	var p2 = document.getElementById("email").value;
  	var p3 = document.getElementById("edad").value;
  
  	if (p1.length == 0 || p1=="Nombre" || p2.length == 0 || p2=="Correo" || p3.length == 0 || p3=="Edad")
  	{
  		alert("Debes de llenar todos los datos");
   		return false;
  	}
	
	re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/
    if(!re.exec(p2))    {
		alert("Debes de introducir un valor real de mail");
       	return false;
    }else{
       	//return true;
    }
}


function nofan()
{
	var p4 = document.getElementById("no_fan").value;
	
	if (p4.length == 0 || p4 == "Número de fan")
	{
		alert("Debes de proporcionar tu Número de fan");
		return false;
	}
}

function validarRecupera()
{
	var p5 = document.getElementById("email").value;
	
	if (p5.length == 0 || p5 == "email")
	{
		alert("Debes de proporcionar tu email");
		return false;
	}
	
	re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/
    if(!re.exec(p5))    {
		alert("Debes de introducir un valor real de mail");
       	return false;
    }else{
       	//return true;
    }
}

function validarIdea()
{
	var p6 = document.getElementById("titulo").value;
	var p7 = document.getElementById("categoria").value;
	var p8 = document.getElementById("descripcion").value;
	var p9 = document.getElementById("nombre").value;
	
	if (p6.length == 0 || p6 == "título de idea" || p7 == 0 || p8.length == 0 || p9.length == 0 || p9 == "nombre")
	{
		alert("Debes de llenar todos los campos");
		return false;
	}
}

function validarHuella()
{
	var p10 = document.getElementById("pwd").value;
	
	if (p10.length == 0)
	{
		alert("Por favor coloca tu nombre");
		return false;
	}
}

function validarHuella2()
{
	var s="no";
	for (var i=0; i<document.uno.llave_banio.length; i++)
	{
		if (document.uno.llave_banio[i].checked ){
			s= "si";
			break;
		}
	}
	if (s=="no"){
		alert("Debe seleccionar alguna respuesta") ;
		return false;
	}
}

function validarHuella3()
{
	var s2="no";
	for (var i=0; i<document.dos.llave_lavabo.length; i++)
	{
		if (document.dos.llave_lavabo[i].checked ){
			s2= "si";
			break;
		}
	}
	if (s2=="no"){
		alert("Debe seleccionar alguna respuesta") ;
		return false;
	}	
}

function validarHuella4()
{
	var s3="no";
	for (var i=0; i<document.tres.sistema_duo.length; i++)
	{
		if (document.tres.sistema_duo[i].checked ){
			s3= "si";
			break;
		}
	}
	if (s3=="no"){
		alert("Debe seleccionar alguna respuesta") ;
		return false;
	}	
}

function validarHuella5()
{
	var s4="no";
	for (var i=0; i<document.cuatro.llenas_lavadora.length; i++)
	{
		if (document.cuatro.llenas_lavadora[i].checked ){
			s4= "si";
			break;
		}
	}
	if (s4=="no"){
		alert("Debe seleccionar alguna respuesta") ;
		return false;
	}	
}

function validarHuella6()
{
	var s5="no";
	for (var i=0; i<document.cinco.como_auto.length; i++)
	{
		if (document.cinco.como_auto[i].checked ){
			s5= "si";
			break;
		}
	}
	if (s5=="no"){
		alert("Debe seleccionar alguna respuesta") ;
		return false;
	}	
}

function validarNoticia()
{
	var p11 = document.getElementById("titulo").value;
	var p12 = document.getElementById("region").value;
	var p13 = document.getElementById("categoria").value;
	var p14 = document.getElementById("descripcion").value;
	
	if (p11.length == 0 || p12 == 0 || p13 == 0 || p14.length == 0)
	{
		alert("Debes de llenar todos los campos");
		return false;
	}
}

function validarVotacion()
{
	var p15 = document.getElementById("nombre").value;
	var p16 = document.getElementById("no_fan").value;
	
	if (p15.length == 0 || p15 == "nombre" || p16 == 0 || p16 == "No. de fan")
	{
		alert("Debes de llenar todos los campos");
		return false;
	}
}

function validarComentarios()
{
	var p17 = document.getElementById("nombre").value;
	var p18 = document.getElementById("no_fan").value;
	var p19 = document.getElementById("comentario").value;
	
	if (p17.length == 0 || p17 == "Nombre" || p18 == 0 || p18 == "No. de Fan (clave)" || p19 == 0 || p19 == "Deja tu comentario")
	{
		alert("Debes de llenar todos los campos");
		return false;
	}
}






