
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 var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function fontsize(direction) {
	var bodyTag = document.getElementById('body');
	var bodyFontSize = bodyTag.style.fontSize;

	if(direction == 'increase') {
		if(bodyFontSize == '') {
			bodyTag.style.fontSize = '13px';
		}
		else if(bodyFontSize == '11px') {
			bodyTag.style.fontSize = '12px';
		}
		else if(bodyFontSize == '12px') {
			bodyTag.style.fontSize = '13px';
		}
		else if(bodyFontSize == '13px') {
			bodyTag.style.fontSize = '15px';
		}
		else if(bodyFontSize == '15px') {
			bodyTag.style.fontSize = '17px';
		}
	}
	else if(direction == 'decrease') {
		if(bodyFontSize == '') {
			bodyTag.style.fontSize = '11px';
		}
		else if(bodyFontSize == '12px') {
			bodyTag.style.fontSize = '11px';
		}
		else if(bodyFontSize == '13px') {
			bodyTag.style.fontSize = '12px';
		}
		else if(bodyFontSize == '15px') {
			bodyTag.style.fontSize = '13px';
		}
		else if(bodyFontSize == '17px') {
			bodyTag.style.fontSize = '15px';
		}
	}

	var nonce = Math.floor(Math.random() * 100);
	eraseCookie('jsFontSize');
	createCookie('jsFontSize', bodyTag.style.fontSize, '7');
}


