var intTrainSectionCount=1;
			var intEmploySectionCount=1;
			
			//Function to add a training section to the website
			function addTrainingElement()
			{
				intTrainSectionCount = intTrainSectionCount + 1;
				
				var contentTrainID = document.getElementById('contentTrain');
				
				var newTrainingDiv = document.createElement('div');
				newTrainingDiv.setAttribute('id','trainingDiv'+intTrainSectionCount);
				
				newTrainingDiv.innerHTML = "<table><tr><td><br /><br /><span style='text-decoration:underline;font-weight:600;'>Training Section " + intTrainSectionCount + "</span><input type='hidden' name='int_Num_Ed_History" + intTrainSectionCount + "' value='" + intTrainSectionCount + "' /><br /></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td width='218' colspan='2'></td><td width='152'></td><td width='147'></td></tr><tr><td colspan='2' >Grade/Course/Program:</td><td colspan='2' ><input type='text' name='txt_GradeCourseProgram_" + intTrainSectionCount + "' maxlength='100' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2' >School or Institution:</td><td colspan='2' ><input type='text' name='txt_TrainInstitution_" + intTrainSectionCount + "' maxlength='100' size='20' /></td><td width='2'>&nbsp;</td></tr><tr><td colspan='2' >Location:</td><td colspan='2' ><input type='text' name='txt_TrainLocation_" + intTrainSectionCount + "' maxlength='100' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2' >Start Date (m/d/y):</td><td colspan='2' ><input type='text' name='txt_TrainStartDate_" + intTrainSectionCount + "' maxlength='10' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2' >End Date (m/d/y):</td><td colspan='2' ><input type='text' name='txt_TrainEndDate_" + intTrainSectionCount + "' maxlength='10' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2' >Outcome/Highest<br />Level Completed:</td><td colspan='2' ><input type='text' name='txt_TrainOutcome_" + intTrainSectionCount + "' maxlength='100' size='20' /></td><td>&nbsp;</td></tr></table>" ;	
				
		
				contentTrainID.appendChild(newTrainingDiv);
			}
			
			//Function to remove a training section from the website
			function removeTrainingElement()
			{
				if(intTrainSectionCount > 1)
				{
					var contentTrainID = document.getElementById('contentTrain');
					contentTrainID.removeChild(document.getElementById('trainingDiv'+intTrainSectionCount));
					intTrainSectionCount = intTrainSectionCount-1;
				}
			}
			
			//Function to add an employment section to the website
			function addEmploymentElement()
			{
				intEmploySectionCount = intEmploySectionCount + 1;
				
				var contentEmployID = document.getElementById('contentEmploy');
				
				var newEmploymentDiv = document.createElement('div');
				newEmploymentDiv.setAttribute('id','employmentDiv'+intEmploySectionCount);
				
			
newEmploymentDiv.innerHTML = "<table cellspacing='5'><tr><td  colspan='3'><br /><span style='text-decoration:underline;font-weight:600;'>Employment Section " + intEmploySectionCount + "</span><input type='hidden' name='int_Num_Emp_History" + intEmploySectionCount + "' value='" + intEmploySectionCount + "' /><br /></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td width='218' colspan='2'></td><td width='152'></td><td width='147'></td></tr><tr><td colspan='2' >Employer:</td><td colspan='2' ><input type='text' name='txt_Employer_" + intEmploySectionCount + "' maxlength='100' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2' >Job Title:</td><td colspan='2' ><input type='text' name='txt_JobTitle_" + intEmploySectionCount + "' maxlength='100' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan=v2'>Part or Full Time, Seasonal, Casual or Self-Employed:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan='2' ><input type='text' name='txt_PartFullTime_" + intEmploySectionCount + "' maxlength='20' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2'>Start Date (m/d/y):</td><td colspan='2'><input type='text' name='txt_EmployStartDate_" + intEmploySectionCount + "' maxlength='10' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2'>End Date (m/d/y):</td><td colspan='2'><input type='text' name='txt_EmployEndDate_" + intEmploySectionCount + "' maxlength='10' size='20' /></td><td>&nbsp;</td></tr><tr><td colspan='2'>Reason for Leaving:</td><td colspan='2' ><input type='text' name='txt_EmployOutcome_" + intEmploySectionCount + "' maxlength='100' size='20' /></td><td>&nbsp;</td></tr></table>";				
				
				
				
				
				
				
				
				
				
				
				
				
				contentEmployID.appendChild(newEmploymentDiv);
			}
			
			//Function to remove an employment section from the website
			function removeEmploymentElement()
			{
				if(intEmploySectionCount > 1)
				{
					var contentEmployID = document.getElementById('contentEmploy');
					contentEmployID.removeChild(document.getElementById('employmentDiv'+intEmploySectionCount));
					intEmploySectionCount = intEmploySectionCount-1;
				}
			}
			
			function trim(str, chars) {
				return ltrim(rtrim(str, chars), chars);
			}
			
			function ltrim(str, chars) {
				chars = chars || "\\s";
				return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
			}
			
			function rtrim(str, chars) {
				chars = chars || "\\s";
				return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
			}
			
			function validate_required(field,alerttxt)
			{
				with (field)
				{
					if (trim(value)==null||trim(value)==""||trim(value)=="Empty")
					{alert(alerttxt);return false;}
					else {return true}
				}
			}
			
			function validate_email(field,alerttxt)
			{
				with (field)
				{
					apos=value.indexOf("@");
					dotpos=value.lastIndexOf(".");
					if (apos<1||dotpos-apos<2) 
					{alert(alerttxt);return false;}
					else {return true;}
				}
			}
			
			function validate_numeric(field,alerttxt)
			{
				with (field)
				{
					if (value != parseInt(value))
					{alert(alerttxt);return false;}
					else {return true}
				}
			}
						
			function validate_form(thisform)
			{
				with (thisform)
				{
					if (validate_required(txt_FName,"Your First Name must be filled in!")==false)
					{txt_FName.focus();return false;}
					if (validate_required(txt_LName,"Your Last Name must be filled in!")==false)
					{txt_LName.focus();return false;}
					if (validate_required(txt_Email,"Your Email address must be filled in!")==false)
					{txt_Email.focus();return false;}
					if (validate_email(txt_Email,"A valid Email address must be filled in!")==false)
					{txt_Email.focus();return false;}
					if (validate_numeric(txt_Age,"A valid Age must be filled in!")==false)
					{txt_Age.focus();return false;}
					if (validate_required(cbo_Primary_Course,"You must select a Preferred Training Course!")==false)
					{cbo_Primary_Course.focus();return false;}
				}
			}
						
			function MM_findObj(n, d) { //v4.01
			var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
				d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			if(!x && d.getElementById) x=d.getElementById(n); return x;
			}
			function MM_swapImage() { //v3.0
			var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
			if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
			}
			function MM_swapImgRestore() { //v3.0
			var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
			}

			function MM_preloadImages() { //v3.0
			var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
				var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
				if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
			}
