// JavaScript Document
function displayDate() {
	var this_month = new Array(12);
    this_month[0]  = "January";
    this_month[1]  = "February";
    this_month[2]  = "March";
    this_month[3]  = "April";
    this_month[4]  = "May";
    this_month[5]  = "June";
    this_month[6]  = "July";
    this_month[7]  = "August";
    this_month[8]  = "September";
    this_month[9]  = "October";
    this_month[10] = "November";
    this_month[11] = "December";
	var this_day = new Array(7);
	 this_day[1] = "Monday";
	 this_day[2]= "Tuesday";
	 this_day[3] = "Wednesday";
	 this_day[4] = "Thursday";
	 this_day[5] = "Friday";
	 this_day[6] = "Saturday";
	 this_day[0] = "Sunday";
  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 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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_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 over(cual, color){
	document.getElementById(cual).style.background= '#F9F9F9';
}
function out(cual, color){
	document.getElementById(cual).style.background= '#FFFFFF';
}
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 val(){
			var f = document.ingr;
			var c = document.ingr.cont;
			var c2 = document.ingr.cont2;
			var mail = document.ingr.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("All fields required");
					f[i].focus();
					return;
				}
			};
			if (rg_mail.test(mail)){
				puede = true;
			} else {
				alert("Invalid e-mail");
				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)to create your  // password (min 1 char).");
				puede = false;
				return;
			};
			if(c2.value !== c.value){
				alert("Invalid password");
				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 = ""
					}
				
				}
			}			
		}
		//esta es la de acceso de los miembros registrados
function valid1(){
		var f = document.members;
		if(!f.user.value || !f.contr.value){	
		alert("Username and password required. Please type again.");
			return;
		}
		f.submit();
		}
function pUser(pCual){
		if(pCual == 'pass'){
			document.getElementById(pCual).innerHTML = "<input name='contr' type='password' id='contr' value='' onclick='puser(\'pass\')'  class='' style='border:inset 1px #CCCCCC; width:128px; height: 18px;'/>";
			document.getElementById('contr').focus();
		}else if(pCual == 'user'){
			document.getElementById(pCual).value = "";
		}
		
	}
function medir(pQue){
		document.getElementById('cartel').innerHTML = pQue;
	}