jQuery(document).ready(function() 
{
	if (cookie.getCookie("dnlFontTweak"))
	{
		fontTweaks.setBigFonts();
	}

	jQuery("#bigFonts").click(function()
	{
		fontTweaks.setBigFonts();
		cookie.setCookie("dnlFontTweak", "fontTweak",1, "/");
	});
	
	jQuery("#smallFonts").click(function()
	{
		fontTweaks.setSmallFonts();
		cookie.deleteCookie("dnlFontTweak", "/");
	});
});

fontTweaks = 
{
	setBigFonts : function()
	{
		var cssExist = document.getElementById("fontsTweaks");
		if (!cssExist)
		{
			jQuery("head").append("<link>");
			css = jQuery("head").children(":last");
			css.attr({
				id:   "fontsTweaks",
				rel:  "stylesheet",
				type: "text/css",
				href: "/Portals/1/Skins/DanelSiud/bigFonts.css"
			});
		};
	},
	
	setSmallFonts : function()
	{
		var cssExist = document.getElementById("fontsTweaks");
		if (cssExist)
		{
			jQuery("#fontsTweaks").remove();
		};
	}
}

cookie = 
{
	setCookie : function(c_name, value, exdays, path)
	{
		var exdate = new Date();
		exdate.setDate(exdate.getDate() + exdays);
		
		var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
		
		if (path)
		{
			document.cookie = c_name + "=" + c_value + ";path=" + path;
		}
		else
		{
			document.cookie = c_name + "=" + c_value;
		}
	},
	
	getCookie : function(c_name)
	{	
		var i, x, y, ARRcookies = document.cookie.split(";");
		
		for (i = 0; i < ARRcookies.length; i++)
		{
			x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
			y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
			x = x.replace(/^\s+|\s+$/g,"");
			
			if (x == c_name)
			{
				return unescape(y);
			}
		}
	},
	
	deleteCookie : function(c_name, path)
	{
		if (cookie.getCookie( c_name )) 
		{
			document.cookie = c_name + "=" + (( path ) ? ";path=" + path : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
		}
	} 
}
















