//Suckerfish Menus for IE
function PopUp(id){
	if(id!=""){
		var strURL = "/photo.asp?id=" + id
		var objPhotoWindow = window.open(strURL,'photo','height=500,width=550,left=10,top=10,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,resizable=0,status=0,toolbar=0');
	}

}

function emailPage(id){
	if(id!=""){
		var strURL = "/sendpage.asp?id=" + id
		var objPhotoWindow = window.open(strURL,'photo','height=410,width=550,left=10,top=10,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,resizable=0,status=0,toolbar=0');
	}

}


function strTrim(strText) {
	if(strText!=''){
		for (i=0; i<strText.length; ++i) {
			if (strText.charAt(i) != ' ') break;
		}
		if (i >= strText.length) return ('');
		if (i > 0) strText = strText.substring(i, strText.length);
		for (j=strText.length-1; j > i; --j) {
			if (strText.charAt(j) != ' ') break;
		}
		if (j < strText.length -1)
			strText = strText.substring(0, j+1);
		return strText;
	}else{
		return strText;
	}
}
function ValidEmail(s){
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
} 


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_validateForm() { //v4.0
		  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
		  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
		    if (val) { nm=val.name; if ((val=val.value)!="") {
		      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
			if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
		      } else if (test!='R') { num = parseFloat(val);
			if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
			if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
			  min=test.substring(8,p); max=test.substring(p+1);
			  if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
		    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
		  } if (errors) alert('The following error(s) occurred:\n'+errors);
		  document.MM_returnValue = (errors == '');
		}

function checkSearch(query) {
	if(!query) {
		alert('Please enter a search term');
		return false;
	}
}

function DisplayPassword(){
	var obj = xDOM("forgotPassword",0);
	if(obj.style.height == "0px"){
		obj.style.height = "120px";	
		setTimeout("setPassFocus()",10);
	}else{
		obj.style.height = "0px";
	}	
}

function setPassFocus(){
	var objInput = xDOM("forgotForm",0);
	objInput.email.focus();	
}

function CheckPaymentType(objSelect,strValue){
	if (strValue != ""){
		var strSelectValue = strValue
	}else{
		var strSelectValue = objSelect[objSelect.selectedIndex].value;
	}
	
	var objCC = xDOM("CCDetails",0);
	if(strSelectValue.substring(0,1) == '1'){
		objCC.style.display = "block";
	}else{
		objCC.style.display = "none";	
		
	}
}

var strPrevId = ""
var objPrevAnswer = ""
var objPrevQuestion = ""
function toggle(id) {
		
		var objAnswerLayer = xDOM('a' + id,0);
		var objQuestionLayer = xDOM('q' + id,0);
		
		if(strPrevId != ""){
			objPrevAnswer = xDOM('a' + strPrevId,0);
			objPrevQuestion = xDOM('q' + strPrevId,0);
		}
		
		if(objPrevAnswer != "" & id == strPrevId){
			objPrevAnswer.style.display = "none";
			objPrevQuestion.className = 'question';
			objQuestionLayer.blur();
			objPrevAnswer = "";
			strPrevId = "";
		} else if(objPrevAnswer != "" & id != strPrevId){
			objPrevAnswer.style.display = "none";
			objPrevQuestion.className = 'question';
			objAnswerLayer.style.display = "block";
			objQuestionLayer.className = 'questionOn';
			objQuestionLayer.blur();
			objPrevAnswer = objAnswerLayer;
			strPrevId = id;
		} else {
			objAnswerLayer.style.display = "block";
			objQuestionLayer.className = 'questionOn';
			objQuestionLayer.blur();
			objPrevAnswer = objAnswerLayer;
			strPrevId = id;
		}
		
	}

// Cross Browser DOM Functions used to create objects and get top / left coords
// copyright Stephen Chapman, 4th Jan 2005
// you may copy this code but please keep the copyright notice as well
var aDOM = 0, ieDOM = 0, nsDOM = 0
var stdDOM = document.getElementById;
if (stdDOM) aDOM = 1; else {
  ieDOM = document.all;
  if (ieDOM) aDOM = 1; else {
    var nsDOM = (
      (navigator.appName.indexOf('Netscape') != -1)
      && (parseInt(navigator.appVersion) ==4));
    if (nsDOM) aDOM = 1;
  }
}
function xDOM(objectId, withStyle) {
var st = ''; if (withStyle) st = '.style';
if (stdDOM) return (eval('document.getElementById(objectId)'+st));
if (ieDOM) return (eval('document.all[objectId]'+st));
if (nsDOM) return (document.layers[objectId]);
}

function ValidateUpdateUser(objForm){
	
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strTelephone = strTrim(objForm.telephone.value);
	var strEmail = strTrim(objForm.email.value);
	/** Admin Password **/
	
	var strOldAdminPass = strTrim(objForm.oldAdminpassword.value);
	var strAdminPassword = strTrim(objForm.adminpassword.value);
	var strConfirmAdminPassword = strTrim(objForm.confirmadminpassword.value);


	/** Unit password **/
	var strOldPassword = strTrim(objForm.oldpassword.value);
	var strPassword = strTrim(objForm.password.value);
	var strConfirmPassword = strTrim(objForm.confirmpassword.value);
	
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}			
	if (strTelephone==""){
		strAlert += "- Enter your telephone number\n";
		isAlert = true;
	}						
	if(strEmail == "") {
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}		
	
	if(strOldAdminPass!=''){
		if(strAdminPassword==""){
			strAlert += "- Enter your new Admin password\n";
			isAlert = true;			
		}else if(strAdminPassword.length < 6){
			strAlert += "- Ensure your new Admin password is at least 6 characters\n";
			isAlert = true;
		}else if(strAdminPassword != strConfirmAdminPassword){
			strAlert += "- Ensure your new Admin password and confirm password match\n";
			isAlert = true;
		}					
	}
	if(strOldPassword!=''){
		if(strPassword==""){
			strAlert += "- Enter your new Unit password\n";
			isAlert = true;			
		}else if(strPassword.length < 6){
			strAlert += "- Ensure your new Unit password is at least 6 characters\n";
			isAlert = true;
		}if(strPassword != strConfirmPassword){
			strAlert += "- Ensure your new Unit password and confirm password match\n";
			isAlert = true;
		}					
	}
	
	
	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}
	
	
	
}



function ValidateNewUser(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strTelephone = strTrim(objForm.telephone.value);
	var strEmail = strTrim(objForm.email.value);
	var strPassword = strTrim(objForm.password.value);
	var strConfirmPassword = strTrim(objForm.confirmpassword.value);
	
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}			
	if (strTelephone==""){
		strAlert += "- Enter your telephone number\n";
		isAlert = true;
	}						
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}		
	if(strPassword == "") {
		strAlert += "- Enter a password\n";
		isAlert = true;
	}else if(strPassword.length < 6){
		strAlert += "- Ensure your password is at least 6 characters\n";
		isAlert = true;
	}else if(strPassword != strConfirmPassword){
		strAlert += "- Ensure your password and confirm password match\n";
		isAlert = true;
	}			
	
	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}
}


function CheckLogin(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;

	var username = strTrim(objForm.username.value)
	var password = strTrim(objForm.password.value)

	if (username==""){
		strAlert += "- Please enter your email address\n";
		isAlert = true;
	}		

	if (password==""){
		strAlert += "- Please enter your password\n";
		isAlert = true;
	}			
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}
}

function ValidateUser(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strPosition = strTrim(objForm.position.value);	
	var strDepartment = strTrim(objForm.company.value);	
	var strEmail = strTrim(objForm.email.value);
	var strPassword = strTrim(objForm.password.value);
	var strConfirmPassword = strTrim(objForm.confirmpassword.value);
	var strCAPTCHA = strTrim(objForm.strCAPTCHA.value);
	
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}			
	if (strPosition==""){
		strAlert += "- Enter your position\n";
		isAlert = true;
	}		
	if (strDepartment==""){
		strAlert += "- Enter your department\n";
		isAlert = true;
	}			
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}		
	if(strPassword == "") {
		strAlert += "- Enter a password\n";
		isAlert = true;
	}else if(strPassword.length < 6){
		strAlert += "- Ensure your password is at least 6 characters\n";
		isAlert = true;
	}else if(strPassword != strConfirmPassword){
		strAlert += "- Ensure your password and confirm password match\n";
		isAlert = true;
	}			
	
	
	if (strCAPTCHA==""){
		strAlert += "- Enter the verification code\n";
		isAlert = true;
	}	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}
}


function ValidateMailingList(objForm, newsNum){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strEmail = strTrim(objForm.email.value);
	var strCity = strTrim(objForm.city.value);
	var strCountry = strTrim(objForm.country.value);
	var intTotalNews = parseInt(strTrim(objForm.totalList.value));
	var strCAPTCHA = strTrim(objForm.strCAPTCHA.value);	
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}	
	if (strCity==""){
		strAlert += "- Enter your city\n";
		isAlert = true;
	}
	if (strCountry==""){
		strAlert += "- Enter your country\n";
		isAlert = true;
	}
	var checkboxcount=0;
	
	   for(var i=1;i<=intTotalNews;i++) 
	   {
		  if(document.getElementById('list'+i)){
			  var checkboxid = document.getElementById('list'+i);
		  	if(checkboxid.checked) 
		  	{
		  	checkboxcount+=1;
		  	}
		  }
	   }
	if(checkboxcount==0){
		strAlert += "- Select at least one newsletter\n";
		isAlert = true;	
	}
	
	if (strCAPTCHA==""){
		strAlert += "- Enter the verification code\n";
		isAlert = true;
	}	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	

}


function ValidateContactForm(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strContactMethod = strTrim(objForm.contactMethod.options[objForm.contactMethod.selectedIndex].value);
	var strEmail = strTrim(objForm.email.value);
	var strPhoneHome = strTrim(objForm.homePhone.value);
	var strPhoneWork = strTrim(objForm.workPhone.value);
	var strMobilePhone = strTrim(objForm.mobilePhone.value);
	var strSendTo = strTrim(objForm.areaInquiry.options[objForm.areaInquiry.selectedIndex].value);
	var strMessage = strTrim(objForm.message.value);
	var strHearAIM = "";
	var strCAPTCHA = strTrim(objForm.strCAPTCHA.value);
	
	
	while (objForm.hearAIM.selectedIndex != -1){
			var strHearAIM = objForm.hearAIM.options[objForm.hearAIM.selectedIndex].value;
        break;
    }

	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}
	if (strContactMethod==""){
		strAlert += "- Select a contact method\n";
		isAlert = true;
	}
	//if (strContactMethod=="Email"){
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}
	//}
	if (strContactMethod=="Home Phone"){
		if(strPhoneHome == ""){
			strAlert += "- Enter a home phone number\n";
			isAlert = true;
		}
	}
	if (strContactMethod=="Work Phone"){
		if(strPhoneWork == ""){
			strAlert += "- Enter a work phone number\n";
			isAlert = true;
		}
	}
	if (strContactMethod=="Mobile"){
		if(strMobilePhone == ""){
			strAlert += "- Enter a mobile number\n";
			isAlert = true;
		}
	}
	/*if (strSendTo==""){
		strAlert += "- Select an area of your enquiry\n";
		isAlert = true;
	}*/
	if (strMessage==""){
		strAlert += "- Enter a message\n";
		isAlert = true;
	}	
	if (strHearAIM==""){
		strAlert += "- Select how you heard about AIM\n";
		isAlert = true;
	}
	if (strCAPTCHA==""){
		strAlert += "- Enter the verification code\n";
		isAlert = true;
	}	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	

}


function CheckOrder(objForm){
	//alert(objForm.CourseSKU.selectedIndex)
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	
	var strAreaInterest = strTrim(objForm.areaInterest.options[objForm.areaInterest.selectedIndex].value);
	var intCourse = strTrim(objForm.CourseSKU.options[objForm.CourseSKU.selectedIndex].value);
	var intStudyYear = strTrim(objForm.intyear.options[objForm.intyear.selectedIndex].value);
	var strStudySemester = strTrim(objForm.semester.options[objForm.semester.selectedIndex].value);
	var strStudyTime = objForm.studyperiod;
	var strFirstName = strTrim(objForm.firstname.value);
	var strLastName = strTrim(objForm.surname.value);
	var strCountry = strTrim(objForm.rgCountry.options[objForm.rgCountry.selectedIndex].value);
	var strAddress = strTrim(objForm.address1.value);
	var strSuburb = strTrim(objForm.suburb.value);
	var strState = strTrim(objForm.state.options[objForm.state.selectedIndex].value);	
	var strPostcode = strTrim(objForm.postcode.value);
	var strPhone = strTrim(objForm.phone.value);	
	var strEmail = strTrim(objForm.email.value);	
	var strBirthdate = strTrim(objForm.birthdate.value);
	var strGender = objForm.gender;	
	var strresidencystatus = strTrim(objForm.residencystatus.options[objForm.residencystatus.selectedIndex].value);	
	var strSchool = strTrim(objForm.school.value);	
	var strStudyLevel = strTrim(objForm.schoollevel.options[objForm.schoollevel.selectedIndex].value);	
	var strSchoolYear = objForm.schoolyear;
	var strCAPTCHA = strTrim(objForm.strCAPTCHA.value);
	//var strStudyMusicSubject = strTrim(objForm.subjects.options[objForm.subjects.selectedIndex].value);	
	/*var strHearAIM = objForm.hearAIM.options[objForm.hearAIM.selectedIndex].value;*/
	var strHearAIM = "";
	
	/*var arrHearAIM = new Array();*/
	while (objForm.hearAIM.selectedIndex != -1){
			var strHearAIM = objForm.hearAIM.options[objForm.hearAIM.selectedIndex].value;
		/*arrHearAIM.push(objForm.hearAIM.options[objForm.hearAIM.selectedIndex].value);*/
        break;
    }
	
	if (strAreaInterest==""){
		strAlert += "- Select an area of interest\n";
		isAlert = true;
	}
	if (intCourse==""){
		strAlert += "- Select a course\n";
		isAlert = true;
	}
	if (intStudyYear==""){
		strAlert += "- Select a year you interested in studying\n";
		isAlert = true;
	}
	if (strStudySemester==""){
		strAlert += "- Select a semester you interested in studying\n";
		isAlert = true;
	}
	var StudyTimeOption = -1;
	for (i=0; i < strStudyTime.length; i++) {
		if (strStudyTime[i].checked) {
			StudyTimeOption = i;
		}
	}
	if (StudyTimeOption == -1) {
		strAlert += "- Select a study type\n";
	}
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	if (strLastName==""){
		strAlert += "- Enter your surname\n";
		isAlert = true;
	}
	if (strCountry==""){
		strAlert += "- Select your country\n";
		isAlert = true;
	}
	if (strAddress==""){
		strAlert += "- Enter your address\n";
		isAlert = true;
	}	
	if (strSuburb==""){
		strAlert += "- Enter your suburb\n";
		isAlert = true;
	}		
	if (strCountry=="AUSTRALIA"){
		if(strState == ""){
			strAlert += "- Select your state\n";
			isAlert = true;
		}
		if(strPostcode == ""){
			strAlert += "- Enter your postcode\n";
			isAlert = true;
		}
	}
	if (strPhone==""){
		strAlert += "- Enter your phone number\n";
		isAlert = true;
	}
	if (strEmail==""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}
	if (strBirthdate==""){
		strAlert += "- Enter your birth date\n";
		isAlert = true;
	}else if(strBirthdate.charAt(2) != "/" | strBirthdate.charAt(5) != "/"){
		strAlert += "- Enter your birth date in dd/mm/yyyy format\n";
		isAlert = true;	
	}
	var GenderOption = -1;
	for (i=0; i < strGender.length; i++) {
		if (strGender[i].checked) {
			GenderOption = i;
		}
	}
	if (GenderOption == -1) {
		strAlert += "- Enter your gender\n";
	}
	if (strresidencystatus==""){
		strAlert += "- Select your Australian residency status\n";
		isAlert = true;
	}
	if (strSchool==""){
		strAlert += "- Enter your attended high school\n";
		isAlert = true;
	}		
	if (strStudyLevel==""){
		strAlert += "- Select your level of study at school\n";
		isAlert = true;
	}	
	/*if (strSchoolYear==""){
		strAlert += "- Enter your year completed year 12\n";
		isAlert = true;
	}*/
	//if (strStudyMusicSubject==""){
	//	strAlert += "- Select a music subject you studied at school\n";
	//	isAlert = true;
	//}
	if (strHearAIM==""){
		strAlert += "- Select how you heard about AIM\n";
		isAlert = true;
	}
	
	if (strCAPTCHA==""){
		strAlert += "- Enter the verification code\n";
		isAlert = true;
	}	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	
	
}

function ValidateNewsletterForm(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strEmail = strTrim(objForm.email.value);
		
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}
	
	var checkboxcount=0;
	   for(var i=0;i<objForm.elements.length;i++) 
	   {
		  if(objForm.elements[i].checked) 
		  {
		  checkboxcount+=1;
		  }
	   }
	if(checkboxcount==0){
		strAlert += "- Select at least one newsletter\n";
		isAlert = true;	
	}
	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	

}

function ValidateAlumniForm(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strFirstName = strTrim(objForm.firstName.value);
	var strLastName = strTrim(objForm.lastName.value);
	var strCourseStudied = strTrim(objForm.courseStudied.value);
	var strYearGraduated = strTrim(objForm.yearGraduated.value);
	var strEmail = strTrim(objForm.email.value);
	var strMessage = strTrim(objForm.news.value);
		
	if (strFirstName==""){
		strAlert += "- Enter your first name\n";
		isAlert = true;
	}
	if (strLastName==""){
		strAlert += "- Enter your last name\n";
		isAlert = true;
	}
	if (strCourseStudied==""){
		strAlert += "- Enter your course studied\n";
		isAlert = true;
	}
	if (strYearGraduated==""){
		strAlert += "- Enter your year graduated\n";
		isAlert = true;
	}
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}
	if (strMessage==""){
		strAlert += "- Enter your news\n";
		isAlert = true;
	}	
	if (objForm.news.value.length > 250){
		strAlert += "- Your news are too long, it must be 250 characters or less\n";
		isAlert = true;
	}	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	

}

function checkLength(objFormInput){
    if (objFormInput.value.length > 250){
        alert("Text too long. Must be 250 characters or less");
        return false;
    }
    return true;
}

function ValidateEventForm(objForm){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;
	var strName = strTrim(objForm.name.value);
	var strEmail = strTrim(objForm.email.value);
	var strUserGroup = objForm.usergroup;
	var strStudentNumber = strTrim(objForm.studentNumber.value);
	var strYearGraduated = strTrim(objForm.yearGraduated.value);
	var strCourseStudied = strTrim(objForm.courseStudied.value);
	var strDepartment = strTrim(objForm.department.value);
	var strEventName = strTrim(objForm.eventName.value);
	var strEventDate = strTrim(objForm.eventDate.value);
	var strLocation = strTrim(objForm.location.value);
	var strMessage = strTrim(objForm.comments.value);
	var strCAPTCHA = strTrim(objForm.strCAPTCHA.value);	
	if (strName==""){
		strAlert += "- Enter your name\n";
		isAlert = true;
	}
	if(strEmail == ""){
		strAlert += "- Enter your email address\n";
		isAlert = true;
	}else if(!ValidEmail(strEmail)){
		strAlert += "- Enter a valid email address\n";
		isAlert = true;
	}
	if (strUserGroup==""){
		strAlert += "- Select if you are a current student, past student or a teacher\n";
		isAlert = true;
	}
	if (strUserGroup=="Current Student"){
		if(strStudentNumber == ""){
			strAlert += "- Enter your student number\n";
			isAlert = true;
		}
	}
	if (strUserGroup=="Past Student"){
		if(strYearGraduated == ""){
			strAlert += "- Enter your year graduated\n";
			isAlert = true;
		}
		if(strCourseStudied == ""){
			strAlert += "- Enter your course studied\n";
			isAlert = true;
		}
	}
	if (strUserGroup=="Teacher"){
		if(strDepartment == ""){
			strAlert += "- Enter your department\n";
			isAlert = true;
		}
	}
	if (strEventName==""){
		strAlert += "- Enter the event name\n";
		isAlert = true;
	}
	if (strEventDate==""){
		strAlert += "- Enter the event date\n";
		isAlert = true;
	}
	if (strLocation==""){
		strAlert += "- Enter the event location\n";
		isAlert = true;
	}
	if (strMessage==""){
		strAlert += "- Enter your comments\n";
		isAlert = true;
	}	
	if (objForm.comments.value.length > 250){
		strAlert += "- Your comments are too long, it must be 250 characters or less\n";
		isAlert = true;
	}	
	
	if (strCAPTCHA==""){
		strAlert += "- Enter the verification code\n";
		isAlert = true;
	}	
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	

}

function removeOptions(objForm){
	alert(objForm.CourseSKU.options.length);
	for(var j=1; j<objForm.CourseSKU.options.length; j++) {
		/*objForm.CourseSKU.options[j] = null;*/
		objForm.CourseSKU.remove(j);
	}
		
}




// ROTATING NEWS BANNER //
// Scripts for the Rotating News stuff....
var intSecondBetweenItems = 5;
var intPreviousItem = 0;
var intTotalItems = 5;
function DisplayContent(strID){	
	if(intPreviousItem!=0) {
		//SwapButton(intPreviousItem,"/css/images/HomeNewsNumberGrey.gif");
		displayPreObjNum = getObj("news_"+intPreviousItem);
		displayPreObjNum.className = "NumberItem";
	}

	//SwapButton(strID,"/css/images/HomeNewsNumberGreen.gif");
	displayObjNum = getObj("news_"+strID);
	displayObjNum.className = "NumberItemOn";
	displayObj = getObj("newsContent");
	displayObj.innerHTML = "";
	displayObj.innerHTML = unescape(arrHomeNews[strID].strHtml)	;

	if(intTotalItems == parseInt(strID)){
		intNextNewsID = 1;
	}else{
		intNextNewsID = parseInt(strID) + 1;
	}
	intPreviousItem = strID;
}

function cycleNewsItems(strID){
	if(blnCycleNews){
		DisplayContent(strID);
		setTimeout("cycleNewsItems(intNextNewsID)", intSecondBetweenItems*1000)
	}
}

function DisplayNewsItem(strID){
	blnCycleNews = false
	DisplayContent(strID);
}

function PauseNews(){
	blnCycleNews = false
}
function restartNews(){
	if(!blnCycleNews){
		blnCycleNews = true
		cycleNewsItems(intNextNewsID);
	}
}	

function GoBackOne(){
	blnCycleNews = false;
	intNextNewsID = intNextNewsID - 2;
	if(intNextNewsID < 1){
		intNextNewsID = parseInt(intNextNewsID) + parseInt(intTotalItems);
	}
	DisplayContent(intNextNewsID);	
}
function GoForwardOne(){
	blnCycleNews = false
	DisplayContent(intNextNewsID);
}	
function initNews(intTotal){
	intTotalItems = intTotal;
	cycleNewsItems(1)
}

function SwapButton(strID,strImageAndPath){
	objButton = getObj("news_" + strID)
	objButton.style.background='url('+ strImageAndPath +') no-repeat'
}

function getObj(id){
	if(document.getElementById){
		return document.getElementById(id);
	}else{
		return document.all[id];
	} 
}

function getDayWk(intYear, intMonth, intDay){
	var arrayDay = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 
	var newsDate = new Date();
	newsDate.setFullYear(intYear,intMonth,intDay);
	var numnewsDay = newsDate.getDay();

	return arrayDay[numnewsDay]+", ";
}

function getSuffix(newsDay){
	// Add suffix to date (1st, 2nd, 4th, etc.)
	var suffix;
	
	if (newsDay==1) { suffix=("st"); }
	else if (newsDay==2) { suffix=("nd"); }
	else if (newsDay==3) { suffix=("rd"); }
	else if (newsDay==21) { suffix=("st"); }
	else if (newsDay==22) { suffix=("nd"); }
	else if (newsDay==23) { suffix=("rd"); }
	else if (newsDay==31) { suffix=("st"); }
	else suffix=("th");
	
	return suffix;
}

function showFlash(flashsrc, imageSRC, flashwidth, flashheight){
	var fo = new SWFObject("/includes/FlowPlayer.swf", "FlowPlayer", flashwidth, flashheight, "9", "#ffffff", true);
	fo.addParam("AllowScriptAccess", "always");
	fo.addParam("allowFullScreen", "true");
	fo.addParam("movie", "/includes/FlowPlayer.swf");					  
	fo.addParam("quality", "high");
	fo.addParam("scaleMode", "showAll");
	fo.addParam("allowNetworking", "all");
	fo.addParam("wmode", "transparent");
	fo.addVariable("config", "{fullScreenScriptURL:'/includes/fullscreen.js',autoPlay: true,loop: false,initialScale: 'scale',showLoopButton: false,showMenu: false,showPlayListButtons: false,playList: [  { url: '" + imageSRC + "', overlayId: 'play' }, { url:'" + flashsrc + "' }, { overlayId: 'play' } ]}");
	fo.write("fp1");
}

function displaySection(divName1, divName2){
	if (document.getElementById('studentNumberSection')!=null)document.getElementById('studentNumberSection').style.display='none';
	if (document.getElementById('yearGraduatedSection')!=null)document.getElementById('yearGraduatedSection').style.display='none';
	if (document.getElementById('courseStudiedSection')!=null)document.getElementById('courseStudiedSection').style.display='none';
	if (document.getElementById('departmentSection')!=null)document.getElementById('departmentSection').style.display='none';
	
	if(divName1!='') {
		if (document.getElementById(divName1)!=null)document.getElementById(divName1).style.display='list-item';
	}
	if(divName2!='') {
		if (document.getElementById(divName2)!=null)document.getElementById(divName2).style.display='list-item';
	}
}

// -----------------------------------------------------------------------------------------------------------------------------------------
/// Flash UFO functions
// -----------------------------------------------------------------------------------------------------------------------------------------

function FixFlash(strContainerID, strFlashPath, width, height, flashvars){
	var FO = { movie:strFlashPath, width:width + "px", height:height + "px", flashvars:flashvars, wmode:"transparent", majorversion:"7", build:"40"};
	UFO.create(FO, strContainerID);	
}