// JavaScript Document
if(document.images){
	
	button_up = new  Image
	button_down = new Image
	button_up1 = new Image
	button_down1 = new Image
	oz_up = new Image
	oz_down = new Image
	downA = new Image
	apply_up = new  Image
	apply_down = new Image
		
	button_up.src = "../images/button.gif"
	button_down.src = "../images/buttons2.gif"
	button_up1.src = "images/button.gif"
	button_down1.src = "images/buttons2.gif"
	oz_up.src= "../images/ozbutt.gif"
	oz_down.src = "../images/ozbuttov.gif"
	downA.src = "../images/applydown.gif"
	apply_up.src = "../images/button_up.jpg"
	apply_down.src = "../images/button_down.jpg"
	
	}

function chgImg(imgName,newImg) 
{
	if (document.images)
	{
		document[imgName].src=eval(newImg +".src")
	}
}
	

	
	
function  feedbackValidator(feedback)
{
	//Check to see if a name has been selected
	if (feedback.firstname.value == "") 
	{
		alert("Please enter a name.");
		feedback.firstname.focus();
		return (false);
	}
	
	
	
	var Email = feedback.email.value;

	if (Email == "")
	{	alert("Please enter a value for the \"email\" field.");
		feedback.email.focus();
		return (false);
	}
	else
	{	var AtSym  = feedback.email.value.indexOf('@');
		var Dot    = feedback.email.value.lastIndexOf('.');
		var Space  = feedback.email.value.indexOf(' ');
		var Length = feedback.email.value.length - 2;   // Array is from 0 to length-2

		if ((AtSym < 1) ||                     // '@' cannot be in first position
			(Dot <= AtSym+1) ||                // Must be at least one valid char btwn '@' and '.'
			(Dot == Length ) ||                // Must be at least two valid chars after '.'
			(Space  != -1))                    // No empty spaces permitted
			{		alert("Your e-mail address is not valid. Please re-enter it.");
					feedback.email.focus();
					return (false);
			}
		
		var illegal_string = "/*+,/<>?;':[]{}\\|`~!#$%^&*()=";
		// keep a count of how many illegal characters appear in the fields
		var illegal_count=0;
		// next loop to run as many times as there are illegal characters to check against
		for (var loop=0; loop < illegal_string.length; loop++)
		{	// next bit assigns each consecutive illegal character into variable: "the_char" 
			the_char = illegal_string.charAt(loop);
			// next if statement means if illegal character appears in email number, increment count of illegal characters
			if (Email.indexOf(the_char) != -1)	// actually says: if illegal character does not NOT appear
			{	illegal_count++;	
			}
		}
		// next if statement prints error message only once if multiple illegal characters appear
		if (illegal_count > 0)
		{		alert("your email address contains invalid characters.Please Re-enter it.");
				feedback.email.focus();
				return (false);
		}
	
	}
	//Check to see if a staff has been selected
	if (feedback.comments.value == "") 
	{
		alert("Please enter some comments.");
		feedback.comments.focus();
		return (false);
	}


}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  if ((obj=MM_findObj(args[i]))!=null) { 
  v=args[i+2];
    if (obj.style) { 
	obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
	}
    obj.visibility=v; }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function writeDate() {
	document.writeln("Last Updated 5 April 2010")
}
