function changeStyle(ID)
	{
	//create cookie to store body style ID in
	var cookieName = 'bodyStyleID=';
	var cookieVal = ID;
	var date = new Date();
	date.setFullYear(date.getFullYear() + 1);	
	var cookieExpires = ';expires=' + date.toGMTString();
	document.cookie = cookieName + cookieVal + cookieExpires+';'+'path=/;';
	//set body's ID to match the chosen colour scheme.
	document.body.id=ID;
	try
		{
		window.frames[1].location.reload();
		}
	catch(err)
		{
		//Handle errors here
		//We're doing nothing, an error here means the "What's On" iframe isn't loaded
		}
	}

function changeFontSize(percentage)
	{
	//create cookie to store font size in
	var cookieName = 'fontSize=';
	var cookieVal = percentage;
	var date = new Date();
	date.setFullYear(date.getFullYear() + 1);	
	var cookieExpires = ';expires=' + date.toGMTString();
	document.cookie = cookieName + cookieVal + cookieExpires+';'+'path=/;';
	//set body's fontsize to the specified percentage.
	document.body.style.fontSize=percentage;
	try
		{
		window.frames[1].location.reload();
		}
	catch(err)
		{
		//Handle errors here
		//We're doing nothing, an error here means the "What's On" iframe isn't loaded
		}
	}

//	function getCookie(c_name)
//		{
//		var i,x,y,ARRcookies=document.cookie.split(";");
//		for (i=0;i<ARRcookies.length;i++)
//			{
//			x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
//			y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
//			x=x.replace(/^\s+|\s+$/g,"");
//			if (x==c_name)
//				{
//				return unescape(y);
//				}
//			}
//		}

//------------------------------------------------------------------------------------------




//		if (getCookie("MDC_cookie_acceptance_cookie")) {



//load all the cookies that exist into an array
var cookies = document.cookie.split(';');

//create variables to store the cookie values we need in
var bodyStyleID = '';
var percentage = '';

//each cookie that we found
for(i=0;i<cookies.length;i++)
{
	//split the cookie crumbs into the bits we need
	var cookieCrumbs = cookies[i].split('=');
	var cookieName = cookieCrumbs[0].replace(/ /g, '');
	var cookieValue = cookieCrumbs[1];
	
	if(cookieName=='bodyStyleID')
	{
		bodyStyleID = cookieValue;
		document.body.id=bodyStyleID;
	}
	if(cookieName=='fontSize')
	{
		percentage = cookieValue;
		document.body.style.fontSize=percentage;
	}
}

//if no colourScheme cookie found
if(bodyStyleID=='')
{
	document.body.id='default';
}
//if no colour fontSize cookie found
if(percentage=='')
{
	document.body.style.fontSize='100%';
}

// document.write('Text size: ');
document.write('	<a id="font_size_small"		style="text-decoration:none; font-size:16px; margin-right:3px; " href="javascript:changeFontSize(\'100%\');" 	Title="Normal Text Size.">A</a>');
document.write('	<a id="font_size_medium"	style="text-decoration:none; font-size:20px; margin-right:3px; " href="javascript:changeFontSize(\'140%\');" 	Title="Medium Text Size.">A</a>');
document.write('	<a id="font_size_large"		style="text-decoration:none; font-size:24px; margin-right:20px;" href="javascript:changeFontSize(\'180%\');" 	Title="Large Text Size." >A</a>');
// document.write('Colour: ');
document.write('<a style="color:#000000; font-weight:bold; text-decoration:none;" href="javascript:changeStyle(\'default\');" 		><img src="./images/common/icon_colour_scheme_default.gif" 		style="border:0px;" 	alt="" Title="Choose default colour scheme"		/></a> ');
document.write('<a style="color:#ffffff; font-weight:bold; text-decoration:none;" href="javascript:changeStyle(\'whiteOnBlack\');" 	><img src="./images/common/icon_colour_scheme_white_on_black.gif" 	style="border:0px;"	alt="" Title="Choose white on black colour scheme"	/></a> ');
document.write('<a style="color:#000000; font-weight:bold; text-decoration:none;" href="javascript:changeStyle(\'blackOnYellow\');"	><img src="./images/common/icon_colour_scheme_black_on_yellow.gif" 	style="border:0px;"	alt="" Title="Choose black on yellow colour scheme"	/></a> ');
document.write('<a style="color:#ffff66; font-weight:bold; text-decoration:none;" href="javascript:changeStyle(\'yellowOnBlack\');"	><img src="./images/common/icon_colour_scheme_yellow_on_black.gif" 	style="border:0px;"	alt="" Title="Choose yellow on black colour scheme"	/></a> ');
document.write('<a style="color:#000000; font-weight:bold; text-decoration:none;" href="javascript:changeStyle(\'blackOnBlue\');" 	><img src="./images/common/icon_colour_scheme_black_on_blue.gif" 	style="border:0px;"	alt="" Title="Choose black on blue colour scheme"	/></a> ');



// } // end of cookie acceptance cookie check
