﻿// Esta función muestra u oculta un elemento dado
function ShowHideMenu(div){ 
    if (document.getElementById(div).style.display=="none"){
		document.getElementById(div).style.display="";
	}
	
		else{
		document.getElementById(div).style.display="none";
	} 
}

function abrirrte(pagina){
	var w = '650';
	var h = '500';
	var nombre = 'rte';
	var opciones='';
	var scrol = '';
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	if (screen.height < h || screen.width < w) {
		scrol = 'yes';
			if (screen.height < h) {
					h = screen.height - 50;				
			} else {
				h = h + 20;
			}
			if (screen.width < w) {
					w = screen.width - 20;				
			}
		top = 0;
		left = 0;
	} else {
		scrol = 'no';
	}
	opciones = 'scrollbars=1,resizable=yes,width='+w+',height='+h+',top='+top+',left='+left+'';
	window.open (pagina,nombre,opciones);
}
function abrirfoto(pagina){
	var w = '750';
	var h = '500';
	var nombre = 'rte';
	var opciones='';
	var scrol = '';
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	if (screen.height < h || screen.width < w) {
		scrol = 'yes';
			if (screen.height < h) {
					h = screen.height - 50;				
			} else {
				h = h + 20;
			}
			if (screen.width < w) {
					w = screen.width - 20;				
			}
		top = 0;
		left = 0;
	} else {
		scrol = 'no';
	}
	opciones = 'scrollbars=1,resizable=yes,width='+w+',height='+h+',top='+top+',left='+left+'';
	myventana = window.open (pagina,nombre,opciones);
	myventana.focus();
	
}
function abrirmulti(pagina){
	var w = '300';
	var h = '500';
	var nombre = 'multi';
	var opciones='';
	var scrol = '';
	var top = (screen.height-h)/2;
	var left = (screen.width-w)/2;
	if (screen.height < h || screen.width < w) {
		scrol = 'yes';
			if (screen.height < h) {
					h = screen.height - 50;				
			} else {
				h = h + 20;
			}
			if (screen.width < w) {
					w = screen.width - 20;				
			}
		top = 0;
		left = 0;
	} else {
		scrol = 'no';
	}
	opciones = 'scrollbars=1,resizable=yes,width='+w+',height='+h+',top='+top+',left='+left+'';
	myventana = window.open (pagina,nombre,opciones);
	myventana.focus();
}
function Escribe_Fecha() {
                       var mydate=new Date();
                       var year=mydate.getYear();
                       if (year < 1000)year+=1900;
                       var month=mydate.getMonth()+1;
                       var daym=mydate.getDate();
                       var dia = mydate.getDay(daym);
                       switch (dia){
                                   case 1:
                                        var diaHoy = "lunes";
                                        break;
                                   case 2:
                                        var diaHoy = "martes";
										break;

                                   case 3:
                                        var diaHoy = "mi&eacute;rcoles";
                                        break;
                                   case 4:
                                        var diaHoy = "jueves";
                                        break;
                                   case 5:
                                        var diaHoy = "viernes";
                                        break;
                                   case 6:
						                var diaHoy = "s&aacute;bado";
										break;
                                   case 0:
                                        var diaHoy = "domingo"
										break;
                       }
                       switch (month){
                                  case 1:
                                        var mesHoy = "enero";
                                        var mimes = "01";
										break;
                                  case 2:
                                        var mesHoy = "febrero";
                                        var mimes = "02";
 							            break;
                                   case 3:
                                        var mesHoy = "marzo";
                                        var mimes = "03";                                        
                                        break;
                                   case 4:
                                        var mesHoy = "abril";
                                        var mimes = "04";                                        
										break;
                                   case 5:
                                        var mesHoy = "mayo";
                                        var mimes = "05";                                        
                                        break;
                                   case 6:
                                        var mesHoy = "junio";
                                        var mimes = "06";                                        
										break;
                                   case 7:
                                        var mesHoy = "julio";
                                        var mimes = "07";                                        
                                        break;
                                   case 8:
                                        var mesHoy = "agosto";
                                        var mimes = "08";                                        
										break;
                                   case 9:
                                        var mesHoy = "septiembre";
                                        var mimes = "09";                                        
										break;
                                   case 10:
                                        var mesHoy = "octubre";
                                        var mimes = "10";                                        
                                        break;
                                   case 11:
                                        var mesHoy = "noviembre";
                                        var mimes = "11";                                        
										break;
                                   case 12:
                                   	    var mesHoy = "diciembre";
                                        var mimes = "12";                                   	    
										break;
                       }                       
						if (screen.width == 800) {
			                  var fecha = daym +'/'+ mimes + '/' + year;
			            } else {
		                      var fecha = diaHoy +', '+daym +' de '+  mesHoy +' de '+ year + ' ';
		                }
                      document.write (fecha);
                      //alert (fecha);
}
