function validateform() {
    valid = true;
	errormsg = "Please complete the following fields: \n";
	var formName = validateform.arguments[0];
	for(i=1; i < validateform.arguments.length; i=i+2) {
    	var fieldName = validateform.arguments[i];
		var displayName = validateform.arguments[i+1];
	    if (eval("document."+formName+"."+fieldName+".value") == "") {
	        valid = false;
			errormsg += displayName + "\n";
    	}
				
		//Check to ensure a valid email address has been entered
		if (fieldName == "email") {
			var emailFilter = /^.+@.+\..{2,3}$/;
			var illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
			emailAddress = eval("document."+formName+"."+fieldName+".value");
			if (!(emailFilter.test(emailAddress))) { 
				valid = false;
				errormsg += "Please Enter a Valid Email Address\n";
			}
			if (emailAddress.match(illegalChars)) {
				valid = false;
				errormsg += "Please Check your email address, it contains illegal characters.\n";
			}
		}
	
			
	}
		
		var termbox = document.getElementById("terms");
			if (termbox)
			{
				
				if (!termbox.checked)
   				 {
			    valid = false;
       		 	errormsg += "Please check the Terms & Conditions box.\n";
       			 
    			}
			}
		
	if (valid == false) {
		alert(errormsg);
	}
    return valid;
}


homeon = new Image(82,29);
homeon.src = "assets/home_btn_R.jpg";

homeoff = new Image(82,29);
homeoff.src = "assets/home_btn.jpg";


abouton = new Image(82,29);
abouton.src = "assets/about_btn_R.jpg";

aboutoff = new Image(82,29);
aboutoff.src = "assets/about_btn.jpg";

newson = new Image(82,29);
newson.src = "assets/news_btn_R.jpg";

newsoff = new Image(82,29);
newsoff.src = "assets/news_btn.jpg";

membershipon = new Image(82,29);
membershipon.src = "assets/membership_btn_R.jpg";

membershipoff = new Image(82,29);
membershipoff.src = "assets/membership_btn.jpg";

policyon = new Image(82,29);
policyon.src = "assets/policy_btn_R.jpg";

policyoff = new Image(82,29);
policyoff.src = "assets/policy_btn.jpg";

wpaaon = new Image(82,29);
wpaaon.src = "assets/wpaa_btn_R.jpg";

wpaaoff = new Image(82,29);
wpaaoff.src = "assets/wpaa_btn.jpg";

documentson = new Image(82,29);
documentson.src = "assets/document_btn_R.jpg";

documentsoff = new Image(82,29);
documentsoff.src = "assets/document_btn.jpg";

linkson = new Image(82,29);
linkson.src = "assets/link_btn_R.jpg";

linksoff = new Image(82,29);
linksoff.src = "assets/link_btn.jpg";

contacton = new Image(82,29);
contacton.src = "assets/contact_btn_R.jpg";

contactoff = new Image(82,29);
contactoff.src = "assets/contact_btn.jpg";

jobson = new Image(82,29);
jobson.src = "assets/job_btn_R.jpg";

jobsoff = new Image(82,29);
jobsoff.src = "assets/job_btn.jpg";

resumeson = new Image(82,29);
resumeson.src = "assets/resume_btn_R.jpg";

resumesoff = new Image(82,29);
resumesoff.src = "assets/resume_btn.jpg";

courseon = new Image(82,29);
courseon.src = "assets/course_btn_R.jpg";

courseoff = new Image(82,29);
courseoff.src = "assets/course_btn.jpg";

logouton = new Image(82,29);
logouton.src = "assets/log_out_btn_R.jpg";

logoutoff = new Image(82,29);
logoutoff.src = "assets/log_out_btn.jpg";

surveyon = new Image(82,29);
surveyon.src = "assets/survey_btn_R.jpg";

surveyoff = new Image(82,29);
surveyoff.src = "assets/survey_btn.jpg";

function rollOver(imgName, imgRollFile){
	document.getElementById(imgName).src = eval(imgRollFile + ".src");

}

function newWindow(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
