/*
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
COPYRIGHTS DBS Digital Business Solutions s.r.l.
According to the law, it is forbidden to disclose, reproduce or however
use this document and any data herein contained for any use without
previous written authorization by DBS Digital Business Solutions s.r.l.
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#Configuration Control Record
============================
Project_Name:	DBS Web Tools
Project_Code:	DBSWT
Unit_Name:		WAI
Unit_Code:		NA
File_Name:		libAccessibilty.js
============================
#ABSTRACT
========
Questa libreria fornisce le funzioni javascript
per il ridimensionamento del carattere

Lo script funziona solo con i browser
che abbiano un valido supporto del DOM,
come mozilla, IE5.5, IE6 (no Opera 6).
I browser che non supportano opportunamente
il DOM non avranno nessun tipo di problema.

#History (identifier;date;author;change)
=======
0;13-feb-2007 15:00:00;lE;Creation
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
*/

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = '; expires='+date.toGMTString();
	}
	else expires = '';
	document.cookie = name + '=' + value + expires + '; path=/';
}

function readCookie(name)
{
	var nameEQ = name + '=';
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ')
			c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0)
			return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function setFontSize(size)
{
	var body = document.getElementsByTagName('body')[0];
	var font_size = "70%"; 				// Default
	if (size == 1) font_size = "70%";
	if (size == 2) font_size = "100%";
	if (size == 3) font_size = "130%";
	body.style.fontSize = font_size;
	createCookie('DBSWTF',size,365);
}

window.onload = function()
{
	var size = readCookie('DBSWTF');
	setFontSize(size);
}


