// JavaScript Document
// JavaScript Document
function displayDate() {
	var this_month = new Array(12);
    this_month[0]  = "Enero";
    this_month[1]  = "Febrero";
    this_month[2]  = "Marzo";
    this_month[3]  = "Abril";
    this_month[4]  = "Mayo";
    this_month[5]  = "Junio";
    this_month[6]  = "Julio";
    this_month[7]  = "Agosto";
    this_month[8]  = "Septiembre";
    this_month[9]  = "Octubre";
    this_month[10] = "Noviembre";
    this_month[11] = "Diciembre";
	var this_day = new Array(7);
	 this_day[1] = "Lunes";
	 this_day[2]= "Martes";
	 this_day[3] = "Miércoles";
	 this_day[4] = "Jueves";
	 this_day[5] = "Viernes";
	 this_day[6] = "Sábado";
	 this_day[0] = "Domingo";
  var today = new Date();
  var date   = today.getDate();
  var month = today.getMonth();
  var day = today.getDay();
  var year  = today.getYear();
  if (year < 1000) {
    year += 1900;
  }
  return(this_day[day]+" - "+this_month[month]+" "+date+" - "+year);
}
function validarAsA(){
			var f = document.ingrA;
			var c = document.ingrA.eda;
			var c2 = document.ingrA.eda;
			//var c = "1"
			//var c2 = "1"
			var mail = document.ingrA.mail.value;
			var rg_mail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
			var rg_pass = /^\w{1,6}$/;
			for(var i=0;i<f.length;i++){
				f[i].value = Trim(f[i].value);
				if(f[i].value.length<2){
					alert("complete todos los campos");
					f[i].focus();
					return;
				}
			};
			if (rg_mail.test(mail)){
				puede = true;
			} else {
				alert("e-mail no valido");
				puede = false;
				f.mail.focus();
				return;
			};
			 if(rg_pass.test(c.value)){
				puede = true;
			}else{
				alert("No capital letters. Only (a - z), numbers (0 - 9)  //  (min 1 car).");
				puede = false;
				return;
			};
			if(c2.value !== c.value){
				alert("");
				puede = false;
				c2.focus();
				return;
			}else{
				puede = true;
			};
			if(puede){
				f.submit();
				for(i=0;i<f.length;i++){
					if(f[i].type != 'button' ){
						f[i].value = ""
					}
				
				}
			}			
		}
		function Trim(STRING){
			while(STRING.charAt((STRING.length -1))==" "){
				STRING = STRING.substring(0,STRING.length-1);
			};
			while(STRING.charAt(0)==" "){
				STRING = STRING.replace(STRING.charAt(0),"");
			}
			return STRING;
		}
		function validar(){
	if(document.form1.nombre.value.length <1){
		alert("Escriba su nombre por favor");
		document.form1.nombre.focus();
		return;
	}else if(document.form1.mail.value.length <1){
		alert("Ingrese su email");
		document.form1.mail.focus();
		return;
	};
	var mail = document.form1.mail.value;
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)){
		document.form1.submit();
	} else {
		alert("La dirección de email no es válida");
	return;
	}
}