/* - - - - - - - - - - - - - - - - - - - - -

Title : functie voor het zetten van relatieve font groottes
Author : Marien van Os
URL : http://www.mirabeau.nl

Description : Fontsizer script zet de relatieve fontgroottes op medium 100%;large 120%; xlarge 140%;
Er wordt een Cookie gezet op basis van wat gekozen is

Created : 10-02-2006
Modified : 

- - - - - - - - - - - - - - - - - - - - - */


// addLoadEvent(setSize)

var nCookieValue;

function setFontSizeStap(nStap) {
	switch (nStap)
	{
		case 1:
			sFontRelative = '75%';
			break;
		case 2:
			sFontRelative = '83%';
			break;
		case 3:
			sFontRelative = '95%';
			break;
			
	}
	document.body.style.fontSize=sFontRelative;	// getCookie('initFontSize');
	
	var n;
	var aObj;
	
	for (n=1;n<=3;n++) {
		aObj = $('a'+n);
		aObj.className = '';
	}
	
	aObj = $('a'+nStap);
	aObj.className = 'active';
	
	
}

//functie voor het zetten van de events en uitlezen van de eventueel aanwezige cookies
function initFontSize(){
	//zet algemene fontgrootte op basis van cookie initFontSize
	
	nCookieValue = getCookie('initFontSize');
	if (nCookieValue == null) nCookieValue = '1';
	nCookieValue = parseInt(nCookieValue,10);

	setFontSizeStap(nCookieValue)
	//check of de controls aanwezig zijn
	
	if($('fontSize')!= null){
		//set mousedownevent van de verschillende a's
		addEvent ($('a1'),'mousedown',setFontSize1)
		addEvent ($('a2'),'mousedown',setFontSize2)
		addEvent ($('a3'),'mousedown',setFontSize3)
	}
}

function setFontSize1() { setFontSize(1) }
function setFontSize2() { setFontSize(2) }
function setFontSize3() { setFontSize(3) }

function setFontSize(nStap) {
	
	setFontSizeStap(nStap)	
	setCookie('initFontSize',nStap,7, '/');
}

function setLarger() { 
	if (nCookieValue < 2) {
		nCookieValue++;
		setFontSizeStap(nCookieValue)	
		setCookie('initFontSize',nCookieValue,7, '/');
	}
}

function setSmaller() {
	if (nCookieValue > -1) {
		nCookieValue--;
		setFontSizeStap(nCookieValue)	
		setCookie('initFontSize',nCookieValue,7, '/');
	}
}
