function abrir (URL,target,width,height) {
hnd = window.open (URL, target,'toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=no,width='+width+',height='+height);
hnd.focus();
}

function abrir2 (URL,target,width,height) {
hnd = window.open (URL, target,'toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,status=no,resizable=no,width='+width+',height='+height);
hnd.focus();
}

function imprimir() {
if (window.print)
	window.print()
else
	alert("Su navegador no soporta esta opción");
}

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ércoles', 'Jueves', 'Viernes', 'Sábado')
var nmes  = new Item('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre')
var fecha = new Date()
var ano   = fecha.getFullYear()
var mes   = fecha.getMonth()
var dia   = fecha.getDay()
var diaDelMes = fecha.getDate()

return (ndia[dia] + " " + diaDelMes + " " + "de" + " " + nmes[mes] + " ")
}

function addTargetBlank(tag) {
var contentText = document.getElementById(tag);
var as = contentText.getElementsByTagName('a');
for(i=0;i<as.length;i++){
	var a = as.item(i);
	a.target = '_blank';
}
}

function leerCookie(clave)
{ 
var valCookie= ""; 
var buscar= clave + "="; 
if(document.cookie.length > 0) { 
pos=document.cookie.indexOf(buscar); 
if (pos != -1) { 
pos += buscar.length; 
fin= document.cookie.indexOf(";", pos); 
if (fin == -1) 
fin= document.cookie.length; 
valCookie= unescape(document.cookie.substring(pos,fin));
} 
} 
return valCookie.replace("+"," "); 
} 

var usuario = leerCookie("USERNAME");

function addTargetBlank(tag) {
	var contentText = document.getElementById(tag);
	var as = contentText.getElementsByTagName('a');
	for(i=0;i<as.length;i++){
		var a = as.item(i);
		a.target = '_blank';
	}
}

function setActiveStyleSheet(title) {
	var i, a, main;
	var listo = 0;

	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
	{
		if(a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) 
		{
			a.disabled = true;
			if(a.getAttribute("title") == title)
			{
				listo = 1;
				a.disabled = false;
			}
		}
	}
	if((listo == 0) && (title != "print")) 
	{
		document.getElementsByTagName("link")[0].disabled = false;
	}
}

function estiloImprimir() {             
	setActiveStyleSheet("print", 1);
	print();
    setActiveStyleSheet("style1");   
}