//Valida fecha dd/MM/yyyy
function validaFecha( strValue ) {
  var objRegExp = /^\d{2}\/\d{2}\/\d{4}$/
  if(!objRegExp.test(strValue))
    return false;
  else {
    var arrayDate = strValue.split('/');
    var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,'08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}
    var intDay = parseInt(arrayDate[0],10);
    if(arrayLookup[arrayDate[1]] != null) {
      if(intDay <= arrayLookup[arrayDate[1]] && intDay != 0)
        return true;
    }
    var intMonth = parseInt(arrayDate[1],10);
    if (intMonth == 2) { 
       var intYear = parseInt(arrayDate[2],10);
		if( ((intYear % 4 == 0 && intDay <= 29) || (intYear % 4 != 0 && intDay <=28)) && intDay !=0)
          return true;
       }
  }
  return false;
}
function ocultarBio() {
 	document.getElementById("capaBio").style.display = "none";
	document.getElementById("capaNoBio").style.display = "block";
}
function mostrarBio() {
 	document.getElementById("capaNoBio").style.display = "none";
	document.getElementById("capaBio").style.display = "block";
}
function mostrarCaracteristicas() {
 	document.getElementById("capaCaracteristicas").style.display = "block";
	document.getElementById("capaLogistica").style.display = "none";
	document.getElementById("capaAdjuntos").style.display = "none";
}
function mostrarLogistica() {
 	document.getElementById("capaCaracteristicas").style.display = "none";
	document.getElementById("capaLogistica").style.display = "block";
	document.getElementById("capaAdjuntos").style.display = "none";
}
function mostrarPDF() {
 	document.getElementById("capaCaracteristicas").style.display = "none";
	document.getElementById("capaLogistica").style.display = "none";
	document.getElementById("capaAdjuntos").style.display = "block";
}
function Enviar(){
		Msg='';
		if (document.form.Nombre.value==""){
			Msg=Msg+'- Nombre \n';
			document.form.Nombre.focus();
		}
		if (document.form.Apellidos.value==""){
			Msg=Msg+'- Apellidos \n';
			document.form.Apellidos.focus();
		}
		if (document.form.Email.value==""){
			Msg=Msg+'- Email \n';
			document.form.Email.focus();
		}
		if (document.form.Consulta.value==""){
			Msg=Msg+'- Consulta \n';
			document.form.Consulta.focus();
		}
		
		if (Msg==''){
			if (document.form.condiciones.checked == false) {
				alert('Debe leer y aceptar las condiciones de privacidad.');
				return;
			}
			document.form.submit();
		}else{
			alert('Los siguientes campos son erroneos, \n'+
					'o deben contener valor. \n\n'+Msg);
		}
	}
	function cancelar(){
		document.form.reset();
	}