// JavaScript Document
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//-->
function over(cual, color){
	document.getElementById(cual).style.background= '#F9F9F9';
}
function out(cual, color){
	document.getElementById(cual).style.background= '#FFFFFF';
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
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 validarL(){
			var f = document.ingresoL;
			var c ="123456"
			var c2 ="123456"
			var c = document.ingresoL.contra;
			var c2 = document.ingresoL.contra2;
			var c ="123456"
			var c2 ="123456"
			var mail = document.ingresoL.mail.value;
			var rg_mail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
			var rg_pass = /^\w{6,10}$/;
			for(var i=0;i<f.length;i++){
				f[i].value = Trim(f[i].value);
				if(f[i].value.length<2){
					alert("Debe completar todos los campos de este formulario");
					f[i].focus();
					return;
				}
			};
			if (rg_mail.test(mail)){
				puede = true;
			} else {
				alert("Debe ingresar una dirección de e-mail válida.");
				puede = false;
				f.mail.focus();
				return;
			};
			if(rg_pass.test(c.value)){
				puede = true;
			}else{
				alert("Se admiten solo letras minúsculas (a - z), números (0 - 9), o la combinación de ellos para crear su contraseña (mínimo 6 caracteres).");
				puede = false;
				return;
			};
			if(c2.value !== c.value){
				alert("La contraseña ingresada no coincide.");
				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 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]  = "May0";
    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 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;
	}
}
function popAntes(){
			window.open("Antes.html", "contenido", "width=300,height=500,screenX=200,screenY=200,scrollbars=yes");
		}
function popLista(){
			window.open("lista.html", "contenido", "width=400,height=550,scrollbars=yes");
		}