var today = new Date()

var expires = new Date();

// fix the bug in Navigator 2.0, Macintosh
fixDate(expires);
expires.setTime(expires.getTime() + 365 * 24 * 60 * 60 * 1000);

function setCookie(name, value, expires, path, domain, secure) {
 var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
 document.cookie = curCookie;
}

function getCookie(name) {
 var dc = document.cookie;
 var prefix = name + "=";
 var begin = dc.indexOf("; " + prefix);
 if (begin == -1) {
 begin = dc.indexOf(prefix);
 if (begin != 0) return null;
 } else
 begin += 2;
 var end = document.cookie.indexOf(";", begin);
 if (end == -1)
 end = dc.length;
 return unescape(dc.substring(begin + prefix.length, end));
}

function FullEstil(nouTamany){
 	setCookie("FullEstil", nouTamany, expires,"/");
	if (getCookie("FullEstil"))
	{
		window.self.location.reload();
	}else{
		alert("Tiene que activar las galletas (cookies) de su navegador para que el cambio de tamaño de letra sea permanente en todas las páginas.");
		cadena = new String(window.self.location);
		str = cadena.toString();
		if (str.indexOf("?")==-1){
			window.location=str+"?estil="+nouTamany;
		}else{
			window.location=str.substr(0,str.indexOf("?"))+"?estil="+nouTamany;		
		}
	}
	return null;
}

function ConsultaEstil(){
	setCookie("Existencia", "1", expires,"/");	
	if (getCookie("Existencia"))
	{
		var fulla = getCookie('FullEstil');
	
		if (fulla==null || fulla == "" || fulla=="undefined"){
			fulla = "tamany11";
			setCookie("FullEstil", fulla, expires, "/");
		}
	
		return fulla;	
	}
	else{fulla = "tamany11";}
	return fulla;
}
if (document.images) {
	tamany_11_Off = new Image(20,19); tamany_11_Off.src = "./img/i11_0.gif";
	tamany_11_On = new Image(20,19); tamany_11_On.src = "./img/i11_1.gif";
	tamany_14_Off = new Image(20,19); tamany_14_Off.src = "./img/i14_0.gif";
	tamany_14_On = new Image(20,19); tamany_14_On.src = "./img/i14_1.gif";
	tamany_17_Off = new Image(20,19); tamany_17_Off.src = "./img/i17_0.gif";
	tamany_17_On = new Image(20,19); tamany_17_On.src = "./img/i17_1.gif";
}

function cambiar(imgName,imgObjName) {
if (document.images) {
  document.images[imgName].src = eval(imgObjName + ".src");
}}

function deleteCookie(name, path, domain) {
 if (getCookie(name)) {
 document.cookie = name + "=" +
 ((path) ? "; path=" + path : "") +
 ((domain) ? "; domain=" + domain : "") +
 "; expires=Thu, 01-Jan-70 00:00:01 GMT";
 }
}

function fixDate(date) {
var base = new Date(0);
var skew = base.getTime();
if (skew > 0) {date.setTime(date.getTime() - skew);}
}