// JavaScript Document
function func_is_email(param_email)
{
	var str_current_character;
	var b_valid_email,b_period_present; 
	var i_last_position_of_period,b_correct_length_extension;
	var i_num_at_symbol=0;
	var i_pos_at_symbol;
	var i_length_of_server_name=1;
	var i_pos_consecutive_dots;
	var str_email=new String(func_trim(param_email));
	i_length=str_email.length;
	b_period_present=1;
	b_correct_length_extension=1;
	i_last_position_of_period=0;
	
	if(i_length==0)
	{
		return true;
	}
	
	for(i_loop=0; i_loop<i_length; i_loop++)
	{
		if(!((str_email.charCodeAt(i_loop)>=65 && str_email.charCodeAt(i_loop)<=90)
		  || (str_email.charCodeAt(i_loop)>=97 && str_email.charCodeAt(i_loop)<=122)
		  || (str_email.charCodeAt(i_loop)>=48 && str_email.charCodeAt(i_loop)<=57)
		  || (str_email.charAt(i_loop)=="@")
		  || (str_email.charAt(i_loop)=="_")
		  || (str_email.charAt(i_loop)=="-")
		  || (str_email.charAt(i_loop)=="'")
		  || (str_email.charAt(i_loop)==".")))
		{
			return false;
		}
	}
	
	i_pos_consecutive_dots=str_email.indexOf('..');
	if(i_pos_consecutive_dots!=-1)
	{
		return false;
	}
	
	var i_pos_space;
	i_pos_space = str_email.indexOf(' ');
	if(i_pos_space!=-1)
	{
		return false;
	}
	
	i_last_position_of_period = str_email.lastIndexOf('.');
	if(i_last_position_of_period<=0)
	{
		b_period_present=0;
	}
	
	if(((i_length-i_last_position_of_period)>4) || ((i_length-i_last_position_of_period)<3))
	{
		b_correct_length_extension=0;
	}
	
	for(i_loop=0;i_loop<=i_length;i_loop++)
	{
		str_current_character=str_email.charAt(i_loop);
		if (str_current_character=='@')
		{
			i_num_at_symbol=i_num_at_symbol + 1;
		}
	}
	
	if(i_num_at_symbol!=1)
	{
		return false;
	}
	
	i_pos_at_symbol = str_email.indexOf('@');
	if(str_email.charAt(i_pos_at_symbol+1) == '.')
	{
		i_length_of_server_name=0;
	}
	
	if((i_num_at_symbol==1) && (b_period_present==1) && (b_correct_length_extension==1) && (i_length_of_server_name==1))
	{
		b_valid_email=1;
	}
	else
	{
		 b_valid_email=0;
	}
	
	if(b_valid_email==0)
	{
		return false;
	}
	else
	{
		return true;
	}
}
function func_trim(param_text)
{
	var str_text=new String(param_text);
	var str_return_text;
	str_return_text="";
	b_non_blank_started=false;
	b_non_blank_ended=false;
	str_intermediate_blank_chunk="";
	var i_loop;
	for(i_loop=0;i_loop<str_text.length;i_loop++)
	{
		if(str_text.charCodeAt(i_loop)!=32)
		{
			if(!b_non_blank_started)
			{
				b_non_blank_started=true;
			}
			if(b_non_blank_started && !b_non_blank_ended)
			{
				str_return_text+=str_text.charAt(i_loop);
			}
			if(b_non_blank_ended)
			{
				str_return_text+=(str_intermediate_blank_chunk+str_text.charAt(i_loop));
				b_non_blank_ended=false;
				str_intermediate_blank_chunk="";
			}
		}
		else
		{
			if(b_non_blank_started)
			{
				b_non_blank_ended=true;
				str_intermediate_blank_chunk+=" ";
			}
		}
	}
	return str_return_text;
}

function password()
{
var str=document.frmAddApplicant.password1.value;
var len=str.length;
var ret;

for(j=0;j<len;j++)
{
	strchar = str.substring(j,j+1);
	ret=check_valid(strchar);
	if(ret==false)
	{
	}else
	{
		break;
	}
		
}
	if(ret==true)
	{
			alert("Please Enter Valid Password");
			document.frmAddApplicant.password1.value="";
			document.frmAddApplicant.password1.focus();
	}
}
function checkpassword()
{
	if(document.frmAddApplicant.password1.value!=document.frmAddApplicant.cpassword.value)
	{		alert("Password and Confirm Password doesn't match..");
			document.frmAddApplicant.password1.focus();
	}
}

function check_valid(strchar)
{
var comp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_";
var complen=comp.length;
var compchar;
var check;
	
	for (var i = 0 ; i <= complen; i++)
	{
		compchar = comp.substring(i,i+1);
		if (compchar == strchar)
		{
			check=1;
			return false;
		}
	} 
return true;
}

function func_show_other_title()
{
		if(document.frmAddApplicant.title.value=="0")
		{ 
			document.getElementById('other_title').style.display = ""; 
		}
		else
		{
			document.getElementById('other_title').style.display = "none"; 
		}
}
function func_show_other_doctor(str_action)
{
	document.frmAddApplicant.furtherspeciality.selectedIndex="0";
	if(document.frmAddApplicant.speciality.value=='Other' && str_action != 'Load')
	{
		document.getElementById('other_doctor').style.display = ""; 
	}
	else
	{
		document.getElementById('other_doctor').style.display = "none"; 
	}
}

function func_show_other_Profession()
{
		document.frmAddApplicant.speciality.selectedIndex="0";
		document.frmAddApplicant.furtherspeciality.selectedIndex="0";
		if(document.frmAddApplicant.profession.value=="0")
		{ 
			document.getElementById('other_Profession').style.display = ""; 
			document.getElementById('doctor').style.display = "none"; 
			document.getElementById('other_Grade').style.display = "none"; 
		}
		else if((document.frmAddApplicant.profession.value=="Medical Doctor") || (document.frmAddApplicant.profession.value=="Medically Qualified Academic"))
		{
			document.getElementById('doctor').style.display = ""; 
			if(document.frmAddApplicant.grade.value=="0")
			{
				document.getElementById('other_Grade').style.display = ""; 
			}
			document.getElementById('other_Profession').style.display = "none"; 
		}
		else
		{
			document.getElementById('other_Profession').style.display = "none"; 
			document.getElementById('doctor').style.display = "none"; 
			document.getElementById('other_Grade').style.display = "none"; 
		}
}

function func_show_other(str_sp)
{
	document.getElementById('profession').style.display = ""; 
	document.getElementById('other_Profession').style.display = "none"; 
	document.frmAddApplicant.profession.options.length=1;
	switch(document.frmAddApplicant.sector.options[document.frmAddApplicant.sector.selectedIndex].value)
	{
		case "Press" :
				document.getElementById('doctor').style.display = "none"; 
				//document.getElementById('speciality').style.display = "none"; 
				document.frmAddApplicant.profession.options.length=6;	
				if(str_sp=="Print media")
				{ 
					document.frmAddApplicant.profession.options[1].value="Print media";				
					document.frmAddApplicant.profession.options[1].text="Print media";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Print media";				
					document.frmAddApplicant.profession.options[1].text="Print media";
				}
				if(str_sp=="TV/Radio")
				{ 
					document.frmAddApplicant.profession.options[2].value="TV/Radio";				
					document.frmAddApplicant.profession.options[2].text="TV/Radio";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="TV/Radio";				
					document.frmAddApplicant.profession.options[2].text="TV/Radio";
				}
				if(str_sp=="Web")
				{ 
					document.frmAddApplicant.profession.options[3].value="Web";				
					document.frmAddApplicant.profession.options[3].text="Web";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="Web";				
					document.frmAddApplicant.profession.options[3].text="Web";
				}
				if(str_sp=="PR Agency")
				{ 
					document.frmAddApplicant.profession.options[4].value="PR Agency";				
					document.frmAddApplicant.profession.options[4].text="PR Agency";
					document.frmAddApplicant.profession.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[4].value="PR Agency";				
					document.frmAddApplicant.profession.options[4].text="PR Agency";
				}
				if(str_sp=="other")
				{ 
					document.frmAddApplicant.profession.options[5].value="0";				
					document.frmAddApplicant.profession.options[5].text="Other";
					document.frmAddApplicant.profession.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[5].value="0";				
					document.frmAddApplicant.profession.options[5].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;
		case "NGO" :
				document.frmAddApplicant.profession.options.length=5;
				if(str_sp=="Charity")
				{ 
					document.frmAddApplicant.profession.options[1].value="Charity";				
					document.frmAddApplicant.profession.options[1].text="Charity";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Charity";				
					document.frmAddApplicant.profession.options[1].text="Charity";
				}
				if(str_sp=="Royal College")
				{ 
					document.frmAddApplicant.profession.options[2].value="Royal College";				
					document.frmAddApplicant.profession.options[2].text="Royal College";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="Royal College";				
					document.frmAddApplicant.profession.options[2].text="Royal College";
				}
				if(str_sp=="Royal College")
				{ 
					document.frmAddApplicant.profession.options[3].value="Patient Body";				
					document.frmAddApplicant.profession.options[3].text="Patient Body";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="Patient Body";				
					document.frmAddApplicant.profession.options[3].text="Patient Body";
				}
				if(str_sp=="Royal College")
				{ 
					document.frmAddApplicant.profession.options[4].value="0";				
					document.frmAddApplicant.profession.options[4].text="Other";
					document.frmAddApplicant.profession.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[4].value="0";				
					document.frmAddApplicant.profession.options[4].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;
		case "Business/Financial Services" :
				document.frmAddApplicant.profession.options.length=9;
				if(str_sp=="Bank")
				{ 
					document.frmAddApplicant.profession.options[1].value="Bank";				
					document.frmAddApplicant.profession.options[1].text="Bank";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Bank";				
					document.frmAddApplicant.profession.options[1].text="Bank";
				}
				if(str_sp=="VC")
				{ 
					document.frmAddApplicant.profession.options[2].value="VC";				
					document.frmAddApplicant.profession.options[2].text="VC";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="VC";				
					document.frmAddApplicant.profession.options[2].text="VC";
				}
				if(str_sp=="Angel Investor")
				{ 
					document.frmAddApplicant.profession.options[3].value="Angel Investor";				
					document.frmAddApplicant.profession.options[3].text="Angel Investor";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="Angel Investor";				
					document.frmAddApplicant.profession.options[3].text="Angel Investor";
				}
				if(str_sp=="Insurance")
				{ 
					document.frmAddApplicant.profession.options[4].value="Insurance";				
					document.frmAddApplicant.profession.options[4].text="Insurance";
					document.frmAddApplicant.profession.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[4].value="Insurance";				
					document.frmAddApplicant.profession.options[4].text="Insurance";
				}
				if(str_sp=="Professional Service Firm")
				{ 
					document.frmAddApplicant.profession.options[5].value="Professional Service Firm";				
					document.frmAddApplicant.profession.options[5].text="Professional Service Firm";
					document.frmAddApplicant.profession.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[5].value="Professional Service Firm";				
					document.frmAddApplicant.profession.options[5].text="Professional Service Firm";
				}
				if(str_sp=="Entrepreneur")
				{ 
					document.frmAddApplicant.profession.options[6].value="Entrepreneur";				
					document.frmAddApplicant.profession.options[6].text="Entrepreneur";
					document.frmAddApplicant.profession.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[6].value="Entrepreneur";				
					document.frmAddApplicant.profession.options[6].text="Entrepreneur";
				}
				if(str_sp=="Corporate Finance")
				{ 
					document.frmAddApplicant.profession.options[7].value="Corporate Finance";				
					document.frmAddApplicant.profession.options[7].text="Corporate Finance";
					document.frmAddApplicant.profession.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[7].value="Corporate Finance";				
					document.frmAddApplicant.profession.options[7].text="Corporate Finance";
				}
				if(str_sp=="0")
				{ 
					document.frmAddApplicant.profession.options[8].value="0";				
					document.frmAddApplicant.profession.options[8].text="Other";
					document.frmAddApplicant.profession.options[8].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[8].value="0";				
					document.frmAddApplicant.profession.options[8].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;
		case "Subcontractor" :		
				document.frmAddApplicant.profession.options.length=9;
				if(str_sp=="Events Management")
				{ 
					document.frmAddApplicant.profession.options[1].value="Events Management";				
					document.frmAddApplicant.profession.options[1].text="Events Management";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Events Management";				
					document.frmAddApplicant.profession.options[1].text="Events Management";
				}
				if(str_sp=="PR")
				{ 
					document.frmAddApplicant.profession.options[2].value="PR";				
					document.frmAddApplicant.profession.options[2].text="PR";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="PR";				
					document.frmAddApplicant.profession.options[2].text="PR";
				}
				if(str_sp=="Catering")
				{ 
					document.frmAddApplicant.profession.options[3].value="Catering";				
					document.frmAddApplicant.profession.options[3].text="Catering";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="Catering";				
					document.frmAddApplicant.profession.options[3].text="Catering";
				}
				if(str_sp=="Advertising")
				{ 
					document.frmAddApplicant.profession.options[4].value="Advertising";				
					document.frmAddApplicant.profession.options[4].text="Advertising";
					document.frmAddApplicant.profession.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[4].value="Advertising";				
					document.frmAddApplicant.profession.options[4].text="Advertising";
				}
				if(str_sp=="IT Consultant")
				{ 
					document.frmAddApplicant.profession.options[5].value="IT Consultant";				
					document.frmAddApplicant.profession.options[5].text="IT Consultant";
					document.frmAddApplicant.profession.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[5].value="IT Consultant";				
					document.frmAddApplicant.profession.options[5].text="IT Consultant";
				}
				if(str_sp=="Management Consultant")
				{ 
					document.frmAddApplicant.profession.options[6].value="Management Consultant";				
					document.frmAddApplicant.profession.options[6].text="Management Consultant";
					document.frmAddApplicant.profession.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[6].value="Management Consultant";				
					document.frmAddApplicant.profession.options[6].text="Management Consultant";
				}

				if(str_sp=="Design/engineering")
				{ 
					document.frmAddApplicant.profession.options[7].value="Design/engineering";				
					document.frmAddApplicant.profession.options[7].text="Design/engineering";
					document.frmAddApplicant.profession.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[7].value="Design/engineering";				
					document.frmAddApplicant.profession.options[7].text="Design/engineering";
				}
				if(str_sp=="0")
				{ 
					document.frmAddApplicant.profession.options[8].value="0";				
					document.frmAddApplicant.profession.options[8].text="Other";
					document.frmAddApplicant.profession.options[8].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[8].value="0";				
					document.frmAddApplicant.profession.options[8].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;
		case "Industry" :
				document.frmAddApplicant.profession.options.length=10;
				if(str_sp=="Pharmaceutical")
				{ 
					document.frmAddApplicant.profession.options[1].value="Pharmaceutical";				
					document.frmAddApplicant.profession.options[1].text="Pharmaceutical";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Pharmaceutical";				
					document.frmAddApplicant.profession.options[1].text="Pharmaceutical";
				}
				if(str_sp=="Biotech")
				{ 
					document.frmAddApplicant.profession.options[2].value="Biotech";				
					document.frmAddApplicant.profession.options[2].text="Biotech";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="Biotech";				
					document.frmAddApplicant.profession.options[2].text="Biotech";
				}
				if(str_sp=="Medical Devices")
				{ 
					document.frmAddApplicant.profession.options[3].value="Medical Devices";				
					document.frmAddApplicant.profession.options[3].text="Medical Devices";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="Medical Devices";				
					document.frmAddApplicant.profession.options[3].text="Medical Devices";
				}
				if(str_sp=="Diagnostics")
				{ 
					document.frmAddApplicant.profession.options[4].value="Diagnostics";				
					document.frmAddApplicant.profession.options[4].text="Diagnostics";
					document.frmAddApplicant.profession.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[4].value="Diagnostics";				
					document.frmAddApplicant.profession.options[4].text="Diagnostics";
				}
				if(str_sp=="ICT")
				{ 
					document.frmAddApplicant.profession.options[5].value="ICT";				
					document.frmAddApplicant.profession.options[5].text="ICT";
					document.frmAddApplicant.profession.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[5].value="ICT";				
					document.frmAddApplicant.profession.options[5].text="ICT";
				}
				if(str_sp=="Hospital Services")
				{ 
					document.frmAddApplicant.profession.options[6].value="Hospital Services";				
					document.frmAddApplicant.profession.options[6].text="Hospital Services";
					document.frmAddApplicant.profession.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[6].value="Hospital Services";				
					document.frmAddApplicant.profession.options[6].text="Hospital Services";
				}
				if(str_sp=="Design/engineering")
				{ 
					document.frmAddApplicant.profession.options[7].value="Design/engineering";				
					document.frmAddApplicant.profession.options[7].text="Design/engineering";
					document.frmAddApplicant.profession.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[7].value="Design/engineering";				
					document.frmAddApplicant.profession.options[7].text="Design/engineering";
				}
				if(str_sp=="Manufacturing")
				{ 
					document.frmAddApplicant.profession.options[8].value="Manufacturing";				
					document.frmAddApplicant.profession.options[8].text="Manufacturing";
					document.frmAddApplicant.profession.options[8].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[8].value="Manufacturing";				
					document.frmAddApplicant.profession.options[8].text="Manufacturing";
				}
				if(str_sp=="0")
				{ 
					document.frmAddApplicant.profession.options[9].value="0";				
					document.frmAddApplicant.profession.options[9].text="Other";
					document.frmAddApplicant.profession.options[9].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[9].value="0";				
					document.frmAddApplicant.profession.options[9].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;
		case "Academia/Research" :
				document.getElementById('other_sector').style.display = "none"; 
				document.getElementById('profession').style.display = "none"; 
				document.getElementById('other_Profession').style.display = "none"; 
				document.getElementById('doctor').style.display = "none"; 
				document.getElementById('other_Grade').style.display = "none"; 
				break;
		case "Government" :
				document.frmAddApplicant.profession.options.length=4;
				if(str_sp=="Regulatory Body")
				{ 
					document.frmAddApplicant.profession.options[1].value="Regulatory Body";				
					document.frmAddApplicant.profession.options[1].text="Regulatory Body";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Regulatory Body";				
					document.frmAddApplicant.profession.options[1].text="Regulatory Body";
				}
				if(str_sp=="Department of Health")
				{ 
					document.frmAddApplicant.profession.options[2].value="Department of Health";				
					document.frmAddApplicant.profession.options[2].text="Department of Health";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="Department of Health";				
					document.frmAddApplicant.profession.options[2].text="Department of Health";
				}
				if(str_sp=="0")
				{ 
					document.frmAddApplicant.profession.options[3].value="0";				
					document.frmAddApplicant.profession.options[3].text="Other";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="0";				
					document.frmAddApplicant.profession.options[3].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;
		case "Medical" :
				document.frmAddApplicant.profession.options.length=8;
				if(str_sp=="Medical Doctor")
				{ 
					document.frmAddApplicant.profession.options[1].value="Medical Doctor";				
					document.frmAddApplicant.profession.options[1].text="Medical Doctor";
					document.frmAddApplicant.profession.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[1].value="Medical Doctor";				
					document.frmAddApplicant.profession.options[1].text="Medical Doctor";
				}
				if(str_sp=="Medically Qualified Academic")
				{ 
					document.frmAddApplicant.profession.options[2].value="Medically Qualified Academic";				
					document.frmAddApplicant.profession.options[2].text="Medically Qualified Academic";
					document.frmAddApplicant.profession.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[2].value="Medically Qualified Academic";				
					document.frmAddApplicant.profession.options[2].text="Medically Qualified Academic";
				}
				if(str_sp=="Medical Student")
				{ 
					document.frmAddApplicant.profession.options[3].value="Medical Student";				
					document.frmAddApplicant.profession.options[3].text="Medical Student";
					document.frmAddApplicant.profession.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[3].value="Medical Student";				
					document.frmAddApplicant.profession.options[3].text="Medical Student";
				}
				if(str_sp=="Nurse")
				{ 
					document.frmAddApplicant.profession.options[4].value="Nurse";				
					document.frmAddApplicant.profession.options[4].text="Nurse";
					document.frmAddApplicant.profession.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[4].value="Nurse";				
					document.frmAddApplicant.profession.options[4].text="Nurse";
				}
				if(str_sp=="Allied Health professional")
				{ 
					document.frmAddApplicant.profession.options[5].value="Allied Health professional";				
					document.frmAddApplicant.profession.options[5].text="Allied Health professional";
					document.frmAddApplicant.profession.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[5].value="Allied Health professional";				
					document.frmAddApplicant.profession.options[5].text="Allied Health professional";
				}
				if(str_sp=="Dentist")
				{ 
					document.frmAddApplicant.profession.options[6].value="Dentist";				
					document.frmAddApplicant.profession.options[6].text="Dentist";
					document.frmAddApplicant.profession.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[6].value="Dentist";				
					document.frmAddApplicant.profession.options[6].text="Dentist";
				}
				if(str_sp=="0")
				{ 
					document.frmAddApplicant.profession.options[7].value="0";				
					document.frmAddApplicant.profession.options[7].text="Other";
					document.frmAddApplicant.profession.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.profession.options[7].value="0";				
					document.frmAddApplicant.profession.options[7].text="Other";
				}
				document.getElementById('other_sector').style.display = "none"; 
				break;		
		case "other1" :
				document.getElementById('other_sector').style.display = ""; 
				document.getElementById('profession').style.display = "none"; 
				document.getElementById('other_Profession').style.display = "none"; 
				document.getElementById('doctor').style.display = "none"; 
				document.getElementById('other_Grade').style.display = "none"; 
				break;
		case "" :
				document.getElementById('other_sector').style.display = "none"; 
				document.getElementById('profession').style.display = "none"; 
				document.getElementById('other_Profession').style.display = "none"; 
				document.getElementById('doctor').style.display = "none"; 
				document.getElementById('other_Grade').style.display = "none"; 
				break;
	}
}

	function func_show_further_specialities(str_sp)
	{
		document.frmAddApplicant.furtherspeciality.options.length=1;
		switch(document.frmAddApplicant.speciality.options[document.frmAddApplicant.speciality.selectedIndex].value)
		{	
			case "Other" :
					document.getElementById('further_speciality').style.display = "none"; 
					document.getElementById('layergrade').style.display = "none"; 
					break;
			case "Accident & emergency" :
					document.getElementById('further_speciality').style.display = "none"; 
					document.getElementById('layergrade').style.display = "none"; 
					break;
			case "Oncology" :
					document.getElementById('further_speciality').style.display = "none"; 
					document.getElementById('layergrade').style.display = "none"; 
					break;
			case "Obstetrics & gynaecology" :
					document.getElementById('further_speciality').style.display = "none"; 
					document.getElementById('layergrade').style.display = "none"; 
					break;
			case "Pharmaceutical Medicine" :
					document.getElementById('further_speciality').style.display = "none"; 
					document.getElementById('layergrade').style.display = "none"; 
					break;
			case "Anaesthetics"	:
				document.getElementById('further_speciality').style.display = ""; 
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=4;
				if(str_sp=="Intensive Care Medicine")
				{ 
					document.frmAddApplicant.furtherspeciality.options[1].value="Intensive Care Medicine";				
					document.frmAddApplicant.furtherspeciality.options[1].text="Intensive Care Medicine";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Intensive Care Medicine";				
					document.frmAddApplicant.furtherspeciality.options[1].text="Intensive Care Medicine";
				}
				if(str_sp=="General Anaesthetics")
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="General Anaesthetics";
					document.frmAddApplicant.furtherspeciality.options[2].text="General Anaesthetics";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="General Anaesthetics";
					document.frmAddApplicant.furtherspeciality.options[2].text="General Anaesthetics";
				}
				if(str_sp=="Pain Specialist")
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Pain Specialist";
					document.frmAddApplicant.furtherspeciality.options[3].text="Pain Specialist";
					document.frmAddApplicant.furtherspeciality.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Pain Specialist";
					document.frmAddApplicant.furtherspeciality.options[3].text="Pain Specialist";
				}		
				break;
			
			case "Medical Specialities"	:
				document.getElementById('further_speciality').style.display = ""; 				
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=28;
				if(str_sp=="Allergy")
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Allergy";
					document.frmAddApplicant.furtherspeciality.options[1].text="Allergy";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Allergy";
					document.frmAddApplicant.furtherspeciality.options[1].text="Allergy";
				}
				if(str_sp=="Audiological medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Audiological medicine";
					document.frmAddApplicant.furtherspeciality.options[2].text="Audiological medicine";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Audiological medicine";
					document.frmAddApplicant.furtherspeciality.options[2].text="Audiological medicine";
				}
				if(str_sp=="Cardiology")
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Cardiology";
					document.frmAddApplicant.furtherspeciality.options[3].text="Cardiology";

					document.frmAddApplicant.furtherspeciality.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Cardiology";
					document.frmAddApplicant.furtherspeciality.options[3].text="Cardiology";
				}
				if(str_sp=="Clinical genetics")
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="Clinical genetics";
					document.frmAddApplicant.furtherspeciality.options[4].text="Clinical genetics";
					document.frmAddApplicant.furtherspeciality.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="Clinical genetics";
					document.frmAddApplicant.furtherspeciality.options[4].text="Clinical genetics";
				}
				if(str_sp=="Clinical neurophysiology")
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Clinical neurophysiology";
					document.frmAddApplicant.furtherspeciality.options[5].text="Clinical neurophysiology";
					document.frmAddApplicant.furtherspeciality.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Clinical neurophysiology";
					document.frmAddApplicant.furtherspeciality.options[5].text="Clinical neurophysiology";
				}
				if(str_sp=="Clinical pharmacology and therapeutics")
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Clinical pharmacology and therapeutics";
					document.frmAddApplicant.furtherspeciality.options[6].text="Clinical pharmacology and therapeutics";
					document.frmAddApplicant.furtherspeciality.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Clinical pharmacology and therapeutics";
					document.frmAddApplicant.furtherspeciality.options[6].text="Clinical pharmacology and therapeutics";
				}
				if(str_sp=="Clinical physiology")
				{
					document.frmAddApplicant.furtherspeciality.options[7].value="Clinical physiology";
					document.frmAddApplicant.furtherspeciality.options[7].text="Clinical physiology";
					document.frmAddApplicant.furtherspeciality.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[7].value="Clinical physiology";
					document.frmAddApplicant.furtherspeciality.options[7].text="Clinical physiology";
				}
				if(str_sp=="Dermatology")
				{
					document.frmAddApplicant.furtherspeciality.options[8].value="Dermatology";
					document.frmAddApplicant.furtherspeciality.options[8].text="Dermatology";
					document.frmAddApplicant.furtherspeciality.options[8].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[8].value="Dermatology";
					document.frmAddApplicant.furtherspeciality.options[8].text="Dermatology";
				}				
				if(str_sp=="Endocrinology and diabetes mellitus")
				{
					document.frmAddApplicant.furtherspeciality.options[9].value="Endocrinology and diabetes mellitus";
					document.frmAddApplicant.furtherspeciality.options[9].text="Endocrinology and diabetes mellitus";
					document.frmAddApplicant.furtherspeciality.options[9].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[9].value="Endocrinology and diabetes mellitus";
					document.frmAddApplicant.furtherspeciality.options[9].text="Endocrinology and diabetes mellitus";
				}		
				if(str_sp=="Gastroenterology")
				{
					document.frmAddApplicant.furtherspeciality.options[10].value="Gastroenterology";
					document.frmAddApplicant.furtherspeciality.options[10].text="Gastroenterology";
					document.frmAddApplicant.furtherspeciality.options[10].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[10].value="Gastroenterology";
					document.frmAddApplicant.furtherspeciality.options[10].text="Gastroenterology";
				}		
				if(str_sp=="General (internal) medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[11].value="General (internal) medicine";
					document.frmAddApplicant.furtherspeciality.options[11].text="General (internal) medicine";
					document.frmAddApplicant.furtherspeciality.options[11].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[11].value="General (internal) medicine";
					document.frmAddApplicant.furtherspeciality.options[11].text="General (internal) medicine";
				}			
				if(str_sp=="Genito-urinary medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[12].value="Genito-urinary medicine";
					document.frmAddApplicant.furtherspeciality.options[12].text="Genito-urinary medicine";
					document.frmAddApplicant.furtherspeciality.options[12].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[12].value="Genito-urinary medicine";
					document.frmAddApplicant.furtherspeciality.options[12].text="Genito-urinary medicine";
				}	
				if(str_sp=="Geriatric medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[13].value="Geriatric medicine";
					document.frmAddApplicant.furtherspeciality.options[13].text="Geriatric medicine";
					document.frmAddApplicant.furtherspeciality.options[13].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[13].value="Geriatric medicine";
					document.frmAddApplicant.furtherspeciality.options[13].text="Geriatric medicine";
				}
				if(str_sp=="Infectious diseases")
				{
					document.frmAddApplicant.furtherspeciality.options[14].value="Infectious diseases";
					document.frmAddApplicant.furtherspeciality.options[14].text="Infectious diseases";
					document.frmAddApplicant.furtherspeciality.options[14].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[14].value="Infectious diseases";
					document.frmAddApplicant.furtherspeciality.options[14].text="Infectious diseases";
				}
				if(str_sp=="Intensive care medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[15].value="Intensive care medicine";
					document.frmAddApplicant.furtherspeciality.options[15].text="Intensive care medicine";
					document.frmAddApplicant.furtherspeciality.options[15].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[15].value="Intensive care medicine";
					document.frmAddApplicant.furtherspeciality.options[15].text="Intensive care medicine";
				}
				if(str_sp=="Medical oncology")
				{
					document.frmAddApplicant.furtherspeciality.options[16].value="Medical oncology";
					document.frmAddApplicant.furtherspeciality.options[16].text="Medical oncology";
					document.frmAddApplicant.furtherspeciality.options[16].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[16].value="Medical oncology";
					document.frmAddApplicant.furtherspeciality.options[16].text="Medical oncology";
				}
				if(str_sp=="Medical ophthalmology")
				{
					document.frmAddApplicant.furtherspeciality.options[17].value="Medical ophthalmology";
					document.frmAddApplicant.furtherspeciality.options[17].text="Medical ophthalmology";
					document.frmAddApplicant.furtherspeciality.options[17].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[17].value="Medical ophthalmology";
					document.frmAddApplicant.furtherspeciality.options[17].text="Medical ophthalmology";
				}
				if(str_sp=="Neurology")
				{
					document.frmAddApplicant.furtherspeciality.options[18].value="Neurology";
					document.frmAddApplicant.furtherspeciality.options[18].text="Neurology";
					document.frmAddApplicant.furtherspeciality.options[18].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[18].value="Neurology";
					document.frmAddApplicant.furtherspeciality.options[18].text="Neurology";
				}
				if(str_sp=="Occupational medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[19].value="Occupational medicine";
					document.frmAddApplicant.furtherspeciality.options[19].text="Occupational medicine";
					document.frmAddApplicant.furtherspeciality.options[19].selected=true;
				}				
				else
				{
					document.frmAddApplicant.furtherspeciality.options[19].value="Occupational medicine";
					document.frmAddApplicant.furtherspeciality.options[19].text="Occupational medicine";
				}
				if(str_sp=="Orthopaedic medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[20].value="Orthopaedic medicine";
					document.frmAddApplicant.furtherspeciality.options[20].text="Orthopaedic medicine";
					document.frmAddApplicant.furtherspeciality.options[20].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[20].value="Orthopaedic medicine";
					document.frmAddApplicant.furtherspeciality.options[20].text="Orthopaedic medicine";
				}			
				if(str_sp=="Palliative medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[21].value="Palliative medicine";
					document.frmAddApplicant.furtherspeciality.options[21].text="Palliative medicine";
					document.frmAddApplicant.furtherspeciality.options[21].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[21].value="Palliative medicine";
					document.frmAddApplicant.furtherspeciality.options[21].text="Palliative medicine";
				}
				if(str_sp=="Palliative medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[22].value="Public health medicine";
					document.frmAddApplicant.furtherspeciality.options[22].text="Public health medicine";
					document.frmAddApplicant.furtherspeciality.options[22].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[22].value="Public health medicine";
					document.frmAddApplicant.furtherspeciality.options[22].text="Public health medicine";
				}
				if(str_sp=="Rehabilitation medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[23].value="Rehabilitation medicine";
					document.frmAddApplicant.furtherspeciality.options[23].text="Rehabilitation medicine";
					document.frmAddApplicant.furtherspeciality.options[23].selected=true;
				}
				else
				{	
					document.frmAddApplicant.furtherspeciality.options[23].value="Rehabilitation medicine";
					document.frmAddApplicant.furtherspeciality.options[23].text="Rehabilitation medicine";
				}							
				if(str_sp=="Renal medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[24].value="Renal medicine";
					document.frmAddApplicant.furtherspeciality.options[24].text="Renal medicine";
					document.frmAddApplicant.furtherspeciality.options[24].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[24].value="Renal medicine";
					document.frmAddApplicant.furtherspeciality.options[24].text="Renal medicine";
				}
				if(str_sp=="Respiratory medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[25].value="Respiratory medicine";
					document.frmAddApplicant.furtherspeciality.options[25].text="Respiratory medicine";
					document.frmAddApplicant.furtherspeciality.options[25].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[25].value="Respiratory medicine";
					document.frmAddApplicant.furtherspeciality.options[25].text="Respiratory medicine";
				}
				if(str_sp=="Rheumatology")
				{
					document.frmAddApplicant.furtherspeciality.options[26].value="Rheumatology";
					document.frmAddApplicant.furtherspeciality.options[26].text="Rheumatology";
					document.frmAddApplicant.furtherspeciality.options[26].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[26].value="Rheumatology";
					document.frmAddApplicant.furtherspeciality.options[26].text="Rheumatology";
				}
				if(str_sp=="Tropical medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[27].value="Tropical medicine";
					document.frmAddApplicant.furtherspeciality.options[27].text="Tropical medicine";
					document.frmAddApplicant.furtherspeciality.options[26].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[27].value="Tropical medicine";
					document.frmAddApplicant.furtherspeciality.options[27].text="Tropical medicine";
				}
				break;
			case "Paediatrics"	:
				document.getElementById('further_speciality').style.display = ""; 				
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=4;
				if(str_sp=="Paediatric cardiology")				
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Paediatric cardiology";
					document.frmAddApplicant.furtherspeciality.options[1].text="Paediatric cardiology";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Paediatric cardiology";
					document.frmAddApplicant.furtherspeciality.options[1].text="Paediatric cardiology";
				}
				if(str_sp=="Paediatric neurology")			
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Paediatric neurology";
					document.frmAddApplicant.furtherspeciality.options[2].text="Paediatric neurology";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Paediatric neurology";
					document.frmAddApplicant.furtherspeciality.options[2].text="Paediatric neurology";
				}
				if(str_sp=="General Paediatrics")			
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="General Paediatrics";
					document.frmAddApplicant.furtherspeciality.options[3].text="General Paediatrics";
					document.frmAddApplicant.furtherspeciality.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="General Paediatrics";
					document.frmAddApplicant.furtherspeciality.options[3].text="General Paediatrics";
				}
				break;
			case "Pathology"	:
				document.getElementById('further_speciality').style.display = ""; 
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=9;
				if(str_sp=="Blood Transfusion")
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Blood Transfusion";
					document.frmAddApplicant.furtherspeciality.options[1].text="Blood Transfusion";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Blood Transfusion";
					document.frmAddApplicant.furtherspeciality.options[1].text="Blood Transfusion";
				}
				if(str_sp=="Chemical pathology")
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Chemical pathology";
					document.frmAddApplicant.furtherspeciality.options[2].text="Chemical pathology";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Chemical pathology";
					document.frmAddApplicant.furtherspeciality.options[2].text="Chemical pathology";
				}
				if(str_sp=="Clinical cytogenetics and molecular genetics")
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Clinical cytogenetics and molecular genetics";
					document.frmAddApplicant.furtherspeciality.options[3].text="Clinical cytogenetics and molecular genetics";
					document.frmAddApplicant.furtherspeciality.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Clinical cytogenetics and molecular genetics";
					document.frmAddApplicant.furtherspeciality.options[3].text="Clinical cytogenetics and molecular genetics";
				}
				if(str_sp=="General pathology")
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="General pathology";
					document.frmAddApplicant.furtherspeciality.options[4].text="General pathology";
					document.frmAddApplicant.furtherspeciality.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="General pathology";
					document.frmAddApplicant.furtherspeciality.options[4].text="General pathology";
				}
				if(str_sp=="Haematology")
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Haematology";
					document.frmAddApplicant.furtherspeciality.options[5].text="Haematology";
					document.frmAddApplicant.furtherspeciality.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Haematology";
					document.frmAddApplicant.furtherspeciality.options[5].text="Haematology";
				}
				if(str_sp=="Histopathology")
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Histopathology";
					document.frmAddApplicant.furtherspeciality.options[6].text="Histopathology";
					document.frmAddApplicant.furtherspeciality.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Histopathology";
					document.frmAddApplicant.furtherspeciality.options[6].text="Histopathology";
				}
				if(str_sp=="Immunology")
				{
					document.frmAddApplicant.furtherspeciality.options[7].value="Immunology";
					document.frmAddApplicant.furtherspeciality.options[7].text="Immunology";
					document.frmAddApplicant.furtherspeciality.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[7].value="Immunology";
					document.frmAddApplicant.furtherspeciality.options[7].text="Immunology";
				}
				if(str_sp=="Medical microbiology and virology")
				{
					document.frmAddApplicant.furtherspeciality.options[8].value="Medical microbiology and virology";
					document.frmAddApplicant.furtherspeciality.options[8].text="Medical microbiology and virology";
					document.frmAddApplicant.furtherspeciality.options[8].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[8].value="Medical microbiology and virology";
					document.frmAddApplicant.furtherspeciality.options[8].text="Medical microbiology and virology";
				}
				break;
			case "Radiology"	:
				document.getElementById('further_speciality').style.display = ""; 
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=3;
				if(str_sp=="Radiology - clinical")
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Radiology - clinical";
					document.frmAddApplicant.furtherspeciality.options[1].text="Radiology - clinical";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Radiology - clinical";
					document.frmAddApplicant.furtherspeciality.options[1].text="Radiology - clinical";
				}
				if(str_sp=="Radiology - nuclear medicine")
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Radiology - nuclear medicine";
					document.frmAddApplicant.furtherspeciality.options[2].text="Radiology - nuclear medicine";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Radiology - nuclear medicine";
					document.frmAddApplicant.furtherspeciality.options[2].text="Radiology - nuclear medicine";
				}
				break;
			case "Psychiatry"	:
				document.getElementById('further_speciality').style.display = ""; 
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=7;
				if(str_sp=="Child and adolescent psychiatry")
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Child and adolescent psychiatry";
					document.frmAddApplicant.furtherspeciality.options[1].text="Child and adolescent psychiatry";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Child and adolescent psychiatry";
					document.frmAddApplicant.furtherspeciality.options[1].text="Child and adolescent psychiatry";
				}
				if(str_sp=="Forensic psychiatry")
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Forensic psychiatry";
					document.frmAddApplicant.furtherspeciality.options[2].text="Forensic psychiatry";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="Forensic psychiatry";
					document.frmAddApplicant.furtherspeciality.options[2].text="Forensic psychiatry";
				}
				if(str_sp=="General psychiatry")
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="General psychiatry";
					document.frmAddApplicant.furtherspeciality.options[3].text="General psychiatry";
					document.frmAddApplicant.furtherspeciality.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="General psychiatry";
					document.frmAddApplicant.furtherspeciality.options[3].text="General psychiatry";
				}
				if(str_sp=="Old age psychiatry")
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="Old age psychiatry";
					document.frmAddApplicant.furtherspeciality.options[4].text="Old age psychiatry";
					document.frmAddApplicant.furtherspeciality.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="Old age psychiatry";
					document.frmAddApplicant.furtherspeciality.options[4].text="Old age psychiatry";
				}
				if(str_sp=="Psychiatry of learning disability")
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Psychiatry of learning disability";
					document.frmAddApplicant.furtherspeciality.options[5].text="Psychiatry of learning disability";
					document.frmAddApplicant.furtherspeciality.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Psychiatry of learning disability";
					document.frmAddApplicant.furtherspeciality.options[5].text="Psychiatry of learning disability";
				}
				if(str_sp=="Psychotherapy")
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Psychotherapy";
					document.frmAddApplicant.furtherspeciality.options[6].text="Psychotherapy";
					document.frmAddApplicant.furtherspeciality.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Psychotherapy";
					document.frmAddApplicant.furtherspeciality.options[6].text="Psychotherapy";
				}
				break;
			case "Surgical Specialties"	:
				document.getElementById('further_speciality').style.display = ""; 
				document.getElementById('layergrade').style.display = ""; 
				document.frmAddApplicant.furtherspeciality.options.length=12;
				if(str_sp=="Cardio-thoracic surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Cardio-thoracic surgery";
					document.frmAddApplicant.furtherspeciality.options[1].text="Cardio-thoracic surgery";
					document.frmAddApplicant.furtherspeciality.options[1].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[1].value="Cardio-thoracic surgery";
					document.frmAddApplicant.furtherspeciality.options[1].text="Cardio-thoracic surgery";
				}
				if(str_sp=="General surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="General surgery";
					document.frmAddApplicant.furtherspeciality.options[2].text="General surgery";
					document.frmAddApplicant.furtherspeciality.options[2].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[2].value="General surgery";
					document.frmAddApplicant.furtherspeciality.options[2].text="General surgery";
				}
				if(str_sp=="Neurosurgery")
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Neurosurgery";
					document.frmAddApplicant.furtherspeciality.options[3].text="Neurosurgery";
					document.frmAddApplicant.furtherspeciality.options[3].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[3].value="Neurosurgery";
					document.frmAddApplicant.furtherspeciality.options[3].text="Neurosurgery";
				}
				if(str_sp=="Ophthalmology")
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="Ophthalmology";
					document.frmAddApplicant.furtherspeciality.options[4].text="Ophthalmology";
					document.frmAddApplicant.furtherspeciality.options[4].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[4].value="Ophthalmology";
					document.frmAddApplicant.furtherspeciality.options[4].text="Ophthalmology";
				}
				if(str_sp=="Otolaryngology (ENT)")
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Otolaryngology (ENT)";
					document.frmAddApplicant.furtherspeciality.options[5].text="Otolaryngology (ENT)";
					document.frmAddApplicant.furtherspeciality.options[5].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[5].value="Otolaryngology (ENT)";
					document.frmAddApplicant.furtherspeciality.options[5].text="Otolaryngology (ENT)";
				}
				if(str_sp=="Oral & Maxillofacial Surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Oral & Maxillofacial Surgery";
					document.frmAddApplicant.furtherspeciality.options[6].text="Oral & Maxillofacial Surgery";
					document.frmAddApplicant.furtherspeciality.options[6].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[6].value="Oral & Maxillofacial Surgery";
					document.frmAddApplicant.furtherspeciality.options[6].text="Oral & Maxillofacial Surgery";
				}
				if(str_sp=="Paediatric surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[7].value="Paediatric surgery";
					document.frmAddApplicant.furtherspeciality.options[7].text="Paediatric surgery";
					document.frmAddApplicant.furtherspeciality.options[7].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[7].value="Paediatric surgery";
					document.frmAddApplicant.furtherspeciality.options[7].text="Paediatric surgery";
				}
				if(str_sp=="Plastic surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[8].value="Plastic surgery";
					document.frmAddApplicant.furtherspeciality.options[8].text="Plastic surgery";
					document.frmAddApplicant.furtherspeciality.options[8].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[8].value="Plastic surgery";
					document.frmAddApplicant.furtherspeciality.options[8].text="Plastic surgery";
				}
				if(str_sp=="Trauma and orthopaedic surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[9].value="Trauma and orthopaedic surgery";
					document.frmAddApplicant.furtherspeciality.options[9].text="Trauma and orthopaedic surgery";
					document.frmAddApplicant.furtherspeciality.options[9].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[9].value="Trauma and orthopaedic surgery";
					document.frmAddApplicant.furtherspeciality.options[9].text="Trauma and orthopaedic surgery";
				}
				if(str_sp=="Urology")
				{
					document.frmAddApplicant.furtherspeciality.options[10].value="Urology";
					document.frmAddApplicant.furtherspeciality.options[10].text="Urology";
					document.frmAddApplicant.furtherspeciality.options[10].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[10].value="Urology";
					document.frmAddApplicant.furtherspeciality.options[10].text="Urology";
				}
				if(str_sp=="Vascular Surgery")
				{
					document.frmAddApplicant.furtherspeciality.options[11].value="Vascular Surgery";
					document.frmAddApplicant.furtherspeciality.options[11].text="Vascular Surgery";
					document.frmAddApplicant.furtherspeciality.options[11].selected=true;
				}
				else
				{
					document.frmAddApplicant.furtherspeciality.options[11].value="Vascular Surgery";
					document.frmAddApplicant.furtherspeciality.options[11].text="Vascular Surgery";
				}
				break;
		}
	}
function func_show_other_grade()
{
	if(document.frmAddApplicant.grade.value=="0")
	{ 
		document.getElementById('other_Grade').style.display = ""; 
	}
	else
	{
		document.getElementById('other_Grade').style.display = "none"; 
	}
}

function validate()
{

			if(document.frmAddApplicant.email.value=="")			
			{
				alert("Please enter an email address");
				document.frmAddApplicant.email.focus();
				return false;
			}else
			{
				if(!func_is_email(document.frmAddApplicant.email.value))
				{
					alert("Incorrect email format !! Please enter proper email");
					document.frmAddApplicant.email.focus();
					return false;
				}
			}

			if(document.frmAddApplicant.nickname.value=="")			
			{
				alert("Please enter username");
				document.frmAddApplicant.nickname.focus();
				return false;
			}
			if(document.frmAddApplicant.nickname.value.length>8)
			{
				alert("User name can contain a maximum of 8 characters.");
				document.frmAddApplicant.nickname.focus();
				return false;
			}
			if(document.frmAddApplicant.password1.value=="")					
			{
				alert("Please enter password");
				
				document.frmAddApplicant.password1.focus();
				return false;
			}


			if(document.frmAddApplicant.cpassword.value=="")						
			{
				alert("Please enter confirm password");
				
				document.frmAddApplicant.cpassword.focus();
				return false;
			}
			
			if(document.frmAddApplicant.title.value=="")			
			{
				alert("Please Select Title");
				document.frmAddApplicant.title.focus();
				return false;
			}
			if(document.frmAddApplicant.title.value=="0")
			{
				if(document.frmAddApplicant.othertitle.value=="")
				{
					alert("Please Enter Othertitle");
					document.frmAddApplicant.othertitle.focus();
					return false;
				}
			}
		
			if(document.frmAddApplicant.firstname.value=="")				
			{
				alert("Please enter your firstname.");
				document.frmAddApplicant.firstname.focus();
				return false;
			}
			if(document.frmAddApplicant.lastname.value=="")				
			{
				alert("Please enter your lastname.");
				document.frmAddApplicant.lastname.focus();
				return false;
			}
			/*if(document.frmAddApplicant.day.value=="selectday")
			{
				alert("Please select Day of your Date of birth");
				document.frmAddApplicant.day.focus();
				return false;
			}
			if(document.frmAddApplicant.month.value=="selectmonth")
			{
				alert("Please select Month of you Date of birth");
				document.frmAddApplicant.month.focus();
				return false;
			}
			if(document.frmAddApplicant.year.value=="selectyear")
			{
				alert("Please select Year of your Date of birth");
				document.frmAddApplicant.year.focus();
				return false;
			}*/
		var bCorrect = true;
		if(bCorrect)
		{
			if(document.frmAddApplicant.sector.value=="")
			{
				alert("Please select any sector");
				bCorrect = false;
				document.frmAddApplicant.sector.focus();
				return false;
			}
		}
		if(bCorrect)
		{
			if(document.frmAddApplicant.sector.value=="other1")
			{
				if(document.frmAddApplicant.other_sector.value=="")
				{
					alert("Please give other sector.");
					bCorrect = false;
					document.frmAddApplicant.other_sector.focus();
					return false;
				}
			}
		}
		if(document.frmAddApplicant.sector.value=="Academia/Research" || document.frmAddApplicant.sector.value=="other1")
		{
			bCorrect = false;
		}
		if(bCorrect)
		{
			if(document.frmAddApplicant.profession.value=="")
			{
				alert("Please give Profession.");
				bCorrect = false;
				document.frmAddApplicant.profession.focus();
				return false;
			}
		}
		if(bCorrect)
		{
			if(document.frmAddApplicant.profession.value=="0")
			{
				if(document.frmAddApplicant.otherprofession.value=="")
				{
					alert("Please give other profession.");
					bCorrect = false;
					document.frmAddApplicant.otherprofession.focus();
					return false;
				}
			}
		}
		if(bCorrect)
		{
			if(document.frmAddApplicant.profession.value=="Medical Doctor" || document.frmAddApplicant.profession.value=="Medically Qualified Academic")
			{
				if(document.frmAddApplicant.speciality.value=="0")
				{
					alert("Please give specify Specialty.");
					bCorrect = false;
					document.frmAddApplicant.speciality.focus();
					return false;
				}
				if(document.frmAddApplicant.speciality.value!="Oncology" && document.frmAddApplicant.speciality.value!="Pharmaceutical Medicine" && document.frmAddApplicant.speciality.value!="Accident & emergency" && document.frmAddApplicant.speciality.value!="Other") 
				{
					if(document.frmAddApplicant.furtherspeciality.value=="0")
					{
						alert("Please give specify furtherspeciality.");
						bCorrect = false;
						document.frmAddApplicant.furtherspeciality.focus();
						return false;
					}
				}	
				if(document.frmAddApplicant.speciality.value=="Other")
				{
					if(document.frmAddApplicant.otherspeciality.value=="")
					{
						alert("Please specify Other Specialty.");
						bCorrect = false;
						document.frmAddApplicant.otherspeciality.focus();
						return false;
					}	
				}
			}
		}
					
		if(bCorrect)
		{
			if(document.frmAddApplicant.profession.value=="Medical Doctor" || document.frmAddApplicant.profession.value=="Medically Qualified Academic")
			{
				if(document.frmAddApplicant.speciality.value!="Oncology" && document.frmAddApplicant.speciality.value!="Pharmaceutical Medicine" && document.frmAddApplicant.speciality.value!="Accident & emergency") 
				{
					if(document.frmAddApplicant.grade.value=="0")
					{
						if(document.frmAddApplicant.othergrade.value=="")
						{
							alert("Please give grade.");
							bCorrect = false;
							document.frmAddApplicant.othergrade.focus();
							return false;
						}	
					}
				}
			}
		}	
			/*if(document.frmAddApplicant.jobtitle.value=="")					
			{
				alert("Please enter your jobtitle");
				document.frmAddApplicant.jobtitle.focus();
				return false;
			}
			if(document.frmAddApplicant.companyname.value=="")					
			{
				alert("Please enter the name of your organisation");
				document.frmAddApplicant.companyname.focus();
				return false;
			}*/
			
			if(document.frmAddApplicant.address1.value=="")					
			{
				alert("Please give Address1.");
				document.frmAddApplicant.address1.focus();
				return false;
			}
			/*
			if(document.frmAddApplicant.address2.value=="")					
			{
				alert("Please give Address2.");
				document.frmAddApplicant.address2.focus();
				return false;
			}
			if(document.frmAddApplicant.address3.value=="")					
			{
				alert("Please give Address3.");
				document.frmAddApplicant.address3.focus();
				return false;
			}
			*/

			if(document.frmAddApplicant.city.value=="")				
			{
				alert("Please give city.");
				document.frmAddApplicant.city.focus();
				return false;
			}
			/*
			if(document.frmAddApplicant.county.value=="")				
			{
				alert("Please give county.");
				document.frmAddApplicant.county.focus();
				return false;
			}
			*/
			
			if(document.frmAddApplicant.postcode.value=="")				
			{
				alert("Please give postcode.");
				document.frmAddApplicant.postcode.focus();
				return false;
			}
			/*
			if(document.frmAddApplicant.country.value=="")				
			{
				alert("Please give country.");
				document.frmAddApplicant.country.focus();
				return false;
			}
			*/if(document.frmAddApplicant.contact.value=="")				
			{
				alert("Please give Contact No.");
				document.frmAddApplicant.contact.focus();
				return false;
			}
			if(document.frmAddApplicant.terms.checked==false)
			{
				alert("Tick to confirm that you agree to terms and conditions");				
				document.frmAddApplicant.terms.focus();
				return false;
			}
		
			document.frmAddApplicant.submit();
}


