// JavaScript Document
function career_validation(theForm)
{
  
  if (theForm.Name.value == "")
  {
    alert("Please enter the name.");
    theForm.Name.focus();
    return false;
  }
  if (theForm.Phone.value == "")
  {
    alert("Please enter the phone no.");
    theForm.Phone.focus();
    return false;
  }else
  {
	  if(!checkInternationalPhone(theForm.Phone.value))
	  {
	  alert("Invalid Phone No.!");
			return false;
	  }
  }
	
  if (theForm.Email.value == "")
  {
    alert("Please enter the email-id.");
    theForm.Email.focus();
    return (false);
  } else {
	if (!echeck(theForm.Email.value))
	{
		alert("Invalid Email ID!");
		return false;
	}
  }
  if (theForm.Alt_Email.value != "")
  {
    
	if (! echeck(theForm.Alt_Email.value))
	{
		alert("Invalid Alternate Email!");
		return false;
	}
  }
  if (theForm.Curr_Loc.value == "")
  {
    alert("Please enter the current location.");
    theForm.Curr_Loc.focus();
    return false;
  }
  if (theForm.Hig_Qul.value == "")
  {
    alert("Please enter the highest qualification.");
    theForm.Hig_Qul.focus();
    return false;
  }
   if (theForm.Total_Exp.value == "")
  {
    alert("Please enter the total experience.");
    theForm.Total_Exp.focus();
    return false;
  }
  if (theForm.Skill_Set.value == "")
  {
    alert("Please enter the skill sets.");
    theForm.Skill_Set.focus();
    return false;
  }
   if (theForm.Relevant_Experience_1.value == "")
  {
    alert("Please select the year of relevant experience.");
    theForm.Relevant_Experience_1.focus();
    return false;
  }
   if((theForm.Relevant_Experience_1.value != "") && (theForm.Relevant_Experience_1.value >0) || (theForm.Relevant_Experience_1.value=='10+'))
   {
	    if (theForm.Relevant_Experience_Field_1.value == "")
		  {
			alert("Please enter the name of relevant experience.");
			theForm.Relevant_Experience_Field_1.focus();
			return false;
		  }
	   }
  
  if (theForm.Resume.value == "")
  {
    alert("Please upload your resume.");
    theForm.Resume.focus();
    return false;
  }else
  {
  if (!Checkfiles(theForm.Resume))
  {
    alert("Please upload only Text and Word Docs.");
    theForm.Resume.focus();
    return false;
  }
  }
  
  
  return true;
}


function email_validation(theForm)
{
  
  if (theForm.subject.value == "")
  {
    alert("Please enter the subject.");
    theForm.subject.focus();
    return false;
  }
 
	if (theForm.name.value == "")
  {
    alert("Please enter your name.");
    theForm.name.focus();
    return false;
  }
  if (theForm.email.value == "")
  {
    alert("Please enter the email-id.");
    theForm.email.focus();
    return (false);
  } else {
	if (!echeck(theForm.email.value))
	{
		alert("Invalid Email ID!");
		return false;
	}
  }
  if (theForm.org.value == "")
  {
    alert("Please enter the name of the organization.");
    theForm.org.focus();
    return (false);
  }
  
  if (theForm.cont_body.value == "")
  {
    alert("Please enter the content body.");
    theForm.cont_body.focus();
    return false;
  }
  
  

  if (theForm.file.value != "")
   {
	  if (!Checkfiles(theForm.file))
	  {
		alert("Please upload only Text and Word Docs.");
		theForm.file.focus();
		return false;
	  }
  }
  
  
  return true;
}

function exp_name(val,type)
{
	/*var fl_name='Relevant_Experience_Field_'+type;
	 */
	 
	 if((val==0) && (val!=''))
	 {
		 document.getElementById("Relevant_Experience_Field_"+type).value  = "";
		 document.getElementById("Relevant_Experience_Field_"+type).readOnly  = "true";
	
	 }else
	 { 
	 document.getElementById("Relevant_Experience_Field_"+type).readOnly  = "";
	 }
	
}