<!--
	var str_SpFeeCode = "CBSEB09"; // Dynan Felicity 24/10/2007 - Global variable added to reduce the number of changes required when the special fee is updated. ** MUST be in UPPER CASE **
	
	/* =============================================================================
	Function:	toggleVisibility(strId)
	Purpose:	The function is called onclicking of different tabs on the home page
	Parameters:	Required:strId
				1)strId
				Data type:string
				Description:id of the tab clicked
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(17/12/2007)
	============================================================================= */
		var wkArray = new Array('tab1','tab2','tab3','tab4','tab5');
		var tabTextArray = new Array('textTab1','textTab2','textTab3','textTab4','textTab5');
				

function toggleVisibility(strId){
	for(x=0; x < (wkArray.length) ; x++){
		if(strId == wkArray[x]){			
			document.getElementById(wkArray[x]).style.backgroundImage="url('images/tab_white.gif')";			
			document.getElementById(wkArray[x]).style.color='#333';
			document.getElementById(wkArray[x]).style.cursor='auto';
			document.getElementById(tabTextArray[x]).style.display='block';
		
			
		}else{
			
			
			document.getElementById(wkArray[x]).style.backgroundImage="url('images/tab_dark_grey.gif')";	
			document.getElementById(wkArray[x]).style.color="#fff";
			document.getElementById(wkArray[x]).style.cursor='pointer';
			document.getElementById(tabTextArray[x]).style.display='none';	
			
			
		}
	}
}
	/* =============================================================================
	Function:	popUpNewWin(url)
	Purpose:	open a new window. For the javascript navigation arrays.
	Parameters:1)url
				Data type:String
				Description:Url of the website to be opened in a new window
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(2/08/2006)
	============================================================================= */
	function popUpNewWin(url)
		{
	 
			window.open(url,"","");
		}
	/* =============================================================================
	Function:	openWindowDetails()
	Purpose:	Opens the customer Login screen in a separate window
	Parameters:	none
	Returns:	nothing
	Author:		Shefali Adlakha Joshi
	============================================================================= */

	function openWindowDetails() {
		var propStr = 'toolbar=1,location=0,directories=0,menubar=0,status=0,scrollbars=1,resizable=1,width='+screen.width+',height='+screen.height+',top=0,left=0'
		popupWin = window.open('https://federal.apesma.asn.au/source/security/member-logon.cfm?section=customer', 'popup_eseries', propStr)
	}
	/* =============================================================================
	Function:	show(strId)
	Purpose:	The function displays the specified div/span on the page.
	Parameters:	Required:strDivId
				1)strDivId
				Data type:string
				Description:it is the name of the div/span to be displayed on the page.
	Returns:	nothing
	Author:		Dynan Felicity (22/10/2007)
	============================================================================= */	
	function show(strId) {
		document.getElementById(strId).style.display = 'block';
	}
	/* =============================================================================
	Function:	hide(strId)
	Purpose:	The function hides the specified div/span on the page.
	Parameters:	Required:strDivId
				1)strDivId
				Data type:string
				Description:it is the name of the div/span to be hidden on the page.
	Returns:	nothing
	Author:		Dynan Felicity (22/10/2007)
	============================================================================= */	
	function hide(strId) {
		document.getElementById(strId).style.display = 'none';
	}
	/* =============================================================================
	Function:	fnSubmit()
	Purpose:	The function is called when the user submits to itself
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(24/08/2006)
	============================================================================= */	
	function fnSubmit()
	{
		document.frmCourseBooking.hidSubmit.value="true";			
		document.frmCourseBooking.submit();		
	}
	/*=============================================================================
	Function:	fnValidateEmailFriend()
	Purpose:	Validates the form fields of the forward_url_to_friend.asp form
	Parameters:	none
	Returns:	none
	Author:		Shefali Adlakha Joshi(12/06/2008)
============================================================================= */
	

function fnValidateEmailFriend()
	{
		var blnSubmit = true;
		if (document.getElementById("txtFriendName").value == "") 
		{
			alert('Please enter the name of your friend');
			document.getElementById("txtFriendName").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("txtFriendEmail").value == "") 
		{
			alert('Please enter the email id of your friend');
			document.getElementById("txtFriendEmail").focus();
			blnSubmit=false;
		}
		else if (!emailcheck(document.getElementById("txtFriendEmail").value)) 
		{
			document.getElementById("txtFriendEmail").select();
			document.getElementById("txtFriendEmail").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("txtYourName").value == "") 
		{
			alert('Please enter your name');
			document.getElementById("txtYourName").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("txtYourEmail").value == "") 
		{
			alert('Please enter your email id');
			document.getElementById("txtYourEmail").focus();
			blnSubmit=false;
		}
		else if (!emailcheck(document.getElementById("txtYourEmail").value)) 
		{
			document.getElementById("txtYourEmail").select();
			document.getElementById("txtYourEmail").focus();
			blnSubmit=false;
		}
		if(blnSubmit == true){
		document.frmEmailFriend.submit();
		
		}
		
		
	}
	/* =============================================================================
	Function:	fnSetFeeIndividual(strValue,x)
	Purpose:	The function is called when the user selects the dates from the drop down and it assigns the fee to the fee textbox
	Parameters:	Required:strValue,x
				1)strValue
				Data type:string
				Description:it is the value selected from the date drop down.
				2)x				
				Data type:number
				Description:it denotes the product for which the date is chosen.
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(11/10/2006)
	============================================================================= */	
	
	function fnSetFeeIndividual(strValue,x)
	{
		var arrValue;		
		var strCourseFee;
		var strHidMemFee,strHidNonMemFee,strHidSpFee;

		var strSpFee; // Dynan Felicity 24/10/2007 - variable added to convert user's special fee code to uppercase, making it case-insensitive
		
		strSpFee = document.frmCourseBooking.p1_SpFeeCode.value; // Dynan Felicity 24/10/2007 - Set user's special fee code to the variable
			
		strHidMemFee="hid"+x+"_curMemFee";
		strHidNonMemFee="hid"+x+"_curNonMemFee";
		strHidSpFee="hid"+x+"_curSpFee";		
		strCourseFee="p"+x+"_CourseFee";
		
		if(strValue != "")
		{			
			arrValue=strValue.split("||");
			
			
			if((strSpFee.toUpperCase() == str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
			{
				
				document.getElementById(strCourseFee).value=arrValue[3];				
			}
			else 
			{							
				
				if((document.frmCourseBooking.p1_apesmaMember[0].checked) && (document.frmCourseBooking.p1_mshipNo.value != ""))
				{ 					
					document.getElementById(strCourseFee).value=arrValue[1];
				}
				else if(document.frmCourseBooking.p1_apesmaMember[1].checked) 
				{
					document.getElementById(strCourseFee).value=arrValue[2];					
				}						
				else
				{
					document.getElementById(strCourseFee).value=arrValue[2];		
				}
			}
			document.getElementById(strHidMemFee).value=arrValue[1];	
			document.getElementById(strHidNonMemFee).value=arrValue[2];
			document.getElementById(strHidSpFee).value=arrValue[3];		
		}
	
	
	}
/* =============================================================================
	Function:	fnEnableFeeIndividual(strVal)
	Purpose:	The function resets the value of course fee depending on if the member is an APESMA member or has filled the sp fee code etc	
	Parameters:	Required:strVal
				1)strVal
				Data type:string
				Description:It's value can be 'Member' or 'NonMember' or 'MembershipNumber' or 'Special'			
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(11/10/2006)
	============================================================================= */
	
	function fnEnableFeeIndividual(strVal){			
			
			var strFee;			
			var strCourseFee;						
			var strHidMemFee,strHidNonMemFee,strHidSpFee;
			var intCourses,intTotalCourses;
			var i;
			var strSpFee;
			
			strSpFee = document.frmCourseBooking.p1_SpFeeCode.value;
			
			intTotalCourses=1;
					
			intCourses=document.frmCourseBooking.participantQty.value;			
	
			if (intCourses == "")
			{
				intCourses=0;
			}
			else if(isNaN(intCourses))
			{
				intCourses=0;
				
			}
			else
			{
				intCourses=parseInt(intCourses);		
			}
			intTotalCourses=intTotalCourses+intCourses;			
			
				
			switch(strVal)
			{
				case 'Member':
				{			
					document.frmCourseBooking.p1_mshipNo.disabled=false;		
					
					if(document.frmCourseBooking.p1_mshipNo.value == "")
					{
						document.frmCourseBooking.p1_mshipNo.focus();
					}
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";
						strHidMemFee="hid"+i+"_curMemFee";						
						
						strFee="";
						strFee=document.getElementById(strHidMemFee).value;
						
						if(strFee != "")
						{
							if((!isNaN(strFee)) && document.frmCourseBooking.p1_mshipNo.value != "" && (strSpFee.toUpperCase() != str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
							{
								document.getElementById(strCourseFee).value=strFee;							
							}
						}	
					}							
					break;
				}
				case 'MembershipNumber':
				{			
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";
						strHidMemFee="hid"+i+"_curMemFee";						
												
						strFee="";
						strFee=document.getElementById(strHidMemFee).value;	
								
						if(strFee != "")
						{
							if((!isNaN(strFee)) && document.frmCourseBooking.p1_mshipNo.value != "" && (strSpFee.toUpperCase() != str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
							{
								document.getElementById(strCourseFee).value=strFee;							
							}
						}	
					}							
					break;
				}
				case 'NonMember':
				{					
					document.frmCourseBooking.p1_mshipNo.value="";
					document.frmCourseBooking.p1_mshipNo.disabled=true;
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";						
						strHidNonMemFee="hid"+i+"_curNonMemFee";						
						strFee="";
						strFee=document.getElementById(strHidNonMemFee).value;							
						if(strFee != "")
						{
							if((!isNaN(strFee)) && (strSpFee.toUpperCase() != str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
							{
								document.getElementById(strCourseFee).value=strFee;							
							}
						}	
					}				
					break;
				}
				case 'Special':
				{
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";
						strHidMemFee="hid"+i+"_curMemFee";	
						strHidNonMemFee="hid"+i+"_curNonMemFee";					
						strHidSpFee="hid"+i+"_curSpFee";
						
						strFee="";
						strFee=document.getElementById(strHidSpFee).value;
											
						if((strFee != ""))
						{
							if((!isNaN(strFee)) && (strSpFee.toUpperCase() == str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
							{
								document.getElementById(strCourseFee).value=strFee;							
							}
							else if(document.frmCourseBooking.p1_apesmaMember[0].checked && document.frmCourseBooking.p1_mshipNo.value != "")					
							{
								document.getElementById(strCourseFee).value=document.getElementById(strHidMemFee).value;							
							}
							else
							{
								document.getElementById(strCourseFee).value=document.getElementById(strHidNonMemFee).value;								
							}		
						}	
					}					
					break;
				}
				default:
				{
					
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";						
						strHidNonMemFee="hid"+i+"_curNonMemFee";						
						strFee="";
						strFee=document.getElementById(strHidNonMemFee).value;
						if(strFee != "")
						{
							if((!isNaN(strFee)))
							{
								document.getElementById(strCourseFee).value=strFee;
							}
						}
					}
				}
			}
				
			
		}

/* =============================================================================
	Function:	validateIndividualBooking()
	Purpose:	The function validates the individual booking form	
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(12/10/2006)
	============================================================================= */
	function validateIndividualBooking() {

		var i,j;		
		var strCourse,strDates;
		var rdAssessment,rdAssessment0,rdAssessment1;		
		var intParticipants,intParticipantQty; 
		
		intParticipants=1;

		if (document.frmCourseBooking.p1_apesmaMember[0].checked)
		{
			if(document.frmCourseBooking.p1_mshipNo.value == "")
				{
					alert("Please enter the membership number for the participant.");
					document.frmCourseBooking.p1_mshipNo.focus();						
					return false;
					
				}				
		}
		else if (document.frmCourseBooking.p1_apesmaMember[1].checked)
		{
				//do nothing
		}
		else
		{
			alert("Please select if the participant is an APESMA or an affiliate member.");
			document.frmCourseBooking.p1_apesmaMember[0].focus();
			return false;				
		}
		
		if(document.frmCourseBooking.p1_title.selectedIndex == 0)
		{
			alert("Please select the Title for the participant.");
			document.frmCourseBooking.p1_title.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_name.value == "")
		{
			alert("Please enter the first name for the participant.");
			document.frmCourseBooking.p1_name.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_surname.value == "")
		{
			alert("Please enter the last name for the participant.");
			document.frmCourseBooking.p1_surname.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_email.value == "")
		{
			alert("Please enter the Email for the participant.");
			document.frmCourseBooking.p1_email.focus();
			return false;
		}
		else if (emailcheck(document.frmCourseBooking.p1_email.value)==false){
			document.frmCourseBooking.p1_email.select();
			document.frmCourseBooking.p1_email.focus();
			return false;
		}  		
		if(document.frmCourseBooking.p1_phone.value == "")
		{
			alert("Please enter the phone number for the participant.");
			document.frmCourseBooking.p1_phone.focus();
			return false;
		}
		
		if ((!(document.frmCourseBooking.rdBooker[0].checked)) && (!(document.frmCourseBooking.rdBooker[1].checked)))
		{
			alert("Please select if the participant is also the booker of the short course.");
			document.frmCourseBooking.rdBooker[0].focus();
			return false;	
		}
	
		intParticipantQty=document.frmCourseBooking.participantQty.value;
		
		if (intParticipantQty == "")
		{
			intParticipantQty=0;
		}
		else if(isNaN(intParticipantQty))
		{
			intParticipantQty=0;
			alert("Please enter a valid number of courses.");
			document.frmCourseBooking.participantQty.select();						
			document.frmCourseBooking.participantQty.focus();
			return false;
		}
		else
		{
			intParticipantQty=parseInt(intParticipantQty);		
		}
		
		intParticipants=intParticipants+intParticipantQty;
		
		//validation for the course tables added
		for(i=1; i < parseInt(intParticipants)+1; i++)
			{
				
				rdAssessment="p"+i+"_assessment";
				rdAssessment0="p"+i+"_assessment[0]";
				rdAssessment1="p"+i+"_assessment[1]";			
				strCourse="selCourse"+i;
				strDates="selDates"+i;			
			
				
				if(document.getElementById(strCourse).selectedIndex == 0)
				{
					alert("Please select course "+ i + ".");
					document.getElementById(strCourse).focus();
					return false;
				}
				if(document.getElementById(strDates).selectedIndex == 0)
				{
					alert("Please select dates for course "+ i + ".");
					document.getElementById(strDates).focus();
					return false;
				}	
				
				if ((!eval("document.frmCourseBooking."+rdAssessment0+".checked")) && (!eval("document.frmCourseBooking."+rdAssessment1+".checked")))
				{
					alert("Please select if participant would like to complete an assessment task with the short course " + i +".");
					document.getElementById(rdAssessment).focus();
					return false;	
				}
			}		
			if(confirm("Proceed to course registration"))
			{
				if(document.frmCourseBooking.hidPayment.value == "Cheque/DinersCard/Phone")
				{
				document.frmCourseBooking.action ="process_individual_purchase_registration.asp";
				}
				else
				{
				document.frmCourseBooking.action ="process_individual_credit_registration.asp";	
				}
				return true;	
			}
			else
			{
				return false;
			}
	}
	/* =============================================================================
	Function:	validateBookerFormPIA(form)
	Purpose:	The function validates the booking form for PIA online courses
	Parameters: form
				type:form object
				description:Form Object of the form being validated
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(9/12/2008)
	============================================================================= */
	function validateBookerFormPIA(form) {
	  
		 var isSelected = checkDropList(form.other2, "your title.");	
		  if (!isSelected) {
		   return false;
		  }
			  
		 var isOK = checkBlank(	
								form.other3, "your first name",
								form.b_name, "your last name",
								form.b_street, "your street",
								form.b_suburb, "your suburb",
								form.b_state, "your state",
								form.b_postCode, "your post code",							
								form.phone, "your phone number",
								form.email, "your e-mail id"
								);
		 if (!isOK) {
			return false;
		  } 	
		
		
		else if (emailcheck(form.email.value)==false){
			form.email.select();
			form.email.focus();
			return false;
		}  
		else if (!form.accept_policy.checked) {
		  alert ("Please select the PAYMENT, REFUND AND CANCELLATION POLICY to proceed with registration.");
		  form.accept_policy.focus();
		  return false;
		}
	
		else if (confirm ("You are about to proceed into a secure payment site. Once your transaction is complete, you will be presented with a Payment Receipt/Tax Invoice. Please PRINT the Payment Receipt/Tax Invoice as proof of payment."))
		{
			form.action = "https://secure.payments.com.au/checkout.asp";
			return true;
		}
		else return false;
	}
	/* =============================================================================
	Function:	validateBookerForm(form)
	Purpose:	The function validates the booking form
	Parameters: form
				type:form object
				description:Form Object of the form being validated
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(17/08/2006)
	============================================================================= */
	function validateBookerForm(form) {
	  
		 var isSelected = checkDropList(form.other2, "your title.");	
		  if (!isSelected) {
		   return false;
		  }
			  
		 var isOK = checkBlank(	
								form.other3, "your first name",
								form.b_name, "your last name"
								);
		 if (!isOK) {
			return false;
		  } 	
		
		var isOK1 = checkBlank(						
								form.b_street, "your street",
								form.b_suburb, "your suburb");
								
			  if (!isOK1) {
				return false;
			  } 
		var isSelected1 = checkDropList(form.b_state, "your state.");	
		  if (!isSelected1) {
		   return false;
		  }
			  
		var isOK2 = checkBlank(		  
								form.b_postCode, "your post code",							
								form.phone, "your phone number",
								form.email, "your e-mail id"
								);
		if (!isOK2) {
			return false;
		  } 
		else if (emailcheck(form.email.value)==false){
			form.email.select();
			form.email.focus();
			return false;
		}  
		else if (!form.accept_policy.checked) {
		  alert ("Please select the PAYMENT, REFUND AND CANCELLATION POLICY to proceed with registration.");
		  form.accept_policy.focus();
		  return false;
		}
	
		else if (confirm ("You are about to proceed into a secure payment site. Once your transaction is complete, you will be presented with a Payment Receipt/Tax Invoice. Please PRINT the Payment Receipt/Tax Invoice as proof of payment."))
		{
			form.action = "https://secure.payments.com.au/checkout.asp";
			return true;
		}
		else return false;
	}
	
	/* =============================================================================
	Function:	validateBookerForm_new()
	Purpose:	The function validates the booking form
	Parameters: --
	Returns:	--
	Author:		Shefali Adlakha Joshi(14/04/2010)
	============================================================================= */
	
	function validateBookerForm_new()
	{
		var blnSubmit = true;
		if (document.getElementById("other2").selectedIndex == 0) 
		{
			alert('Please select your title');
			document.getElementById("other2").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("other3").value == "") 
		{
			alert('Please enter your first name');
			document.getElementById("other3").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("b_name").value == "") 
		{
			alert('Please enter your last name');
			document.getElementById("b_name").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("b_street").value == "") 
		{
			alert('Please enter your street');
			document.getElementById("b_street").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("b_suburb").value == "") 
		{
			alert('Please enter your suburb');
			document.getElementById("b_suburb").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("b_state").selectedIndex == 0) 
		{
			alert('Please enter your state');
			document.getElementById("b_state").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("b_postCode").value == "") 
		{
			alert('Please enter your post code');
			document.getElementById("b_postCode").focus();
			blnSubmit=false;
		}
		else if (!postcode_validate(document.getElementById("b_postCode").value)) 
		{
			alert('Please enter a valid post code');
			document.getElementById("b_postCode").select();
			document.getElementById("b_postCode").focus();
			
			blnSubmit=false;
		}
		
		else if (document.getElementById("phone").value == "") 
		{
			alert('Please enter your phone');
			document.getElementById("phone").focus();
			blnSubmit=false;
		}
		else if (document.getElementById("email").value == "") 
		{
			alert('Please enter your email id');
			document.getElementById("email").focus();
			blnSubmit=false;
		}
		else if (!emailcheck(document.getElementById("email").value)) 
		{
			alert('Please enter a valid email id');
			document.getElementById("email").select();
			document.getElementById("email").focus();
			blnSubmit=false;
		}
		else if (!document.getElementById("accept_policy").checked) {
		  alert ("Please select the PAYMENT, REFUND AND CANCELLATION POLICY to proceed with registration.");
		  document.getElementById("accept_policy").focus();		
		  blnSubmit=false;
		}
		else if (confirm ("You are about to proceed into a secure payment site. Once your transaction is complete, you will be presented with a Payment Receipt/Tax Invoice. Please PRINT the Payment Receipt/Tax Invoice as proof of payment."))
		{
			document.frmBookingForm.action = "https://secure.payments.com.au/checkout.asp";
			blnSubmit=true;
		}
		if(blnSubmit == true){
		document.frmBookingForm.submit();
		
		}
		
		
	}
	
	/* =============================================================================
	Function:	postcode_validate(postcode)
	Purpose:	validates australian postcodes
	Parameters: form
				type:form object
				description:Form Object of the form being validated
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(14/02/2010)
	============================================================================= */
	function postcode_validate(postcode)
	{
	
		var regPostcode = /^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$/;
	
		if(regPostcode.test(postcode) == false)
		{
			return false;		
		}
		else
		{
			return true;
		}
	
	}

	/* =============================================================================
	Function:	validateBookerFormPurchase(form)
	Purpose:	The function validates the booker form for purchase order/cheque etc payment option
	Parameters: form
				type:form object
				description:Form Object of the form being validated
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(17/08/2006)
	============================================================================= */
	function validateBookerFormPurchase(form){	  
	
		var isSelected = checkDropList(form.other2, "your title.");	
		if (!isSelected) {
		return false;
		}
		  
		var isOK = checkBlank(	
							form.other3, "your first name",
							form.b_name, "your last name"
							);
		if (!isOK) {
		return false;
		} 	
		
		var isOK1 = checkBlank(						
							form.b_street, "your street",
							form.b_suburb, "your suburb");
							
		  if (!isOK1) {
			return false;
		  } 
		var isSelected1 = checkDropList(form.b_state, "your state.");	
		if (!isSelected1) {
		return false;
		}
		  
		var isOK2 = checkBlank(		  
							form.b_postCode, "your post code",							
							form.phone, "your phone number",
							form.email, "your e-mail id"
							);
		if (!isOK2) {
		return false;
		} 
		else if (emailcheck(form.email.value)==false){
		form.email.select();
		form.email.focus();
		return false;
		}  
		var blnCheckRadio = checkRadio(form.rdPayment, "a payment option.");
		if (!blnCheckRadio) {
					return false;
				  }
		else if(form.rdPayment[1].checked)
		{
		var isOK = checkBlank(	
							form.txtOrderNo, "your purchase order number",
							form.txtContactName, "the contact name for payment",
							form.txtPoPhone, "the telephone number"							
							);
		  if (!isOK) {
			return false;
		  } 
		}
		if (!form.accept_policy.checked) {
		alert ("Please select the PAYMENT, REFUND AND CANCELLATION POLICY to proceed with registration.");
		form.accept_policy.focus();
		return false;
		}
		
		else if (confirm ("By proceeding, you are confirming your enrolment/s."))
		{		
			return true;
		}
		else return false;
		}
	/* =============================================================================
	Function:	validateBookerFormPurchasePIA(form)
	Purpose:	The function validates the booker form for purchase order/cheque etc payment option
	Parameters: form
				type:form object
				description:Form Object of the form being validated
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(17/08/2006)
	============================================================================= */
	function validateBookerFormPurchasePIA(form){	  
	
		var isSelected = checkDropList(form.other2, "your title.");	
		if (!isSelected) {
		return false;
		}
		  
		var isOK = checkBlank(	
							form.other3, "your first name",
							form.b_name, "your last name",
							form.b_street, "your street",
							form.b_suburb, "your suburb",
							form.b_state, "your state",
							form.b_postCode, "your post code",							
							form.phone, "your phone number",
							form.email, "your e-mail id"							
							);
		if (!isOK) {
		return false;
		} 			
		else if (emailcheck(form.email.value)==false){
		form.email.select();
		form.email.focus();
		return false;
		}  
		var blnCheckRadio = checkRadio(form.rdPayment, "a payment option.");
		if (!blnCheckRadio) {
					return false;
				  }
		else if(form.rdPayment[1].checked)
		{
		var isOK = checkBlank(	
							form.txtOrderNo, "your purchase order number",
							form.txtContactName, "the contact name for payment",
							form.txtPoPhone, "the telephone number"							
							);
		  if (!isOK) {
			return false;
		  } 
		}
		if (!form.accept_policy.checked) {
		alert ("Please select the PAYMENT, REFUND AND CANCELLATION POLICY to proceed with registration.");
		form.accept_policy.focus();
		return false;
		}
		
		else if (confirm ("By proceeding, you are confirming your enrolment/s."))
		{		
			return true;
		}
		else return false;
		}

	
/* =============================================================================
	Function:	fnSetFeeGroup(strValue,x)
	Purpose:	The function is called when the user selects the dates from the drop down to assign the value to the course fee text box
	Parameters:	Required:strValue,x
				1)strValue
				Data type:string
				Description:it denotes the value of the date chosen.
				2)x
				Data type:number
				Description:it denotes the number of the participant for which the date is chosen.
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(24/08/2006)
	============================================================================= */
	
	
	function fnSetFeeGroup(strValue,x)
	{
		var arrValue,i,strblnFee;		
		var strSpFeeCode,strCourseFee;
		var strHidMemFee,strHidNonMemFee,strHidSpFee;
		var rdApesmaMember0,rdApesmaMember1;
		var strMshipNumber;
		var strSpFee;
		
		strMshipNumber="p"+x+"_mshipNo";		
		strSpFeeCode="p"+x+"_SpFeeCode";
		strCourseFee="p"+x+"_CourseFee";
		strHidMemFee="hid"+x+"_curMemFee";
		strHidNonMemFee="hid"+x+"_curNonMemFee";
		strHidSpFee="hid"+x+"_curSpFee";
		rdApesmaMember0="p"+x+"_apesmaMember[0]";
		rdApesmaMember1="p"+x+"_apesmaMember[1]";
		
		strSpFee = document.getElementById(strSpFeeCode).value;
		
		if(strValue != "")
		{			
			arrValue=strValue.split("||");
			if(strSpFee.toUpperCase() == str_SpFeeCode)
			{
				
				document.getElementById(strCourseFee).value=arrValue[3];				
			}
			else 
			{							
				
				if((eval("document.frmCourseBooking."+rdApesmaMember0+".checked")) && document.getElementById(strMshipNumber).value != "")
				{ 
					
					document.getElementById(strCourseFee).value=arrValue[1];
				}
				else if(eval("document.frmCourseBooking."+rdApesmaMember1+".checked")) 
				{
					document.getElementById(strCourseFee).value=arrValue[2];					
				}						
				else
				{
					document.getElementById(strCourseFee).value=arrValue[2];		
				}
					
			}
			document.getElementById(strHidMemFee).value=arrValue[1];	
			document.getElementById(strHidNonMemFee).value=arrValue[2];
			document.getElementById(strHidSpFee).value=arrValue[3];
		}
	
	
	}

	/* =============================================================================
	Function:	fnEnableFeeGroup(strVal)
	Purpose:	The function is called onclick of the radio button and it enables the field whose name is passed as a parameter.	
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(10/08/2006)
	============================================================================= */
	
	function fnEnableFeeGroup(strVal,x){
			
			
			var strFee;			
			var strMshipNo,strCourseFee,strSpFeeCode;			
			var rdApesmaMember0;
			var strHidMemFee,strHidNonMemFee,strHidSpFee;
			var strSpFee;
	
			strMshipNo="p"+x+"_mshipNo";
			strCourseFee="p"+x+"_CourseFee";
			strSpFeeCode="p"+x+"_SpFeeCode";			
			rdApesmaMember0="p"+x+"_apesmaMember[0]";
			strHidMemFee="hid"+x+"_curMemFee";
			strHidNonMemFee="hid"+x+"_curNonMemFee";
			strHidSpFee="hid"+x+"_curSpFee";
			
			strSpFee = document.getElementById(strSpFeeCode).value;
			
			switch(strVal)
			{
				case 'Member':
				{			
					document.getElementById(strMshipNo).disabled=false;
					strFee=document.getElementById(strHidMemFee).value;
					
					if(document.getElementById(strMshipNo).value == "")
					{
						document.getElementById(strMshipNo).focus();
					}
					if(strFee != "")
					{
						if((!isNaN(strFee)) && document.getElementById(strMshipNo).value != "" && (strSpFee.toUpperCase() != str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
						{
							document.getElementById(strCourseFee).value=strFee;							
						}
					}								
					break;
				}
				case 'MembershipNumber':
				{			
					
					strFee=document.getElementById(strHidMemFee).value;					
					if(strFee != "")
					{
						if((!isNaN(strFee)) && document.getElementById(strMshipNo).value != "" && (strSpFee.toUpperCase() != str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
						{
							document.getElementById(strCourseFee).value=strFee;							
						}
					}								
					break;
				}
				case 'NonMember':
				{
					
					document.getElementById(strMshipNo).value="";
					document.getElementById(strMshipNo).disabled=true;
					strFee=document.getElementById(strHidNonMemFee).value;				
					if(strFee != "")
					{
						if((!isNaN(strFee)) && (strSpFee.toUpperCase() != str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
						{
							document.getElementById(strCourseFee).value=strFee;							
						}
					}					
					break;
				}
				case 'Special':
				{
					strFee=document.getElementById(strHidSpFee).value;										
					if((strFee != ""))
					{
						if((!isNaN(strFee)) && (strSpFee.toUpperCase() == str_SpFeeCode)) // Dynan Felicity 24/10/2007 - Make the Special Fee Code comparison case-insensitive
						{
							document.getElementById(strCourseFee).value=strFee;							
						}
						else if((eval("document.frmCourseBooking."+rdApesmaMember0+".checked")) && document.getElementById(strMshipNo).value != "" )					
						{
							document.getElementById(strCourseFee).value=document.getElementById(strHidMemFee).value;							
						}
						else
						{
							document.getElementById(strCourseFee).value=document.getElementById(strHidNonMemFee).value;								
						}		
					}						
					break;
				}
				default:
				{
					strFee=document.getElementById(strHidNonMemFee).value;
					if(strFee != "")
					{
						if((!isNaN(strFee)))
						{
							document.getElementById(strCourseFee).value=strFee;
						}
					}
				}
			}
				
			
		}

		
/* =============================================================================
	Function:	validateGroupBooking()
	Purpose:	The function validates the booking form	
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(17/08/2006)
	============================================================================= */
	function validateGroupBooking() {

	var i,j;
	var strTitle,strName,strSurname,strEmail,strPhone;
	var strCourse,strDates;
	var strMshipNumber;
	var rdAssessment,rdAssessment0,rdAssessment1;
	var rdApesmaMember,rdApesmaMember0,rdApesmaMember1;		
	var intParticipants,intParticipantQty; 
	var strEmailValue;
	intParticipants=1;
	intParticipantQty=document.frmCourseBooking.participantQty.value;
	
	if (intParticipantQty == "")
	{
		intParticipantQty=0;
	}
	else if(isNaN(intParticipantQty))
	{
		intParticipantQty=0;
		alert("Please enter a valid number in the number of participants field.");
		document.frmCourseBooking.participantQty.select();						
		document.frmCourseBooking.participantQty.focus();
		return false;
	}
	else
	{
		intParticipantQty=parseInt(intParticipantQty);		
	}
	intParticipants=intParticipants+intParticipantQty;
	
	
	for(i=1; i < parseInt(intParticipants)+1; i++)
		{
			strTitle="p"+i+"_title";
			strName="p"+i+"_name";
			strSurname="p"+i+"_surname";
			strEmail="p"+i+"_email";
			strPhone="p"+i+"_phone";
			rdAssessment="p"+i+"_assessment";
			rdAssessment0="p"+i+"_assessment[0]";
			rdAssessment1="p"+i+"_assessment[1]";
			rdApesmaMember="p"+i+"_apesmaMember";
			rdApesmaMember0="p"+i+"_apesmaMember[0]";
			rdApesmaMember1="p"+i+"_apesmaMember[1]";
			strMshipNumber="p"+i+"_mshipNo";
			strCourse="selCourse"+i;
			strDates="selDates"+i;			
			strEmailValue=document.getElementById(strEmail).value;
			
			if (eval("document.frmCourseBooking."+rdApesmaMember0+".checked"))
			{
				if(document.getElementById(strMshipNumber).value == "")
					{
						alert("Please enter the membership number for participant "+i+".");
						document.getElementById(strMshipNumber).focus();						
						return false;
						
					}				
			}
			else if (eval("document.frmCourseBooking."+rdApesmaMember1+".checked"))
			{
					//do nothing
			}
			else
			{
				alert("Please select if participant " + i + " is an APESMA or an affiliate member.");
				document.getElementById(rdApesmaMember).focus();
				return false;				
			}
			
			if(document.getElementById(strCourse).selectedIndex == 0)
			{
				alert("Please select a course for Participant "+ i + ".");
				document.getElementById(strCourse).focus();
				return false;
			}
			if(document.getElementById(strDates).selectedIndex == 0)
			{
				alert("Please select dates for Participant "+ i + ".");
				document.getElementById(strDates).focus();
				return false;
			}	
			if(document.getElementById(strTitle).selectedIndex == 0)
			{
				alert("Please select the Title for participant "+i+".");
				document.getElementById(strTitle).focus();
				return false;
			}
			if(document.getElementById(strName).value == "")
			{
				alert("Please enter the first name for participant "+i+".");
				document.getElementById(strName).focus();
				return false;
			}
			if(document.getElementById(strSurname).value == "")
			{
				alert("Please enter the last name for participant "+i+".");
				document.getElementById(strSurname).focus();
				return false;
			}
			if(document.getElementById(strEmail).value == "")
			{
				alert("Please enter the Email for participant "+i+".");
				document.getElementById(strEmail).focus();
				return false;
			}
			else if (emailcheck(strEmailValue) == false)
			{
				document.getElementById(strEmail).select();
				document.getElementById(strEmail).focus();
				return false;
			}
			if(document.getElementById(strPhone).value == "")
			{
				alert("Please enter the phone for participant "+i+".");
				document.getElementById(strPhone).focus();
				return false;
			}
			if ((!eval("document.frmCourseBooking."+rdAssessment0+".checked")) && (!eval("document.frmCourseBooking."+rdAssessment1+".checked")))
			{
				alert("Please select if participant " + i + " would like to complete an assessment task with the short course.");
				document.getElementById(rdAssessment).focus();
				return false;	
			}
		}		
		if(confirm("Proceed to course registration"))
			{
				if(document.frmCourseBooking.hidPayment.value == "Cheque/DinersCard/Phone")
				{
					document.frmCourseBooking.action ="process_group_purchase_registration.asp";
				}
				else
				{
					document.frmCourseBooking.action ="process_group_credit_registration.asp";	
				}
				return true;	
			}
		else
			{
				return false;
			}
	}
	

	
/* =============================================================================
	Function:	cCurrency(sInput)
	Purpose:	The function formats the input into the currency data type
	Parameters:	Required:sInput
				1)sInput
				Data type:number
				Description:amount to be formatted into the currency datatype
	Returns:	formatted currency 
	Author:		Shefali Adlakha Joshi(17/08/2006)
	============================================================================= */
	function cCurrency(sInput) {
	  var sOutput;
	  sOutput=Math.round(sInput*100)/100;
	  sOutput+="";
	  if(sOutput.indexOf(".")+2==sOutput.length && sOutput.indexOf(".")!=-1 && sOutput.indexOf(".")!="")
		sOutput+="0";
	  if(sOutput.indexOf(".")==-1||sOutput.indexOf(".")=="")
	  	sOutput+=".00";
		
	  return sOutput;
	}

	/* =============================================================================
	Function:	fnEnableTextBox(strFieldname)
	Purpose:	The function is called onclick of the radio button and it enables the field whose name is passed as a parameter.
	Parameters:	Required:strFieldname
				1)strFieldname
				Data type:string
				Description:Field Name of the field to be enabled
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(10/08/2006)
	============================================================================= */
	
	function fnEnableTextBox(strFieldname){
			
			document.getElementById(strFieldname).disabled=false;
			document.getElementById(strFieldname).focus();			
				
		}
	
/* =============================================================================
	Function:	fnDisableTextBox(strFieldname)
	Purpose:	The function is called onclick of the radio button and it disables the field whose name is passed as a parameter.
	Parameters:	Required:strFieldname
				1)strFieldname
				Data type:string
				Description:Field Name of the field to be disabled
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(10/08/2006)
	============================================================================= */
		
	function fnDisableTextBox(strFieldname){
			document.getElementById(strFieldname).value="";
			document.getElementById(strFieldname).disabled=true;
			
		} 
	
	/* =============================================================================
	Function:	fnFocustTextBox(objForm,strWhereHear)
	Purpose:	The function is called onchange of the where did your hear about chifley drop down and it focuses on the text box if the value corresponding the selected value needs to be specified.
	Parameters:	Required:objForm,strWhereHear
				1)objForm
				Data type:form object
				Description:The form object
				2)strWhereHear
				Data type:string
				Description:Value chosen from the drop down
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(28/08/2006)
	============================================================================= */
		
	function fnFocustTextBox(objForm,strWhereHear){
			
		if (strWhereHear=="Magazine" || strWhereHear=="Newspaper" || 
			strWhereHear=="Internet Search Engine" || strWhereHear== "Website Referral" ||
			strWhereHear=="Hobsons Guide" ||
			strWhereHear=="Exhibitions / Conferences"){			
			
				alert("Please specify the " + strWhereHear);
				if(document.getElementById("wherehear").style.display != '')
				{
					document.getElementById("wherehear").style.display='';
				}
				objForm.txtWhereHear.select();
				objForm.txtWhereHear.focus();
		}
		else if (strWhereHear=="Other"){			
				alert("Please specify " + strWhereHear);
				if(document.getElementById("wherehear").style.display != '')
				{
					document.getElementById("wherehear").style.display='';
				}
				objForm.txtWhereHear.select();
				objForm.txtWhereHear.focus();
		}
		else
		{
			objForm.txtWhereHear.value="";
			document.getElementById("wherehear").style.display='none';
		}
		
		
		
	} 


	/* =============================================================================
	Function:	openAssessmentInfo(strFileName)
	Purpose:	The function opens the assessment_info.htm page in a seperate window
	Parameters: none
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(10/08/2006)
	============================================================================= */
	function openAssessmentInfo(strFileName) {
			popupWin = window.open(strFileName, 'popup','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,width=300,height=260,top=150,left=150');			
	}	

/* =============================================================================
	Function:	validateEnrol(form)
	Purpose:	Validates the form fields of the enrol.asp page
	Parameters:	Required:form
				Data type:form object
				Description:Form object of the validating form
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(16/08/2006)
	============================================================================= */
function validateEnrol(form)
{


	var blnCheckRadio = checkRadio(form.rdPayment, "a payment option.");
	if (!blnCheckRadio) {
				    return false;
				  }
				  
	var isSelected = checkDropList(form.selCity, "your city.");
	if (!isSelected) {
				    return false;
				  }
	
	var blnCheckBooking = checkRadio(form.rdBooking, "your booking option.");
	if (!blnCheckBooking) {
				    return false;
				  }
	else{
		if(form.rdBooking[0].checked)
			form.action="individual_booking.asp";
		else
			form.action="group_booking.asp";
		return true;
		
	}
				  
	return true;
	
}


/* =============================================================================
	Function:	checkRadio()
	Purpose:	Checks whether a radio button has been selected from a group.
	Parameters:	* form field name [req] - the radio button group you want to test
            	* "error message" [req] (string) - display text must be enclosed in double quotation marks.
	Returns:	Boolean. True if an radio button has been selected, False if no radio button has been selected.	
	Notes:		Limitations - This function is only useful if no radio button has been pre-selected when page is loaded.
	============================================================================= */
	function checkRadio() {
	  var checkedButton = false;
	  var question = arguments[0];
	  var message = arguments[1];

	  for (var b = 0; b < question.length; b++) {
		if (question[b].checked) {			
			checkedButton = true;
		}
	  }
	  if (checkedButton == false) {
		alert("Please select " + message);
		question[0].focus();		
	  }
	  return checkedButton;
	} 
		
/* =============================================================================
	Function:	validateContact(form)
	Purpose:	Validates the form fields of the contact.asp form
	Parameters:	Required:form
				Data type:form object
				Description:Form object of the validating form
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(28/07/2006)
	============================================================================= */
function validateContact(form)
	{
		var isSelected = checkDropList(form.selTitle, "your title.");
	
	  	if (!isSelected) {
	  	 return false;
	  	}
	  
		var isOK = checkBlank(	
							form.txtFirstName, "your first name",
						  	form.txtLastName, "your last name",
							form.txtAddress, "postal address",
							form.txtSuburb, "your suburb",
							form.txtState, "your state",
							form.txtPostcode, "your post code",
							form.txtCountry, "your country",
						  	form.txtPhone, "your phone number",
							form.txtEmail, "your e-mail id"
						  	);
		  if (!isOK) {
			return false;
		  } 
		 else if (emailcheck(form.txtEmail.value)==false){
			form.txtEmail.select();
			form.txtEmail.focus();
			return false;
		}

		if (confirm("Do you wish to submit the form?"))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

/* =============================================================================
	Function:	checkBlank()
	Purpose:	Checks if the textbox fields are blank
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(28/07/2006)
	============================================================================= */

function checkBlank() {
  for (var i = 0; i < arguments.length; i += 2) {
    if (!arguments[i].value) {
      alert("Please enter " + arguments[i+1] + ".");
      arguments[i].focus();
      return false;
    }
  }
  return true;
}

/* =============================================================================
	Function:	checkDropList()
	Purpose:	Checks if the value is selected in the drop down box
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(28/07/2006)
	============================================================================= */
function checkDropList() {
	if (arguments[0].selectedIndex == 0) {
  		alert("Please select " + arguments[1]);
  		arguments[0].focus();
  		return false;
	}
	else return true;
}

/* =============================================================================
	Function:	emailcheck(str)
	Purpose:	checks for valid email address
	Parameters:	Required:str
				Data type:String
				Description:String to be validated
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(28/07/2006)
	============================================================================= */
function emailcheck(str) {
	
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid email address.");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid email address.");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid email address.");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid email address.");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid email address.");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid email address.");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a valid email address.");
		    return false;
		 }

 		 return true;					
	}

	/* =============================================================================
	Function:	fnPoFields(strValue)
	Purpose:	The function clears or focuses on the purchase order fields depending on the option chosen or value passed.
	Parameters:	Required:objForm,strValue
				1)objForm
				Data type:form object
				Description:form object for the contact us form 
				2)strValue
				Data type:String
				Description:option selected
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(25/07/2006)
	============================================================================= */
	
	function fnPoFields(objForm,strValue)
	{
		switch(strValue){
		
			case 'Cheque':
				objForm.txtOrderNo.value="";
				objForm.txtContactName.value="";
				objForm.txtPoPhone.value="";
				break;
			
			case 'Purchase Order':
				objForm.txtOrderNo.focus();				
				break;
			
			case 'Phone':
				objForm.txtOrderNo.value="";
				objForm.txtContactName.value="";
				objForm.txtPoPhone.value="";
				break;
			
			default:
				break;				
		}
	}
		

/*==================================================================================================
	Javascript functions for expanding and collapsing the left navigation menu begins here
	code source:http://inspire.server101.com/js/xc/
==================================================================================================*/


var xcNode = []; 

/* =============================================================================
	Name:function xcSet(m, c [, arguments])
	Purpose:Transforms <ul> elements into an expand/collapse list. Creates +/- controls with event 		triggers and adjusts classes to allow the menu style to be altered upon success. 
	Argument Name		Data Type			Description
	m 					String				Id of the menu items’ parent in the HTML source. 
	c 					String				Class name applied to menu items. 
	[arguments] 		Optional strings 	Ids of menu items that remain expanded.
============================================================================= */
function xcSet(m, c) { 
	if (document.getElementById && document.createElement) { 
			
			m = document.getElementById(m).getElementsByTagName('ul'); 		
			var d, p, x, h, i, j; 
			for (i = 0; i < m.length; i++) { 
				if (d = m[i].getAttribute('id')) { 
					xcCtrl(d, c, 'x', '[+]', 'Show', m[i].getAttribute('title')+' (expand menu)'); 
					x = xcCtrl(d, c, 'c', '[-]', 'Hide', m[i].getAttribute('title')+' (collapse menu)'); 
					p = m[i].parentNode; 
					if (h = !p.className) { 
						j = 2; 
						while ((h = !(d == arguments[j])) && (j++ < arguments.length)); 
							if (h) { 
							m[i].style.display = 'none'; 
							x = xcNode[d+'x']; 
							} 
					} 

					p.className = c; 
					p.insertBefore(x, p.firstChild); 
				} 
			} 
		}
	} 



/* =============================================================================
	Name:function xcShow(m)
	Purpose:Expands a menu that is collapsed. Causes an error if the supplied id is not an collapsed menu. 
	Argument Name		Data Type			Description
	m 				String				id of menu item to show (expand)
============================================================================= */
function xcShow(m) { 
	xcXC(m, 'block', m+'c', m+'x'); 
} 

/* =============================================================================
	Name:function xcHide(m)
	Purpose:Collapses a menu that is expanded. Causes an error if the supplied id is not an expanded menu. 
	Argument Name		Data Type			Description
	m 				String				id of menu item to hide (collapse)
============================================================================= */
function xcHide(m) { 
	xcXC(m, 'none', m+'x', m+'c'); 
} 

/* =============================================================================
	Name:function xcXC(e, d, s, h)
	Purpose:Internal function used by xcShow and xcHide to manage menu expand/collapse behaviour. Toggles the menu and related +/- node. 
	Argument Name		Data Type			Description
	e 					Object				element to expand/collapse.
	d 					String				style.display value: 'block' or 'none'
	s					String				id of +/- node to display.
	h					String				id of +/- node to hide
============================================================================= */
function xcXC(e, d, s, h) { 
	e = document.getElementById(e); 
	e.style.display = d; 
	e.parentNode.replaceChild(xcNode[s], xcNode[h]); 
	xcNode[s].firstChild.focus(); 
} 

/* =============================================================================
	Name:function xcCtrl(m, c, s, v, f, t)
	Purpose:Internal function used by xcSet to create the +/- controls.
	Argument Name		Data Type			Description
	m 					String				id of menu item. 
	c					String				class name for custom styles.
	s 					String				'x' or 'c' suffix for node id and class name c. 
	v 					String				control text value: '[+]' or '[-]'. 
	f 					String				function name 'Show' or 'Hide' event trigger (xcShow or xcHide). 
	t 					String				node’s title attribute
============================================================================= */
function xcCtrl(m, c, s, v, f, t) { 
	var a = document.createElement('a'); 
	a.setAttribute('href', 'javascript:xc'+f+'(\''+m+'\');'); 
	a.setAttribute('title', t); 
	a.appendChild(document.createTextNode(v)); 
	
	var d = document.createElement('div'); 
	d.className = c+s; 
	d.appendChild(a); 
	
	return xcNode[m+s] = d; 
} 

/*==================================================================================================
	Javascript functions for expanding and collapsing the left navigation menu end here
==================================================================================================*/

/*==================================================================================================
	Javascript functions related to PIA enrolment system begin here
==================================================================================================*/

/* =============================================================================
	Function:	validatePIAEnrol(form)
	Purpose:	Validates the form fields of the pia_enrol.asp page
	Parameters:	Required:form
				Data type:form object
				Description:Form object of the validating form
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(10/01/2007)
	============================================================================= */
function validatePIAEnrol(form)
{

	var blnCheckRadio = checkRadio(form.rdPayment, "a payment option.");
	if (!blnCheckRadio) {
				    return false;
	}
				  
	var blnCheckBooking = checkRadio(form.rdBooking, "your booking option.");
	if (!blnCheckBooking) {
				    return false;
	}
	if (form.rdBooking[0].checked) {
			var isSelected = checkDropList(form.selCity, "your location.");
			if (!isSelected) {
				    return false;
			}
			form.action="pia_individual_booking.asp";
	}
	else {
			form.selCity.value="";
			form.action="pia_online_individual_booking.asp";
			return true;
	}
				  
	return true;
	
}


/* =============================================================================
	Function:	validatePIAIndividualBooking()
	Purpose:	The function validates the individual booking form	
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(11/01/2007)
	============================================================================= */
	function validatePIAIndividualBooking() {

		var i,j;		
		var strCourse,strDates,rdCredit,rdCredit0,rdCredit1;		
		var intParticipants,intParticipantQty; 
		
		intParticipants=1;

		if (document.frmCourseBooking.p1_apesmaMember[0].checked)
		{
			if(document.frmCourseBooking.p1_mshipNo.value == "")
				{
					alert("Please enter the membership number for the participant.");
					document.frmCourseBooking.p1_mshipNo.focus();						
					return false;
					
				}				
		}
		else if (document.frmCourseBooking.p1_apesmaMember[1].checked)
		{
				//do nothing
		}
		else
		{
			alert("Please select if the participant is a PIA member.");
			document.frmCourseBooking.p1_apesmaMember[0].focus();
			return false;				
		}
		
		if(document.frmCourseBooking.p1_title.selectedIndex == 0)
		{
			alert("Please select the Title for the participant.");
			document.frmCourseBooking.p1_title.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_name.value == "")
		{
			alert("Please enter the first name for the participant.");
			document.frmCourseBooking.p1_name.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_surname.value == "")
		{
			alert("Please enter the last name for the participant.");
			document.frmCourseBooking.p1_surname.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_email.value == "")
		{
			alert("Please enter the Email for the participant.");
			document.frmCourseBooking.p1_email.focus();
			return false;
		}
		else if (emailcheck(document.frmCourseBooking.p1_email.value)==false){
			document.frmCourseBooking.p1_email.select();
			document.frmCourseBooking.p1_email.focus();
			return false;
		}  		
		if(document.frmCourseBooking.p1_phone.value == "")
		{
			alert("Please enter the phone number for the participant.");
			document.frmCourseBooking.p1_phone.focus();
			return false;
		}
		
		if ((!(document.frmCourseBooking.rdBooker[0].checked)) && (!(document.frmCourseBooking.rdBooker[1].checked)))
		{
			alert("Please select if the participant is also the booker of the short course.");
			document.frmCourseBooking.rdBooker[0].focus();
			return false;	
		}
	
		intParticipantQty=document.frmCourseBooking.participantQty.value;
		
		if (intParticipantQty == "")
		{
			intParticipantQty=0;
		}
		else if(isNaN(intParticipantQty))
		{
			intParticipantQty=0;
			alert("Please enter a valid number of courses.");
			document.frmCourseBooking.participantQty.select();						
			document.frmCourseBooking.participantQty.focus();
			return false;
		}
		else
		{
			intParticipantQty=parseInt(intParticipantQty);		
		}
		
		intParticipants=intParticipants+intParticipantQty;
		
		//validation for the course tables added
		for(i=1; i < parseInt(intParticipants)+1; i++)
			{
				
				strCourse="selCourse"+i;
				strDates="selDates"+i;							
				rdCredit="p"+i+"_assessment";
				rdCredit0="p"+i+"_assessment[0]";
				rdCredit1="p"+i+"_assessment[1]";
				
				if(document.getElementById(strCourse).selectedIndex == 0)
				{
					alert("Please select Unit "+ i + ".");
					document.getElementById(strCourse).focus();
					return false;
				}
				if(document.getElementById(strDates).selectedIndex == 0)
				{
					alert("Please select dates for unit "+ i + ".");
					document.getElementById(strDates).focus();
					return false;
				}
				if ((!eval("document.frmCourseBooking."+rdCredit0+".checked")) && (!eval("document.frmCourseBooking."+rdCredit1+".checked")))
				{
					alert("Please select if you wish to gain credit towards Chifley Postgraduate Programs for unit " + i +".");
					document.getElementById(rdCredit).focus();
					return false;	
				}			
		
			}		
			if(confirm("Proceed to unit registration"))
			{
				if(document.frmCourseBooking.hidPayment.value == "Cheque/DinersCard/Phone")
				{
				document.frmCourseBooking.action ="pia_process_individual_purchase_registration.asp";
				}
				else
				{
				document.frmCourseBooking.action ="pia_process_individual_credit_registration.asp";	
				}
				return true;	
			}
			else
			{
				return false;
			}
	}
	

/* =============================================================================
	Function:	fnEnablePIAFeeIndividual(strVal)
	Purpose:	The function resets the value of course fee depending on if the member is an APESMA member or not
	Parameters:	Required:strVal
				1)strVal
				Data type:string
				Description:It's value can be 'Member' or 'NonMember' or 'MembershipNumber' 
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(11/10/2006)
	============================================================================= */
	
	function fnEnablePIAFeeIndividual(strVal){			
			
			var strFee;			
			var strCourseFee;						
			var strHidMemFee,strHidNonMemFee;
			var intCourses,intTotalCourses;
			var i;
			
			intTotalCourses=1;
					
			intCourses=document.frmCourseBooking.participantQty.value;			
	
			if (intCourses == "")
			{
				intCourses=0;
			}
			else if(isNaN(intCourses))
			{
				intCourses=0;
				
			}
			else
			{
				intCourses=parseInt(intCourses);		
			}
			intTotalCourses=intTotalCourses+intCourses;			
			
				
			switch(strVal)
			{
				case 'Member':
				{			
					document.frmCourseBooking.p1_mshipNo.disabled=false;		
					
					if(document.frmCourseBooking.p1_mshipNo.value == "")
					{
						document.frmCourseBooking.p1_mshipNo.focus();
					}
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";
						strHidMemFee="hid"+i+"_curMemFee";						
						
						strFee="";
						strFee=document.getElementById(strHidMemFee).value;
						
						if(strFee != "")
						{
							if((!isNaN(strFee)))
							{
								document.getElementById(strCourseFee).value=strFee;							
							}
						}	
					}							
					break;
				}
				
				case 'NonMember':
				{					
					document.frmCourseBooking.p1_mshipNo.value="";
					document.frmCourseBooking.p1_mshipNo.disabled=true;
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";						
						strHidNonMemFee="hid"+i+"_curNonMemFee";						
						strFee="";
						strFee=document.getElementById(strHidNonMemFee).value;							
						if(strFee != "")
						{
							if((!isNaN(strFee)))
							{
								document.getElementById(strCourseFee).value=strFee;							
							}
						}	
					}				
					break;
				}
				
				default:
				{
					
					for(i=1; i<=intTotalCourses; i++)
					{
						strCourseFee="p"+i+"_CourseFee";						
						strHidNonMemFee="hid"+i+"_curNonMemFee";						
						strFee="";
						strFee=document.getElementById(strHidNonMemFee).value;
						if(strFee != "")
						{
							if((!isNaN(strFee)))
							{
								document.getElementById(strCourseFee).value=strFee;
							}
						}
					}
				}
			}
				
			
		}

	/* =============================================================================
	Function:	fnSetPIAFeeIndividual(strValue,x)
	Purpose:	The function is called when the user selects the dates from the drop down and it assigns the fee to the fee textbox
	Parameters:	Required:strValue,x
				1)strValue
				Data type:string
				Description:it is the value selected from the date drop down.
				2)x				
				Data type:number
				Description:it denotes the product for which the date is chosen.
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(11/01/2006)
	============================================================================= */	
	
	function fnSetPIAFeeIndividual(strValue,x)
	{
		var arrValue;		
		var strCourseFee;
		var strHidMemFee,strHidNonMemFee;
			
		strHidMemFee="hid"+x+"_curMemFee";
		strHidNonMemFee="hid"+x+"_curNonMemFee";		
		strCourseFee="p"+x+"_CourseFee";
		
		if(strValue != "")
		{			
			arrValue=strValue.split("||");								
				
			if((document.frmCourseBooking.p1_apesmaMember[0].checked))
			{ 					
				document.getElementById(strCourseFee).value=arrValue[1];
			}
			else if(document.frmCourseBooking.p1_apesmaMember[1].checked) 
			{
				document.getElementById(strCourseFee).value=arrValue[2];					
			}						
			else
			{
				document.getElementById(strCourseFee).value=arrValue[2];		
			}
			
			document.getElementById(strHidMemFee).value=arrValue[1];	
			document.getElementById(strHidNonMemFee).value=arrValue[2];			
		}
	
	
	}
	
	/* =============================================================================
	Function:	cOrder()
	Purpose:	Calculates and assigns the value of the total order and the individual products
	Parameters:	Required:	none
	Returns:	nothing
	Author:		Shefali Adlakha Joshi(12/01/2007)
	============================================================================= */
	function cOrder() {
		
			var  orderTotal = 0;
			var intTotalProducts =7;
			var productprice= new Array(7);
			var i,j;
			j=0;
			productprice[0]=0;
			productprice[1]=0;
			productprice[2]=0;
			productprice[3]=0;
			productprice[4]=0;
			productprice[5]=0;
			productprice[6]=0;
		  //evaluate if we use the member fee or not
		  	if (document.frmCourseBooking.p1_apesmaMember[0].checked)
			{
				blnMember = true;
				if(document.frmCourseBooking.p1_mshipNo.value == "")
					{
						document.frmCourseBooking.p1_mshipNo.disabled = false;										
					}				
			}
			else
			{			
				document.frmCourseBooking.p1_mshipNo.value="";
				document.frmCourseBooking.p1_mshipNo.disabled = true;
				blnMember = false;
			}
			//below variables are corresponding to the hidden product fields in the booking form				
				var strProductQty="";
				var strProductPrice="";	
				var strProductSubTotal="";
				var strProductName="";
				var strCredit="";
				
				//below variables are corresponding to the text product fields in the booking form
				var strProductFormPrice="";
				var strCourseName=""
				var strDates="";								
				
			for (i = 1; i <= intTotalProducts; i++)
			{	
				strCourseName="Course"+i;
				strProductFormPrice="product"+i+"price";
				strDates="selDates"+i;				
				
				if (eval("document.frmCourseBooking.Course"+i+".checked"))
				{					
					
					if (!(document.getElementById(strDates).selectedIndex == 0))
						{
							j=j+1;
							strProductPrice="productPrice"+j;
							strProductQty="product"+j+"Qty";
							strProductSubTotal="product"+j+"subTotal";
							strProductName="productName"+j;
							strCredit="product"+j+"credit";
							
							if(blnMember)
								productprice[i-1]= 650;
							else
								productprice[i-1]= 749;	
							
							//assign values to the hidden fields
							
							document.getElementById(strProductName).value="" + document.getElementById(strCourseName).value + ", " + document.getElementById(strDates).value + "";
							document.getElementById(strProductQty).value=1;	
							document.getElementById(strProductPrice).value = cCurrency(productprice[i-1]);
							document.getElementById(strProductSubTotal).value = cCurrency(productprice[i-1]);
							if(eval("document.frmCourseBooking.p"+i+"_credit[0].checked"))
							{
								document.getElementById(strCredit).value='Yes';
							}
							else if(eval("document.frmCourseBooking.p"+i+"_credit[1].checked"))
							{
								document.getElementById(strCredit).value='No';
							}
							else
							{
								document.getElementById(strCredit).value='';
							}							
							
						}					
					
				}
				else
				{
						productprice[i-1] = 0;						
				}
				
				orderTotal = orderTotal + Number(productprice[i-1]);
				//update product sub total variables
				 document.getElementById(strProductFormPrice).value = cCurrency(productprice[i-1]);
			}

			//convert order total to currency format
			document.frmCourseBooking.noProducts.value = j;
			document.frmCourseBooking.orderTotal.value = cCurrency(orderTotal);
		}

	
	/* =============================================================================
	Function:	validatePIAOnlineBooking()
	Purpose:	The function validates the individual booking form	
	Returns:	boolean
	Author:		Shefali Adlakha Joshi(11/01/2007)
	============================================================================= */
	function validatePIAOnlineBooking() {

		var i,j;		
		var strCourse,strDates;
		var intParticipants,intParticipantQty; 
		
		intParticipants=1;

		if (document.frmCourseBooking.p1_apesmaMember[0].checked)
		{
			if(document.frmCourseBooking.p1_mshipNo.value == "")
				{
					alert("Please enter the membership number for the participant.");
					document.frmCourseBooking.p1_mshipNo.focus();						
					return false;
					
				}				
		}
		else if (document.frmCourseBooking.p1_apesmaMember[1].checked)
		{
				//do nothing
		}
		else
		{
			alert("Please select if the participant is a PIA member.");
			document.frmCourseBooking.p1_apesmaMember[0].focus();
			return false;				
		}
		
		if(document.frmCourseBooking.p1_title.selectedIndex == 0)
		{
			alert("Please select the Title for the participant.");
			document.frmCourseBooking.p1_title.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_name.value == "")
		{
			alert("Please enter the first name for the participant.");
			document.frmCourseBooking.p1_name.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_surname.value == "")
		{
			alert("Please enter the last name for the participant.");
			document.frmCourseBooking.p1_surname.focus();
			return false;
		}
		if(document.frmCourseBooking.p1_email.value == "")
		{
			alert("Please enter the Email for the participant.");
			document.frmCourseBooking.p1_email.focus();
			return false;
		}
		else if (emailcheck(document.frmCourseBooking.p1_email.value)==false){
			document.frmCourseBooking.p1_email.select();
			document.frmCourseBooking.p1_email.focus();
			return false;
		}  		
		if(document.frmCourseBooking.p1_phone.value == "")
		{
			alert("Please enter the phone number for the participant.");
			document.frmCourseBooking.p1_phone.focus();
			return false;
		}
		
		if ((!(document.frmCourseBooking.rdBooker[0].checked)) && (!(document.frmCourseBooking.rdBooker[1].checked)))
		{
			alert("Please select if the participant is also the booker of the short course.");
			document.frmCourseBooking.rdBooker[0].focus();
			return false;	
		}
	
		if((document.frmCourseBooking.Course1.checked == false) && (document.frmCourseBooking.Course2.checked == false) && (document.frmCourseBooking.Course3.checked == false) && (document.frmCourseBooking.Course4.checked == false) && (document.frmCourseBooking.Course5.checked == false) && (document.frmCourseBooking.Course6.checked == false) && (document.frmCourseBooking.Course7.checked == false))
		{
			alert('You must choose at least one unit.');
			document.frmCourseBooking.Course1.focus();
			return false;	
		}
		for (i=1; i<=7 ; i++)
		{
			if (eval("document.frmCourseBooking.Course"+i+".checked"))
			{
				strDates="selDates"+i;		
				if(document.getElementById(strDates).selectedIndex == 0)
					{
						alert("Please select dates for unit "+ i + ".");
						document.getElementById(strDates).focus();
						return false;
					}
				var rdCredit="p"+i+"_credit";
				var rdCredit0="p"+i+"_credit[0]";
				var rdCredit1="p"+i+"_credit[1]";
				if ((!eval("document.frmCourseBooking."+rdCredit0+".checked")) && (!eval("document.frmCourseBooking."+rdCredit1+".checked")))
				{
					alert("Please select if you wish to gain credit towards Chifley Postgraduate Programs for unit " + i +".");
					document.getElementById(rdCredit).focus();
					return false;	
				}	
				
			}
			
		}
		
		if(confirm("Proceed to unit registration"))
			{
				if(document.frmCourseBooking.hidPayment.value == "Cheque/DinersCard/Phone")
				{
				document.frmCourseBooking.action ="pia_process_online_purchase_registration.asp";
				}
				else
				{
					document.frmCourseBooking.action ="pia_process_online_credit_registration.asp";	
				}
				cOrder();
				return true;	
			}
			else
			{
				return false;
			}
	}
		
	
	
//-->