// JavaScript Document
// Funcione de fecha

function DiaSemana(d)
{
   	if (d == 0) return "Domingo";
   	if (d == 1) return "Lunes";
   	if (d == 2) return "Martes";
   	if (d == 3) return "Mi&eacute;rcoles";
   	if (d == 4) return "Jueves";
   	if (d == 5) return "Viernes";
   	if (d == 6) return "S&aacute;bado";
}
	
function queMes(m)
{
	if (m == 1) return "enero";
	if (m == 2) return "febrero";
	if (m == 3) return "marzo";
	if (m == 4) return "abril";
	if (m == 5) return "mayo";
	if (m == 6) return "junio";
	if (m == 7) return "julio";
	if (m == 8) return "agosto";
	if (m == 9) return "septiembre";
	if (m == 10) return "octubre";
	if (m == 11) return "noviembre";
	if (m == 12) return "diciembre";
}

var fecha = new Date();
var anyo = ''+fecha.getYear();
var ano;
if (anyo == "99")
	ano=1999;
	else if (anyo.length!=4)
{
	ano=1900 + parseInt(anyo,10);
}
else
	ano=anyo;

var miMes=queMes(fecha.getMonth()+1);
var cadenafinal = fecha.getDate() + " de " + miMes + " de " +  ano;

// Funciones  con ventanas ...

// Variable generales

	var AnchoPantalla = 0;
	var AltoPantalla = 0;
	var CentrarX = 0;
	var CentrarY = 0;

function ObtenerRes()
{
	AnchoPantalla = window.screen.width;		
	AltoPantalla = window.screen.height;
	
	CentrarX = (AnchoPantalla / 2) - (AnchoVentanaEmergente / 2);
	CentrarY = (AltoPantalla / 2) - (AltoVentanaEmergente / 2);
}

function OpenWindow(destino)
{
	AnchoVentanaEmergente = 700;
	AltoVentanaEmergente = 510;
	 
	ObtenerRes();
	
	var path = document.location.protocol + "//" + document.location.hostname + "//";

	var path =  path + destino;
	
	//alert("Archivo fuente [popups.js] :: " + path);
	
	var VentanaPDF = eval("window.open('','VPDF','left="+CentrarX+",top="+CentrarY+",height="+AltoVentanaEmergente+",width="+AnchoVentanaEmergente+",toolbar=no,resizeable=yes,scrollbars=yes')");
	VentanaPDF.location = path;
}

function Imprimir(whichFrame)
{
    alert(whichFrame);
	parent[whichFrame].focus();
    parent[whichFrame].print();
}
