weekdays 	= new Array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado");
months 		= new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
today 		= new Date();
weekday 	= today.getDay();
monthday 	= today.getDate();
month 		= today.getMonth();
year 		= today.getFullYear();
weekday		= weekdays[weekday];
month1 		= months[month];
dateString	= (String(weekday))+" "+(String(monthday))+" DE "+(String(month1))+", "+(String(year));
var xmlHttp;
function Generar(){
    var dr      = "";
    var lan	    = document.form.lan.value;
    var appid	= document.form.appid.value;
    var mes 	= today.getMonth()+2;
    var ano 	= today.getFullYear();
    if(mes<10){mes="0"+mes;}
    else{
        if(mes>12)
        {mes="01";ano++;}
        else
        {mes=""+mes;}
        
    }
    var fecha           = year+"/"+mes+"/"+monthday;
    var periodo         = ano+mes;
    var facturador      = document.form.c3_tipo_facturador_id.value;
    window.open("/cgi-bin/"+appid+"/pl/generar_carga_mensual_delsur_ilopango.pl?lan="+lan+"&appid="+appid+"&i8_periodo="+periodo+"&c3_tipo_facturador_id="+facturador+"&fecha="+fecha,"carga","top=10,left=420,width=900,height=400,resizable=yes,status=no,scrollbars=yes");
}