// Voces del Frente
// funcion para imprimir la fecha del día
function Item(){
  this.length = Item.arguments.length 
  for (var i = 0; i < this.length; i++)
    this[i] = Item.arguments[i]
}

function Fecha() {
  var ndia  = new Item('Domingo', 'Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado')
  var nmes  = new Item('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 
                          'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre')
  var ahora
  var fecha = new Date()
  var ano   = fecha.getYear()
  var mes   = fecha.getMonth()
  var dia   = fecha.getDay()
  var aux   = "" + fecha
  
  if (ano<10) {
    ano2 = "200" + eval(ano)
  }
  else if (ano<80) {                // ano tiene 2 dígitos 19xx (más de 80)
    ano2 = "20" + ano
  } 
  else if (ano<=99) {               // ano tiene 2 dígitos 20xx (menor de 80)
    ano2 = "19" + ano
  }
  else if (ano<1000) {              // ano tiene 3 dígitos (100 es 2000)
    ano2 = eval(ano) + eval(1900)
  }
  else {
    ano2 = ano                      // ano tiene 4 dígitos
  }
  

  ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " de " + nmes[mes] + " de " + ano2 + "<br> Uruguay "
  return ahora
}

// Traza un Separador de color Rojo-Azul
function LineaRojaAzul() {
   var linea=""+
        "<table width='50%' border='0' height='6'>"+
          "<tr> "+
            "<td bgcolor='#CC3300'></td>"+
            "<td bgcolor='#006699'></td>"+
          "</tr>"+
        "</table>";
   document.write(linea);
}

//Abre una ventana en la mitad de la pantalla con la foto
function CargarFoto(img, ancho, alto){
  ancho=eval(ancho)+30;
  alto=eval(alto)+35;
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
  fin=window.open(img,"",string);
}

//Funcion para chequear plugin
function CheckPlugin(plgIn) {
	var hayPlgIn="1";		
    var ok=false; document.MM_returnValue = false;
    with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
       ok=(plugins && plugins[plgIn]);
    } else if (appVersion.indexOf('3.1')==-1) {
       if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
       else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
	   else ok=true;  }
	if (!ok) hayPlgIn="0";

	return hayPlgIn;
	
}

//Function Pie Documentos
function pieVDF(){
var linea=""+
"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
  "<tr> "+
    "<td height='3'> "+
      "<div align='right' class='arial10'>VOCES del FRENTE </div>"+
    "</td>"+
  "</tr>"+
  "<tr> "+
    "<td height='3' bgcolor='#CC3300'></td>"+
  "</tr>"+
  "<tr> "+
    "<td height='3' bgcolor='#3300CC'></td>"+
  "</tr>"+
  "<tr>"+
    "<td height='3'></td>"+
  "</tr>"+
"</table>";
document.write(linea);
}

function ShowImgBack(id_foto){
        var foto = window.open("","foto","height=000,menubar=no,scrollbars=yes")
        foto.document.open("text/html","replace")
        foto.document.write("<html><head></head><body leftmargin=0 topmargin=0 onload='window.resizeTo(foto.width+30,foto.height+30)'><a href='javascript:window.close()'><img name='foto' src='" + id_foto + "' border='0' alt='Click para Cerrar'><a></body></html>")
        foto.document.close();
}

function ShowImg(id_foto){
        var foto = window.open("","foto","height=000,menubar=no,scrollbars=yes")
        foto.document.open("text/html","replace")
        var fwrite="<html><head>"+
        	"<link rel='stylesheet' href='../Estilos/eNotas.css'>"+
        	"<script language='javascript'> "+
        	"function tVentana(){"+
        	"if (foto.height+30>screen.availHeight)"+
        	"   {iHeight=screen.availHeight;} else {iHeight=foto.height+30;}"+
        	"if (foto.width+30>screen.availWidth)"+
        	"   {iWidthHeight=screen.availWidth;} else {iWidth=foto.width+30;}"+
        	"window.moveTo(0,0);"+
        	"window.resizeTo(iWidth,iHeight);"+
		//"window.resizeTo(foto.width+30,foto.height+30);"+
		"}</script>"+
        	"</head>"+
        	"<body leftmargin=0 topmargin=0 onload='javascript:tVentana()'>"+
        	"<table width='100%' border='0' cellspacing='0' cellpadding='5'>"+
   		" <tr>"+
    		" <td class='arial10'>"+
      		" <p align='right'><a href='javascript:window.print()' class='link336699' title='Imprime la imágen'>imprimir<img src='../images/imprimir.gif' width='26' height='26' border='0'></a>"+
    		" </td>"+
  		" </tr>"+
		"</table>"+
        	"<a href='javascript:window.close()'><img name='foto' src='" + id_foto + "' border='0' alt='Click para Cerrar'></a>"+
        	"</body></html>";
            //alert(fwrite);
        foto.document.write(fwrite)
        foto.document.close();
}