// JavaScript Document



// ----- START Text Resizer -----
// set the font size according to the user's preference, called by setFontSize() or user click
function chgFontSz(i) {
	var topID = document.getElementById("top");
	var contentID = document.getElementById("content");
	setFontCookie(i);
	switch(i) {
		case "1":
			topID.style.fontSize="100%";
			contentID.style.fontSize="100%";
			document.getElementById('A-big').className = ''; 
			document.getElementById('A-med').className = ''; 
			document.getElementById('A-sml').className = 'current'; 
			break;
		case "2":
			topID.style.fontSize="106%";
			contentID.style.fontSize="110%";
			document.getElementById('A-big').className = ''; 
			document.getElementById('A-med').className = 'current'; 
			document.getElementById('A-sml').className = ''; 
			break;
		case "3":
			topID.style.fontSize="112%";
			contentID.style.fontSize="120%";
			document.getElementById('A-big').className = 'current'; 
			document.getElementById('A-med').className = ''; 
			document.getElementById('A-sml').className = ''; 
			break;
	}
	return false
}

// saves the font size preference to a cookie, expires in one year
function setFontCookie(i) {
	var nextyear = new Date();
	nextyear.setFullYear(nextyear.getFullYear() + 1);
	document.cookie = "fontsize=" + i + "; expires=" + nextyear.toGMTString() + "; path=/";
}

// sets the font size according to the cookie value, called by onload
function setFontSize() {
	var allCookies = document.cookie;
	var pos = allCookies.indexOf("fontsize=");
	if (pos != -1) {
		var start = pos + 9;
		var end = allCookies.indexOf(";", start);
		if (end == -1) end = allCookies.length;
		var value = allCookies.substring(start, end);
		chgFontSz(value);
	}
}
// ----- END Text Resizer -----



// ----- START Directors Tab Show Hide function (FUNCTION NOT USED NOW, TABMENU.JS USED INSTEAD) -----
function showTab(Obj,nextNum,totalNum,tabObj){
	// hides all hidable in current select menu
	for(var i = 1; i < totalNum + 1; i++){
		document.getElementById(Obj+i).style.display = 'none';
		document.getElementById(tabObj+i).style.fontWeight = 'normal';
	}
	// shows next object
	document.getElementById(Obj+nextNum).style.display = 'block';
	document.getElementById(tabObj+nextNum).style.fontWeight = 'bold';

}
// ----- END Directors Tab Show Hide function -----

function mailFriend() {
    var mailSubject = 'Page from KPMG Europe LLP Annual Report 2009 Site';
    var mailBody = 'Hello %0D%0A%0D%0AI thought you might be interested in the following page from the KPMG Europe LLP Annual Report 2009: %0D%0A%0D%0A' + escape(location.href);
    document.location = 'mailto:?SUBJECT=' + mailSubject + '&BODY=' + mailBody
}

function popup(url) {
    newwindow = window.open(url, 'name', 'height=500,width=700,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no');
    if (window.focus) { newwindow.focus() }
    return false;
}

