	function check_empty()
	{
		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("September 20th 2010", "January 17 2011", "May 2nd 2011");
			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("July 19th 2010","September 25th 2010");
			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" style="width:auto;" name="chk61"> Free Taster Session: Sub-editing workshop - Date TBA <br>';
			
//			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" style="width:auto;" name="chk62"> Free Taster Session: Journalism workshops - Friday March 12th 2010 at 10am<br>';
//			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" style="width:auto;" name="chk64"> Free Taster Session: Journalism workshops - Saturday June 19th 2010 at 2pm<br>';
//			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" style="width:auto;" name="chk65"> Free Taster Session: Journalism workshops - Monday July 5th 2010 at 2pm<br>';
			document.getElementById('tddet').innerHTML+='&nbsp;&nbsp;<input type="checkbox" style="width:auto;" name="chk66"> Free Taster Session: Journalism workshops - Friday September 3rd 2010 at 2pm<br>';

		}

}

	
