
function clearText(thefield)
{
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
}

function displayFixedWidth(url)
{
	document.write('<div class="imgFixedWidth"><a href="' + url + '?width=0" onclick="toggleWidth(\'page_wrapper\', 0);"><img src="/images/spacer.gif" title="Fixed width" alt="Fixed width" /></a></div>');
}

function displayVariableWidth(url)
{
	document.write('<div class="imgVariableWidth"><a href="' + url + '?width=1" onclick="toggleWidth(\'page_wrapper\', 1);"><img src="/images/spacer.gif" title="Variable width" alt="Variable width" /></a></div>');
}

function displayDefaultColour(url)
{
	document.write('<div class="imgContrastColour"><a href="' + url + '?contrast=0" onclick="setClass(\'front_body\', \'front_body_default\');"><img src="/images/spacer.gif" title="Default colour scheme" alt="Default colour scheme" /></a></div>');
}

function displayContrastColour(url)
{
	document.write('<div class="imgContrastColour"><a href="' + url + '?contrast=1" onclick="setClass(\'front_body\', \'front_body_hi\');"><img src="/images/spacer.gif" title="High Contrast colour scheme" alt="High Contrast colour scheme" /></a></div>');
}

function formConfirmation(id) {

	form = document.getElementById(id);
	action = form.action;

    var answer = confirm("Are you sure you want to cancel ?")
     if (answer){
	 	form.action = action + "?fh_action=cancel";
	 	form.submit();
     }
}

function URLConfirmation(url) {

    var answer = confirm("Are you sure you want to cancel ?")
     if (answer){
	 	document.location = url;
     }
}

function addOnload(fn)

{
	var wf = window.onload;
	window.onload = (wf) ? function() { wf(); fn(); } : fn;
}

