//JavaScript Document

var btn_print = (document.getElementById("print-this-page")) ? document.getElementById("print-this-page") : null;

if(btn_print!=null) {
	btn_print.style.display = 'block';
	btn_print.onclick = function() {
		window.print();
	}
}

// SET FONT SIZE
if(document.cookie.indexOf("fontsize")!=-1) {
	var cookie_start = document.cookie.indexOf("fontsize=");
	cookie_start = cookie_start+9;
	cookie_end = document.cookie.indexOf(";",cookie_start);
	if(cookie_end==-1) cookie_end = document.cookie.length;
	cookie_value = document.cookie.substring(cookie_start,cookie_end);
	document.body.style.fontSize = cookie_value+"em";
}

function changeFontSize(value) {
	var expiry = new Date();
	expiry.setDate(expiry.getDate()+364);
	document.cookie = 'fontsize='+escape(value)+';expires='+expiry.toUTCString();
	document.body.style.fontSize = value+"em";
}

function addTableRowAltColours(){
	var tbls = window.document.getElementsByTagName('table');
	var tbllen = tbls.length;
	
	for(var i = 0; i < tbllen; i++){
		if(tbls[i].className && (tbls[i].className == 'table-content')){
			var tblrows = tbls[i].getElementsByTagName('tr');
			var tblrowlen = tblrows.length;
			
			for(var x = 0; x < tblrowlen; x++){
				if((x%2)==0){
					tblrows[x].className = 'alt-row';
				} else {
					tblrows[x].className = '';
				}
			}
		}
	}
}

addTableRowAltColours();
