function generar_fecha() {
    var fecha = new Date();
    var dia_letra = fecha.getDay();
    var dia = fecha.getDate();
    var mes = fecha.getMonth();
    var anyo = fecha.getFullYear();

    switch(dia_letra) {
        case 0: dia_letra = "Domingo"; break;
        case 1: dia_letra = "Lunes"; break;
        case 2: dia_letra = "Martes"; break;
        case 3: dia_letra = "Miércoles"; break;
        case 4: dia_letra = "Jueves"; break;
        case 5: dia_letra = "Viernes"; break;
        case 6: dia_letra = "Sábado"; break;
        default: dia_letra = "Domingo"; break;
    }
    switch(mes) {
        case 0: mes = "Enero"; break;
        case 1: mes = "Febrero"; break;
        case 2: mes = "Marzo"; break;
        case 3: mes = "Abril"; break;
        case 4: mes = "Mayo"; break;
        case 5: mes = "Junio"; break;
        case 6: mes = "Julio"; break;
        case 7: mes = "Agosto"; break;
        case 8: mes = "Septiembre"; break;
        case 9: mes = "Octubre"; break;
        case 10: mes = "Noviembre"; break;
        case 11: mes = "Diciembre"; break;
        default: mes = ""; break;
    }
    document.write(dia_letra+", "+dia+" de "+mes+" de "+anyo);
}

/*function windowopener(URL,ancho,alto)
{
	var propiedades;
	propiedades = "toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width=" + ancho + ",height=" + alto;
	window.open(URL,'',propiedades)
	if (navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(mac") != -1)
	window.open(URL,'',propiedades)

}*/

//helper function to create the form
function getNewSubmitForm()
{
 var submitForm = document.createElement("FORM");
 document.body.appendChild(submitForm);
 submitForm.method = "POST";
 submitForm.target = "_blank";
 return submitForm;
}

//function that creates the form, adds some elements
//and then submits it
function createFormAndSubmit(theURL)
{
 var submitForm = getNewSubmitForm();
 submitForm.action= theURL;
 submitForm.submit();
}

function windowopener(URL,ancho,alto)
{
  createFormAndSubmit(URL);
}

function gotoURL (url)
{
	window.location.href = url;
}

function submit(formName)
{
	if(formName != '')
	{
		eval ("document.forms['" + formName + "'].method='post';");
		eval ("document.forms['" + formName + "'].submit();");
	}
	else
	{
		eval ("document.forms[0].method='post';");
		eval ("document.forms[0].submit();");
	}
}

function changeValue(formName,inputName,value)
{
	if(formName != '')
	{
		eval ("document.forms['" + formName + "']." + inputName + ".value=" + value + ";");
	}
	else
	{
		eval ("document.forms[0]." + inputName + ".value=" + value + ";");
	}
}

function reSubmit(URL)
{
	document.forms[0].method='post';
	if(URL != '')
	{
		document.forms[0].action = URL;
	}
	document.forms[0].submit();
}

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();
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

