function toggle(menu) {
	if(menu.className == 'hiddenMenu')
		menu.className = 'visibleMenu';
	else
		menu.className = 'hiddenMenu';
}

function onloadFunctions() {
	showInfoBoxes();
	changeFont('retrieve');
}

function showInfoBoxes() {

	var infoBox1 = document.getElementById('infoBox1');
	var infoBox2 = document.getElementById('infoBox2');
	
	if(infoBox1 != null && infoBox1.className == 'boxLive' && 
		!(infoBox1.innerHTML == '' || infoBox1.innerHTML == null) ) {
			infoBox1.className = 'box';	
	}
	
	if(infoBox2 != null && infoBox2.className == 'boxLive' && 
		!(infoBox2.innerHTML == '' || infoBox2.innerHTML == null) ) {
			infoBox2.className = 'box';
	}
}

function changeFont(whichWay) {
		var innerFont = document.getElementById('main');
		var upFactor = 1.1;
		var downFactor = 0.9;
	
		var currentFontSize = innerFont.style.fontSize;
		
		var cookieFontSize = getCookie('fontsize');
		
		if(currentFontSize == '' || currentFontSize == null || currentFontSize == 'undefined') {
			if(cookieFontSize != '')
				currentFontSize = cookieFontSize;
			else
				currentFontSize = '100%';
		}
		
		currentFontSize = (currentFontSize.replace('%', '') / 100);
		
		var newFontSize;
		
		if(whichWay == 'retrieve')
			newFontSize = (currentFontSize * 100) + '%';
		else if(whichWay == 'reset')
			newFontSize = '100%';
		else if(whichWay == 'up')
			newFontSize = ((currentFontSize * upFactor) * 100) + '%';
		else if(whichWay == 'down')
			newFontSize = ((currentFontSize * downFactor) * 100) + '%';
		
		innerFont.style.fontSize = newFontSize;
			
		setCookie('fontsize', newFontSize, null);
	}
	
function getCookie(c_name) {
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + '=');
		if (c_start!=-1)
		{
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(';',c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return '';
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}