function tomarFecha() {
  mesarray=new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio","Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
  diaarray=new Array( "Domingo","Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado");
  hoy = new Date();
  dia = hoy.getDate();
  mes = hoy.getMonth()+1;
  anio= hoy.getFullYear();
  fechaGrab = dia+"/"+mes+"/"+anio; 
//  window.alert("hoy:"+hoy+"\n"+"dia:"+dia+"\n"+"mes:"+mes+"\n"+"año:"+anio+"\n"+"fechaGrab:"+fechaGrab);
  return fechaGrab;
} // end function 

function SelectIN(id,op) {
  // permite cambiar el color de fondo de un input
  if (op=="on") {
        document.getElementById(id).style.backgroundColor = '#E5E5E5';
        document.getElementById(id).style.borderStyle     = 'solid';
        document.getElementById(id).style.borderWidth     = '1px';
        document.getElementById(id).style.borderColor     = 'black';                        
  } else {
        document.getElementById(id).style.backgroundColor = "#C0C0C0";
        document.getElementById(id).style.borderStyle     = 'none';
        document.getElementById(id).style.borderWidth     = '0px';
        document.getElementById(id).style.borderColor     = '';        
  } // endif
} // end function

function CheckForm(frm) {
 // Preparar Mensajes de error
  var mensaje = "ATENCION!!!\npor favor ingrese:\n";
  var error	  = false;
  // Acceder a los datos
  var nombre = document.getElementById("frmAltas").Nombre.value;
  var comentario = document.getElementById("frmAltas").Comentario.value;
  var correo  = document.getElementById("frmAltas").Correo.value;

  // Validar Datos
  if (nombre=="") {
    mensaje = mensaje + "Nombre\n";
    error   = true;
  } // endif
   // Validar Datos
  if (comentario=="") {
    mensaje = mensaje + "Comentario\n";
    error   = true;
  } // endif
  if (correo=="") {
    mensaje = mensaje + "Correo\n";
    error   = true;
  } else if ((correo.indexOf("@")==-1) || (correo.indexOf(".")==-1)) {
    	mensaje = mensaje + "E-mail correctamente\n";
    	error   = true;
  } // endif

  // Chequear error
  if (error) {
        window.alert(mensaje);
  } else {
  	    document.getElementById("frmAltas").fecha.value = tomarFecha();
        document.getElementById("frmAltas").submit();
  } //endif
} // end function

function SelectIN(id,op) {
  // permite cambiar el color de fondo de un input
  if (op=="on") {
        document.getElementById(id).style.backgroundColor = "#E5E5E5";
  } else {
        document.getElementById(id).style.backgroundColor = "#C0C0C0";
  } // endif
} // end function
 

