	function check_empty()
	{

	if(document.frm.course.value == "Course3") {
		if ( (document.getElementById("chk66").checked == false) && (document.getElementById("chk67").checked == false) && (document.getElementById("chk65").checked == false) ) {
			alert("please select a course date");
			return false;
		}
	}
	
		var str_email = document.frm.email.value;
	
		var check_email = str_email.indexOf("@");
	
		if(document.frm.course.value=='')
		{
			alert('Please enter a course name');
			document.frm.course.focus();
			return false
		}
		else if(document.frm.name.value=='')
		{
			alert('Please enter your name');
			document.frm.name.focus();
			return false
		}
		else if(document.frm.add1.value=='')
		{
			alert('Please enter your address line 1');
			document.frm.add1.focus();
			return false
		}
		else if(document.frm.postcode.value=='')
		{
			alert('Please enter a postcode');
			document.frm.postcode.focus();
			return false
		}
		else if(document.frm.telephone.value=='')
		{
			alert('Please enter a telephone number');
			document.frm.telephone.focus();
			return false
		}
		else if(document.frm.email.value=='')
		{
			alert('Please Enter your email address.');
			document.frm.email.focus();
			return false
		}
		else if(check_email == -1)
		{
			alert( "Your email appears to be invalid" );
			document.frm.email.focus();
			return false ;
		}
		else if(document.frm.howhear.value == "")
		{
			alert( "Please select how you heard about Journalist Works" );
			document.frm.howhear.focus();
			return false ;
		}
		else if(document.frm.other.value != "")
		{
			if(document.frm.howhear.value != "Other") {
			alert( "You have completed the 'Other' box. Please confirm how you heard about Journalist Works" );
			document.frm.howhear.focus();
			return false ;
			}
		}
		
		
			return true
	}
	
	
	function clear(objSelect){

     for (var i = (objSelect.options.length-1); i >= 0; i--){
         objSelect.options[i]=null;
     }
     //objSelect.options[0]=new Option('Please select', '');
	}
	function addOption(selectbox,text,value )
	{
		var optn = document.createElement("OPTION");
		optn.text = text;
		optn.value = value;
		selectbox.options.add(optn);
	}
	
	
	function addOption_list(aaa){
		
		if(aaa=="Course1" || aaa=="Course2")
		{
			document.getElementById('tddet').innerHTML='<select name="coursedate" style="width:280px;"></select>';
			clear(document.frm.coursedate);
			
			if(aaa=="Course1")
			{
			//disability
			document.getElementById('additionalfield1').style.display='inline';
			document.getElementById('additionalfield1title').innerHTML='Please indicate if you have any disability/additional learning needs:';
			//education
			document.getElementById('additionalfield2').style.display='inline';
			document.getElementById('additionalfield2title').innerHTML='Please use the box below to give details of your education to date including details<br>of exams you may be about to take:';
			//experience
			document.getElementById('additionalfield3').style.display='inline';
			document.getElementById('additionalfield3title').innerHTML='Please use the box below to give details of any practical experience<br>you may have had in Journalism, copywriting, photography etc: ';
			//getoutofday
			document.getElementById('additionalfield4').style.display='none';
			document.getElementById('additionalfield4title').innerHTML='';
			//employment
			document.getElementById('additionalfield5').style.display='inline';
			document.getElementById('additionalfield5title').innerHTML='Please use the box below to give brief details of your employment history:';
			//whybejournalist
			document.getElementById('additionalfield6').style.display='inline';
			document.getElementById('additionalfield6title').innerHTML='Tell us why you want to be a journalist, and why you think the profession suits you<br>(200 words)';
			
				var month = new Array("January 2012", "April 2012", "September 2012");
			document.getElementById('tddet').innerHTML='Please select the prefered Course date:<br><select name="coursedate" style="width:280px;"></select>';
				//document.getElementById('tdtitle').innerHTML='Please select the prefered Course date:';
			}
			else if(aaa=="Course2")
			{	
			//disability
			document.getElementById('additionalfield1').style.display='inline';
			document.getElementById('additionalfield1title').innerHTML='Please indicate if you have any disability/additional learning needs:';
			//education
			document.getElementById('additionalfield2').style.display='inline';
			document.getElementById('additionalfield2title').innerHTML='Please use the box below to give details of your education to date including details<br>of exams you may be about to take:';
			//experience
			document.getElementById('additionalfield3').style.display='inline';
			document.getElementById('additionalfield3title').innerHTML='Please use the box below to give details of any practical experience<br>you may have had in Journalism, copywriting, photography etc: ';
			//getoutofday
			document.getElementById('additionalfield4').style.display='none';
			document.getElementById('additionalfield4title').innerHTML='';
			//employment
			document.getElementById('additionalfield5').style.display='none';
			document.getElementById('additionalfield5title').innerHTML='';
			//whybejournalist
			document.getElementById('additionalfield6').style.display='none';
			document.getElementById('additionalfield6title').innerHTML='';

			var month = new Array("4th February 2012","11th June 2012");
			document.getElementById('tddet').innerHTML='Please select the prefered starting month:<br><select name="coursedate" style="width:280px;"></select>';
				//document.getElementById('tdtitle').innerHTML='Please select the prefered starting month:';
			}
			else
				var month = new Array("");
	
			for (var i=0; i < month.length;++i)
			{
				addOption(document.frm.coursedate, month[i], month[i]);
			}
		}
		else if(aaa=="Course3")
		{
			//disability
			document.getElementById('additionalfield1').style.display='inline';
			document.getElementById('additionalfield1title').innerHTML='Please indicate if you have any disability/additional learning needs:';
			//education
			document.getElementById('additionalfield2').style.display='inline';
			document.getElementById('additionalfield2title').innerHTML='Please use the box below to give details of your education to date including details<br>of exams you may be about to take:';
			//experience
			document.getElementById('additionalfield3').style.display='inline';
			document.getElementById('additionalfield3title').innerHTML='Please use the box below to give details of any practical experience<br>you may have had in Journalism, copywriting, photography etc:';
			//getoutofday
			document.getElementById('additionalfield4').style.display='inline';
			document.getElementById('additionalfield4title').innerHTML='Tell us what you hope to get out of the course/taster day: ';
			//employment
			document.getElementById('additionalfield5').style.display='none';
			document.getElementById('additionalfield5title').innerHTML='';
			//whybejournalist
			document.getElementById('additionalfield6').style.display='none';
			document.getElementById('additionalfield6title').innerHTML='';
			
			document.getElementById('tddet').innerHTML='Please select the Course(s) you\'d like to apply for :<br>';
			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" id="chk67" style="width:auto;" name="chk67" value="Free Taster Session: Journalism workshops - Monday April 2nd  2012 10.30 - 1.30pm">Free Taster Session: Journalism workshops - Monday April 2nd  2012 10.30 - 1.30pm<br>';
			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" id="chk66" style="width:auto;" name="chk66" value="Free Taster Session: Journalism workshops - Friday March 9th 10.30am - 1.30pm">Free Taster Session: Journalism workshops - Friday March 9th 10.30am - 1.30pm<br>';

			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" id="chk65" style="width:auto;" name="chk65" value="Free Taster Session: Journalism workshops - Friday 10th February 2012 2.00pm to 5.00pm">Free Taster Session: Journalism workshops - Friday 10th February 2012 2.00pm to 5.00pm<br>';
		}

}

	

