<!--
function checkInput(Input,Desc) {
	check=1;
	ErrorMsg="";
	InputL=Input.length;
	for(ic=0;ic<InputL;ic++) {
		n=Input.indexOf("|",0);
		temp=Input.substring(0,n);
		Input=Input.substring(n+1,Input.length);
		n2=Desc.indexOf("|",0);
		temp2=Desc.substring(0,n2);
		Desc=Desc.substring(n2+1,Desc.length);
		if(frm.elements(temp).value=="")
		{
			ErrorMsg=ErrorMsg+"- "+temp2+"\n";
			check=0;
		}			
		if(Input.length==0){ic=InputL}
	}
	if(check==1)
	{
		ask=confirm("Submit form?");
		if(ask==1)
		{
			frm.method="post";
			frm.submit();
		}
	}else{
		alert("Please insert in: \n\n"+ErrorMsg);
	}
}

function chkFrm() {
			Input = "";
			Desc = "";
			
			if(frm.d_program[2].checked) {
				Input = "d_program_other|";
				Desc = "Degree program (Other)|";
			}
	 		Input +="fname|lname|birth_date|birth_country|";
			Desc +="First name|Last name|Date of birth|Country of birth|";
			
			if(frm.nationality[1].checked) {
				Input += "nationality_other|native_lang|pastport_num|";
				Desc += "Nationality (Other)|Native language|Pasport number|";
			}
			
			Input +="visa_type|issued_at|exp_visa|permanent_add|permanent_tel|";
			Desc +="VISA type|Issued at (VISA)|Expired date (VISA)|Permanent address|Permanent tel|";
			
			Input += "current_add|current_tel|father_name|father_tel|father_occ|";
			Desc += "Current address|Current tel|Father' name|Father's tel|Father's occupation|";
			
			Input += "mother_name|mother_tel|mother_occ|guardian_name|guardian_tel|guardian_add|";
			Desc += "Mother's name|Mother's tel|Mother's occupation|Guardian's name|Guardian's tel|Guardian's address|";
			
			Input += "contact_name|contact_tel|";
			Desc += "Contact person|Contact tel|";
			
			Input += "edu1_name|edu1_lv|edu1_year|edu1_cer|edu1_gpa|edu1_city|";
			Desc += "Name of Institution|Level of study|Year of Graduated|Certificate/ Diploma If awarded|GPA.|City/ Country|";
			
			Input += "honors|";
			Desc += "Honors or awards received|";
			
			if(frm.eng_p[0].checked) {
				Input += "tofel_score|";
				Desc += "TOFEL score|";
			} else if(frm.eng_p[1].checked) {
				Input += "ielts_score|";
				Desc += "IELTS score|";
			} else if(frm.eng_p[2].checked) {
				Input += "engother|engother_score|";
				Desc += "English proficiency (Other)|English proficiency (Other) score|";
			}
			
			Input += "refer1_name|refer1_tel|refer1_relationship|";
			Desc += "Name (first reference)|Tel (first reference)|Relationship (first reference)|";
			
			Input += "refer2_name|refer2_tel|refer2_relationship|";
			Desc += "Name (second reference)|Tel (second reference)|Relationship (second reference)|";
			
			if (frm.source_f[2].checked) {
				Input += "source_f_other|";
				Desc += "Source of funding (Other)|";
			}	
			
			Input += "activities_desc|hear_desc|";
			Desc += "Activities|Here the SSURIC|";
			
			frm.method="post";
			checkInput(Input,Desc);
}
//-->
