function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
		try {
		ro = new ActiveXObject("Microsoft.XMLHTTP");
		//ro = null; // to free up memory
		} catch(e) {
			window.location='error.php';
		}

    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}


var http = createRequestObject();

function showlanguage()
{
document.getElementById('languagediv').style.display="inline";
}
function closelanguage()
{
document.getElementById('languagediv').style.display="none";
}
function showDiv(divID)
{
document.getElementById(divID).style.display = "inline";
}
function HideJobDetails(id){
	var div_id = "DIV"+id;
	document.getElementById(div_id).innerHTML = "";	
}

function ShowDIVContent(div_id){

	document.getElementById(div_id).style.display = "inline";	
}
function HideDIVContent(div_id) {
	
	document.getElementById(div_id).style.display = "none";	
}

function getInterviewDetails(user_id,job_id,Intervdate) {
	
	//alert(user_id,job_id);
	var div_id = "InterText"+user_id+job_id;
	alert(Intervdate);
	var url = 'phpfiles/getInterviewDate.php?JobID='+job_id+'&user_id='+user_id;
		document.getElementById(div_id).innerHTML = Intervdate;
		
//	postValues('viewDetails',div_id,url);
}
function showJobDetails(id){
//	alert(id);
	var div_id = "DIV"+id;
	var url = 'phpfiles/getJobDetails.php?JobID='+id;
//	document.getElementById(id).innerHTML = "test";
	postValues('homeList',div_id,url);
	
	
}
function getPostTitles() {
	

document.getElementById('form5WorkingTitle').innerHTML = "test";

postValues('jobdescription','form5WorkingTitle','phpfiles/getPostTitle.php');




}

	function SPCWindow(user_id) {
	
		var url_open = "phpfiles/viewSPC.php?user_id="+user_id;
	   window.open(url_open,'window','width=500,height=400,menubar=yes,status=no,toolbar=no,scrollbars=yes,left=250,top=275,directories=no,menubar=no,copyhistory=no');
	
	}
	
	
	function showResume(user_id) {

		var url_open = "phpfiles/showMyResume.php?user_id="+user_id;
	   window.open(url_open,'window','width=600,height=600,menubar=yes,status=no,toolbar=no,scrollbars=yes,left=250,top=275,directories=no,menubar=no,copyhistory=no');

		
	}
	function showmyResume(user_id) {

		var url_open = "../phpfiles/showMyResume.php?user_id="+user_id;
	   window.open(url_open,'window','width=600,height=600,menubar=yes,status=no,toolbar=no,scrollbars=yes,left=250,top=275,directories=no,menubar=no,copyhistory=no');

		
	}


	   function open_win(url_add)
	   {
		jBox.open('iframe-jBoxID','iframe',url_add,'InterviewForm','width=500,height=500,center=true,minimizable=true,resize=true,draggable=true,model=true,scrolling=true');
	   //window.open(url_add,'window','width=500,height=200,menubar=yes,status=no,toolbar=no,scrollbars=yes,left=250,top=275,directories=no,menubar=no,copyhistory=no');
	   }


function setSPC(user_id,row_id,job_id) {
	
	var active = "Active"+user_id+row_id;
	var del_id = "Del"+user_id+row_id;
	var row_id = user_id+row_id;

	document.getElementById(del_id).style.display = "inline";	
	document.getElementById(active).style.display = "none";	
	
	document.getElementById(row_id).innerHTML = "Yes";	
	var url = "phpfiles/setSPC.php?id="+user_id+"&job_id="+job_id;
	
	postValues('viewDetails','resultID',url);

	
}



function RemoveInterviewer(int_id,job_id,active) {
	
	var active = "Active"+int_id+job_id;
	
	
	var url = "phpfiles/deleteInterv.php?int_id="+int_id+"&job_id="+job_id;
	document.getElementById(active).style.display = "none";	
	postValues('editformreq','req_ID',url);

	
}
function showInterviewForm(comboValue,divID,job_id,user_id) {
	//alert (comboValue);
	var textDiv = "InterID"+divID;
	var textVal = "InterText"+divID;
	if(comboValue == "Interview") {
		var url = "http://www.sajeesh.net/dev/phpfiles/setInterview.php?job_id="+job_id+"&user_id="+user_id;
		open_win(url);
	}
	else if(comboValue == "Rejected") {
		var url = "http://www.sajeesh.net/dev/phpfiles/setRejection.php?job_id="+job_id+"&user_id="+user_id;
		open_win(url);
		
		
	}

}
function showJobDescription(id){
	//alert(id);
	var div_id = "DIV"+id;
	var url = 'phpfiles/ShowJobDetails.php?JobID='+id;
	postValues('homeList',div_id,url);
	
	
}

function setSelection(form_name,div_id) {

	
	
	postValues(form_name,div_id,'../phpfiles/setSelection.php');
	
	
}

function unsetSPC(user_id,row_id,job_id) {
	
	var active = "Active"+user_id+row_id;
	var del_id = "Del"+user_id+row_id;
	var row_id = user_id+row_id;

	document.getElementById(del_id).style.display = "none";	
	document.getElementById(active).style.display = "inline";	
	
	document.getElementById(row_id).innerHTML = "No";	

	var url = "phpfiles/delSPC.php?id="+user_id+"&job_id="+job_id;
	
	postValues('viewDetails','resultID',url);
	
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) 
  		{
			alert(alerttxt);
			return false;
		}
	else 
		{
			return true;
		}
	}
}

function checkvalidation(invite)
{	
if (invite.firstname.value.length==0)
	{
		alert("Please enter first name");
		invite.firstname.focus();
		return false;
	}
	if (invite.lastname.value.length==0)
	{
		alert("Please enter last name");
		invite.lastname.focus();
		return false;
	}
	if(validate_email(invite.email,"Invalid Email!")==false)
	{
	  invite.email.focus();
	   return false;
    }
		return true;
 
}
	




function checkForm(application)
{	
	if (application.txtfname.value.length==0)
	{
		alert("Please enter first name");
		application.txtfname.focus();
		return false;
	}
	
	if (application.txtlname.value.length==0)
	{
		alert("Please enter last name");
		application.txtlname.focus();
		return false;
	}
	if (application.txtemail.value.length==0)
	{
		alert("Please enter Email");
		application.txtemail.focus();
		return false;
	}
	
	if(validate_email(application.txtemail,"Invalid Email!")==false)
	{
	   application.txtemail.focus();
	   return false;
    }
	
	if (application.txtpass.value.length==0)
	{
		alert("Please enter password");
		application.txtpass.focus();
		return false;
	}
	if(application.txtcpass.value.length==0)
	{
		alert("Retype password for confirmation");
		application.txtcpass.focus();
		return false;
	}
	if((application.txtpass.value) != (application.txtcpass.value))
	{
		alert("Password does not match");
		application.txtcpass.focus();
		return false;
	}
	if ( ( !application.sex[0].checked ) && ( !application.sex[1].checked ) )
  	{ 
			alert ( "Please choose your Gender: Male or Female" ); 
			return false; 
  	}
		
	if (application.DateOfBirth_Month.value == "Month"){
	   alert("Please select the month from Date Of Birth");
	   application.DateOfBirth_Month.focus();
	   return false;
    }
	if (application.DateOfBirth_Day.value == "Day"){
	   alert("Please select the date from Date Of Birth");
	   application.DateOfBirth_Day.focus();
	   return false;
    }
	if (application.DateOfBirth_Year.value == "Year"){
	   alert("Please select the year from Date Of Birth");
	   application.DateOfBirth_Year.focus();
	   return false;
    }
	
	if (application.HomePhone.value.length == 0)
	{
		alert("Please enter Home Phone");
		application.HomePhone.focus();
		return false;
	}
	 else 
	  {
  		<!--postValues('application','ResultID','phpfiles/add_register1.php');showForm('form1','form2');-->
		postValues('application','ResultID1','index2.php?module=applicantUser&mode=Join');showForm('form1','form2');
	  }
	 
}
function checkLogin(form)
{
	if(form.user_name.value.length == 0)
	{
		alert("Please enter your emailid");
		form.user_name.focus();
		return false;
	}
	if(validate_email(form.user_name,"Invalid Email!")==false)
	{
	   form.user_name.focus();
	   return false;
    }
	if(form.pass_word.value.length ==0)
	{
		alert("Please enter the password");
		form.pass_word.focus();
		return false;
	}
	return true;
 
}

function checkform2(application2)
{	
	/*if(application2.resumefile.value.length == 0)
	{
		alert("Please Upload your resume");
		application2.resumefile.focus();
		return false;
	}
	
	if ( (application2.currentemployment[0].checked) )
  	{ 
			
			if ( (!application2.contactemployer[0].checked) && ( !application2.contactemployer[1].checked ) )
			{ 
				alert ( "May we contact your current employer?" ); 
				return false;
			}
		
			if(application2.currentemployer.value.length == 0)
			{
					alert("Please enter your current employer");
					application2.currentemployer.focus();
					return false;
			}
	
			if(application2.phone.value.length == 0)
			{
					alert("Please enter current employer's phone number");
					application2.phone.focus();
					return false;
			}
			if(application2.contact_person.value.length == 0)
			{
					alert("Please enter the contact person");
					application2.contact_person.focus();
					return false;
			}
		
	 }
	else
	{	*/
		postValues('application2','Result_ID','phpfiles/add_register2.php');showForm('form2','formedu');
	}
/*}*/

function checkform3(eduapplication)
{
	if(eduapplication.high_school.value.length == 0)
	{
		alert("Please enter high school name");
		eduapplication.high_school.focus();
		return false;
	}
	if((!eduapplication.edu_graduate[0].checked) && (!eduapplication.edu_graduate[1].checked))
	{
		alert("Did you graduate?");
		return false;
	}
	if((eduapplication.edu_graduate[0].checked))
	{
		
		if(eduapplication.college_university.value == "Select Any")
		{
			alert("Please enter College/University");
			eduapplication.college_university.focus();
			return false;
		}
	}
		
		if((eduapplication.military[0].checked) && (eduapplication.military[1].checked))
		{
			if(eduapplication.branch.value.length == 0)
			{
				alert("Please enter the branch");
				eduapplication.branch.focus();
				return false;
			}
			if(eduapplication.rank.value.length == 0)
			{
				alert("Please enter the rank");
				eduapplication.rank.focus();
				return false;
			}
			if(eduapplication.service_years.value.length == 0)
			{0
				alert("Please enter the total years of service");
				eduapplication.service_years.focus();
				return false;
			}
			if(eduapplication.skill_duty.value.length == 0)
			{
				alert("Please specify skills/duties");
				eduapplication.skill_duty.focus();
				return false;
			}
			if(eduapplication.details.value.length == 0)
			{
				alert("Please enter related details");
				eduapplication.details.focus();
				return false;
			}
		}
	else
	{
		postValues('eduapplication','EduID','phpfiles/add_register3.php');showForm('formedu','form3');
		<!--------postValues('eduapplication','ResultID','phpfiles/add_register3.php');showForm('form3','form4');--->
	}																		
																					  
}

function checkform4(application3)
{	
		if((!application3.age[0].checked) && (!application3.age[1].checked))
		{
			alert("Are you over the age of 18?");
			return false;
		}
		if(application3.position.value == "--Please Select--")
		{
			alert("What position are you applying for?");
			application3.position.focus();
			return false;
		}
		if(application3.type.value == "--Please Select--")
		{
			alert("Type of work you are seeking?");
			application3.type.focus();
			return false;
		}
		if(application3.availin.value.length == 0)
		{
			alert("When will you be available to interview?");
			application3.availin.focus();
			return false;
		}
		if((!application3.interview[0].checked ) && (!application3.interview[1].checked))
		{
			alert("Have you recently interviewed with anyone?");
			return false;
		}
		if(application3.availtowork.value.length == 0)
		{
			alert("When will you be available for work?");
			application3.availtowork.focus();
			return false;
		}
		if(application3.dateofworking.value.length == 0)
		{
			alert("On what date can you start working?");
			application3.dateofworking.focus();
			return false;
		}
		if((!application3.weekends[0].checked ) && (!application3.weekends[1].checked))
		{
			alert("Can you work on the weekends?");
			return false;
		}
		if((!application3.evening[0].checked ) && (!application3.evening[1].checked))
		{
			alert("Can you work evenings?");
			return false;
		}
		if((!application3.overtime[0].checked ) && (!application3.overtime[1].checked))
		{
			alert("Are you available to work overtime?");
			return false;
		}
		if(application3.salary.value.length == 0)
		{
			alert("What is your current salary/bonus?");
			application3.salary.focus();
			return false;
		}
		if(application3.desire.value.length == 0)
		{
			alert("What income do you desire?");
			application3.desire.focus();
			return false;
		}
		if((!application3.citizen[0].checked ) && (!application3.citizen[1].checked))
		{
			alert("If not a citizen do you have proof of your legal right to work in the United States?");
			return false;
		}
		if((!application3.relocate[0].checked ) && (!application3.relocate[1].checked))
		{
			alert("Are you willing to relocate?");
			return false;
		}
		if((!application3.payrelocate[0].checked ) && (!application3.payrelocate[1].checked))
		{
			alert("Are you willing to pay for your relocation?");
			return false;
		}
		if((!application3.convicted[0].checked ) && (!application3.convicted[1].checked))
		{
			alert("Have you ever been convicted of a felony?");
			return false;
		}
		if(application3.status.value == "--Please Select--")
		{
			alert("Please select Work Status");
			application3.status.focus();
			return false;
		}
		
		else
		{
			postValues('application3','PersonalID','phpfiles/add_register4.php');showForm('form3','form4');
		}
}


function checkform5(application4)
{
	if(application4.fname1.value.length == 0)	
	{
		alert("Please enter the first name");
		application4.fname1.focus();
		return false;
	}
	if(application4.lname1.value.length == 0)	
	{
		alert("Please enter the last name");
		application4.lname1.focus();
		return false;
	}
	if(application4.occupation1.value.length == 0)	
	{
		alert("Please enter the occupation");
		application4.occupation1.focus();
		return false;
	}
	if(application4.number1.value.length == 0)	
	{
		alert("Please enter the number of years acquainted");
		application4.number1.focus();
		return false;
	}
	else
	{
		postValues('application4','ResultID','phpfiles/add_reference.php');showForm('form4','form5');
	}
}

function checkform6(certification)
{
	if(!document.certification.accept_terms.checked)
	{
		alert("Check in the terms & conditions");
		return false;
	}
	if(!document.certification.privacy_policy.checked)
	{
		alert("Read the privacy policy");
		return false;
	}
	else
	{
		showForm('form5','form6');
	}
}
function AddReq(formreq) 
{
	
	  if(formreq.txttitle.value.length==0)
  	  {
	      alert("Please enter Job Title!");
	      formreq.txttitle.focus();
	      return (false);
  	  }
	  if(formreq.txtlocation.value.length==0)
  	  {
	      alert("Please enter Location!");
	      formreq.txtlocation.focus();
	      return (false);
  	  }
	   if(formreq.txtcharge.value.length==0)
	  	  {
	      alert("Please enter Charge Code(s)!");
	      formreq.txtcharge.focus();
	      return (false);
  	  }
	  
	   if(formreq.txtstart.value.length==0)
  	  {
	      alert("Please enter Requested Start Date!");
	      formreq.txtstart.focus();
	      return (false);
  	  }	 
	   if(formreq.txtopening.value.length==0)
	  	  {
	      alert("Please enter Openings!");
	      formreq.txtopening.focus();
	      return (false);
  	  }
	   
	   if(formreq.txtoriginator.value.length==0)
	  	  {
	      alert("Please enter Hiring Manager!");
	      formreq.txtoriginator.focus();
	      return (false);
  	  }
	  if(formreq.full_part.value=="Select One")
	   {
	      alert("Please enter Full Time/Part Time Field!");
	      formreq.full_part.focus();
	      return (false);
  	  }
	  
	   if(formreq.txtexecutive.value=="Select One")
  	  {
	      alert("Please enter Executive!");
	      formreq.txtexecutive.focus();
	      return (false);
  	  }	 
	  if(formreq.txtrecuriter.value=="Select One")
	   {
	      alert("Please enter Recruiter!");
	      formreq.txtrecuriter.focus();
	      return (false);
  	  }
	  
	  if(formreq.txtdesc.value.length==0)
  	  {
	      alert("Please enter Description of job duties!");
	      formreq.txtdesc.focus();
	      return (false);
  	  }
	   if(formreq.txtrequirment.value.length==0)
	  	  {
	      alert("Please enter Education requirements!");
	      formreq.txtrequirment.focus();
	      return (false);
  	  }
	  if(formreq.txtexperience.value.length==0)
	  	  {
	      alert("Please enter Experience required!");
	      formreq.txtexperience.focus();
	      return (false);
  	  }
	else 
	  {
	  
		alert("Your Requisition has been sent successfully");
		
	  	saveRequisition();
		 
		document.getElementById('AddinterID').style.display = "inline";	
		
			return false;
		//postValues('formreq','result','phpfiles/add_edu_details.php');
	  }
	
}

function hidebutton()
{alert("Interviewers successfully added");
	postValues('addInterviewer','AddInter','phpfiles/addInterviewer.php');


	document.getElementById('addd').style.display = "none";
		return true;
		
	 	
}
function ShowAddResume(){


document.getElementById('ResumeID').style.display = "inline";	


}

function Edit()
{
	
document.getElementById('profile1').style.display = "none";	
document.getElementById('editprofile1').style.display = "inline";	
}

function Mail()
{


document.getElementById('friend').style.display = "inline";	

}

function Editpersonal()
{
	
document.getElementById('personal').style.display = "none";	
document.getElementById('editpersonal').style.display = "inline";	
}



function Showlist(){

document.getElementById('dv_ID').style.display = "none";
document.getElementById('InterviewID').style.display = "inline";	


}
function ShowAddEducation(){


document.getElementById('EducationID').style.display = "inline";	


}



function ShowDetails(id){
	


document.getElementById('JobID').style.display = "inline";	




}

function HideEducation() {
	
	document.getElementById('EducationID').style.display = "none";	
}
function hidediv() {
	
	document.getElementById('loginDiv').style.display = "none";	
	//document.getElementById('main').style.display = "inline";
}
function Check(application2) 
{
	
	  if(application2.txtHighestEducation1.value.length==0)
  	  {
	      alert("Please enter Highest Education!");
	      application2.txtHighestEducation1.focus();
	      return (false);
  	  }
	  if(application2.txtMajor1.value.length==0)
  	  {
	      alert("Please enter Major!");
	      application2.txtMajor1.focus();
	      return (false);
  	  }
	   if(application2.txtDegree1.value.length==0)
	  	  {
	      alert("Please enter Degree!");
	      application2.txtDegree1.focus();
	      return (false);
  	  }
	  if(application2.txtCollegeName1.value.length==0)
	  	  {
	      alert("Please enter College Name!");
	      application2.txtCollegeName1.focus();
	      return (false);
  	  }
	  if(application2.txtCollegeLocation1.value.length==0)
  	  {
	      alert("Please enter Location Of College!");
	      application2.txtCollegeLocation1.focus();
	      return (false);
  	  }	 
	  if(application2.txtState1.value.length==0)
	   {
	      alert("Please enter college(State)!");
	      application2.txtState1.focus();
	      return (false);
  	  }
	  

  	  
	  else 
	  {
  		
		//return true;
		postValues('application2','result','phpfiles/add_edu_details.php');
	  }
	
}


function Check1(form1) 
{
	if(form1.cpass.value.length==0)
  	{
	    alert("Please enter Current Password!");
	    form1.cpass.focus();
	    return (false);
  	}
	if(form1.newpass.value.length==0)
  	{
	    alert("Please enter New Password!");
	    form1.newpass.focus();
	    return (false);
  	}
	if(form1.repass.value.length==0)
  	{
	    alert("Please enter Re-type Password Field!");
	    form1.repass.focus();
	    return (false);
  	}
		  else 
	  {
  		
	 
		postValues('form1','Result_ID','index2.php?module=applicantUser&mode=UpdatePassword');
	
		showForm('pass','form2');
		 
		
		
	  }
	  return true;
	
}







function Check2(changepass) 
{
	if(changepass.curr_password.value.length==0)
  	{
	    alert("Please enter Current Password!");
	    changepass.curr_password.focus();
	    return (false);
  	}
	if(changepass.new_password.value.length==0)
  	{
	    alert("Please enter New Password!");
	   changepass.new_password.focus();
	    return (false);
  	}
	if(changepass.re_password.value.length==0)
  	{
	    alert("Please enter Re-type Password Field!");
	  changepass.re_password.focus();
	    return (false);
  	}
		  else 
	  {
  		
	 
		postValues('changepass','ChangeID','../phpfiles/checkPass.php');
	
		showForm('pass','form');
		 
		
		
	  }
	  return true;
	
}





function Change(form1) 
{
	if(form1.cpass.value.length==0)
  	{
	    alert("Please enter Current Password!");
	    form1.cpass.focus();
	    return (false);
  	}
	if(form1.newpass.value.length==0)
  	{
	    alert("Please enter New Password!");
	    form1.newpass.focus();
	    return (false);
  	}
	if(form1.repass.value.length==0)
  	{
	    alert("Please enter Re-type Password Field!");
	    form1.repass.focus();
	    return (false);
  	}
		  else 
	  {
  		
	 
		postValues('form1','Result_ID','index2.php?module=adminChangePass&mode=UpdatePassword');
	
		showForm('pass','form2');
		 
		
		
	  }
	  return true;
	
}



function HideDetail() {
	
		document.getElementById('JobDetails').style.display = "inline";	
		document.getElementById('ApplyForm').style.display = "inline";	
		
		
}
function hideApply() {
	
	 	
		document.getElementById('confirmPage').style.display = "none";
		
		
		
		
}

function Applicant(application) 
{
	
	  if(application.user.value.length==0)
  	  {
	      alert("Please Enter username!");
	      application.user.focus();
	      return (false);
  	  }
	  if(application.txtpass.value.length==0)
  	  {
	      alert("Please Enter Password!");
	      application.txtpass.focus();
	      return (false);
  	  }
	   if(application.txtcpass.value.length==0)
	  	  {
	      alert("Please Enter Confirm Password!");
	      application.txtcpass.focus();
	      return (false);
  	  }
	  if(application.txtfname.value.length==0)
	  	  {
	      alert("Please Enter First Name!");
	      application.txtfname.focus();
	      return (false);
  	  }
	  if(application.txtlname.value.length==0)
  	  {
	      alert("Please Enter Last Name!");
	      application.txtlname.focus();
	      return (false);
  	  }	
	   if(application.txtSSN.value.length==0)
  	  {
	      alert("Please Enter Social Security Number!");
	      application.txtlname.focus();
	      return (false);
  	  }	
	  
	  if(IsNumeric(application.txtSSN.value)==false)
  	  {
	      alert("Invalid Social Security Number!");
	      application.txtSSN.focus();
	      return (false);
  	  }
	 
	     if(application.txtappdate.value.length==0)
  	  {
	      alert("Please Enter Date Of Application!");
	      application.txtappdate.focus();
	      return (false);
  	  }
	       if(application.txtavdate.value.length==0)
  	  {
	      alert("Please Enter Date Of Availability!");
	      application.txtavdate.focus();
	      return (false);
  	  }
	  if (application.Huntsville.checked == false)
	  {
	  	if(application.Atlanta.checked == false) 
		{
			if (application.Lawton.checked == false)
			{
				if (application.Orlando.checked == false ) 
				{
					alert("Please Select TMI Location!");
					return false;
			  
				}
			}
		}
	  }
	  
	  if(application.txthomeadd.value.length==0)
	   {
	      alert("Please Enter Home Address!");
	      application.txthomeadd.focus();
	      return (false);
  	  }
	  
        if(application.txtstate.value.length==0)
	   {
	      alert("Please Enter State!");
	      application.txtstate.focus();
	      return (false);
  	  }
	  if(application.country.value.length==0)
	   {
	      alert("Please Enter Country!");
	      application.country.focus();
	      return (false);
  	  }
	  
	    if(application.homephonecountrycode.value.length==0)
	   {
	      alert("Please Enter Home Phone!");
	      application.homephonecountrycode.focus();
	      return (false);
  	  }
	   if(application.homephoneareacode.value.length==0)
	   {
	      alert("Please Enter Home Phone!");
	      application.homephoneareacode.focus();
	      return (false);
  	  }
	   if(application.homephonenumber.value.length==0)
	   {
	      alert("Please Enter Home Phone!");
	      application.homephonenumber.focus();
	      return (false);
  	  }
	    if (validate_email(application.txtemail,"Empty/Invalid e-mail address!")==false)
  		{
			application.txtemail.focus();
			return false;
		}
  	    if(application.highestdegree.value.length==0)
	   {
	      alert("Please Enter Highest Degree!");
	      application.highestdegree.focus();
	      return (false);
  	  }
  	     if(application.hdcollege.value.length==0)
	   {
	      alert("Please Enter Colleges/University!");
	      application.hdcollege.focus();
	      return (false);
  	  }
  	  
	  else 
	  {
  		
	 
		postValues('application','ResultID','phpfiles/register.php');
		showForm('Form1','Form2');
		 
		
		
	  }
	  return true;
	
}
function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) 
  		{
			alert(alerttxt);
			return false;
		}
	else 
		{
			return true;
		}
	}
}

function showEditEducation(id) {
	
	var HighEd = "HighF"+id;
	var MasterF = "MasterVal"+id;
	
	var MasterV = "MasterText"+id;
	
	
	var DegreeV = "DegreeValue"+id;
	var DegreeT = "DegreeText"+id;
	
	
	var CollegeT = "CollegeText"+id;
	var CollegeV = "CollegeValue"+id;
	
	
	var CityT = "CityText"+id;
	var CityV = "CityValue"+id;
	
	var StateT = "StateText"+id;
	var StateV = "StateValue"+id;
	
	var HighT = "HighText"+id;
	var HighV = "HighValue"+id;
	

	//alert(MasterF);


	document.getElementById(CollegeV).style.display = "inline";	
	document.getElementById(CollegeT).style.display = "none";	


	document.getElementById(MasterF).style.display = "inline";	
	document.getElementById(MasterV).style.display = "none";	


	document.getElementById(StateV).style.display = "inline";	
	document.getElementById(StateT).style.display = "none";	


	document.getElementById(CityV).style.display = "inline";	
	document.getElementById(CityT).style.display = "none";	


	document.getElementById(DegreeV).style.display = "inline";	
	document.getElementById(DegreeT).style.display = "none";	

	document.getElementById(HighV).style.display = "inline";	
	document.getElementById(HighT).style.display = "none";	

	
}

function saveEducation(id) {
	
	
//	alert(id);

	var MasterF = "MasterVal"+id;
	
	var MasterV = "MasterText"+id;
	
	var MasterNew = "MasterF"+id;


	var DegreeV = "DegreeValue"+id;
	var DegreeT = "DegreeText"+id;
	
	
	var CollegeT = "CollegeText"+id;
	var CollegeV = "CollegeText"+id;
	
	var CollegeT = "CollegeText"+id;
	var CollegeV = "CollegeValue"+id;
	
	
	var CityT = "CityText"+id;
	var CityV = "CityValue"+id;
	
	var StateT = "StateText"+id;
	var StateV = "StateValue"+id;
	
	var HighT = "HighText"+id;
	var HighV = "HighValue"+id;
	
	
	//alert(MasterF);
	
	document.getElementById(MasterF).style.display = "none";	
	document.getElementById(MasterV).style.display = "inline";


	document.getElementById(CollegeV).style.display = "none";	
	document.getElementById(CollegeT).style.display = "inline";	


	document.getElementById(StateV).style.display = "none";	
	document.getElementById(StateT).style.display = "inline";	


	document.getElementById(CityV).style.display = "none";	
	document.getElementById(CityT).style.display = "inline";	


	document.getElementById(DegreeV).style.display = "none";	
	document.getElementById(DegreeT).style.display = "inline";	

	document.getElementById(HighV).style.display = "none";	
	document.getElementById(HighT).style.display = "inline";	

	
	document.getElementById(MasterV).innerHTML = document.getElementById(MasterNew).value;
	
	document.getElementById(CollegeT).innerHTML = document.getElementById("CollegeF"+id).value;
	
		document.getElementById(DegreeT).innerHTML = document.getElementById("DgreF"+id).value;
		document.getElementById(CityT).innerHTML = document.getElementById("CityF"+id).value;		
		document.getElementById(HighT).innerHTML = document.getElementById("HighF"+id).value;				
		
document.getElementById(StateT).innerHTML = document.getElementById("StateF"+id).value;						

	var formID = "formId"+id;
	
	var url = "phpfiles/setEducation.php";
	postValues(formID,"resultID",url);

}

function showForm(hideDiv,divID) {
	
	document.getElementById(divID).style.display = "inline";	
	document.getElementById(hideDiv).style.display = "none";	
	
	
}


	function postValues(formName,divID,url) {
//alert(url);
		
		var formObj = new DHTMLSuite.form({ formRef:formName,action:url,responseEl:divID});
		formObj.submit();
		
	}

function showEditFileds(id) {
	
	var userNameTxt = "userNameText"+id;
	var userNameValue = "userNameValue"+id;
	var btnEdit = "btnEdit"+id;
	var btnSave = "btnSave"+id;
	document.getElementById(userNameValue).style.display = "inline";	
	document.getElementById(userNameTxt).style.display = "none";	

	document.getElementById(btnSave).style.display = "inline";	
	document.getElementById(btnEdit).style.display = "none";	

	


}
function saveFields(id) {
	var userNameTxt = "userNameText"+id;
	var userNameValue = "userNameValue"+id;
	var btnEdit = "btnEdit"+id;
	var btnSave = "btnSave"+id;
	document.getElementById(userNameValue).style.display = "none";	
	document.getElementById(userNameTxt).style.display = "inline";	

	document.getElementById(btnSave).style.display = "none";	
	document.getElementById(btnEdit).style.display = "inline";
	var  url = "../phpfiles/listUser.php?id="+id;
	postValues("userList","resID",url);
	
	
}
function checkEmail() {
	var  url = "../phpfiles/checkEmail.php";
	postValues("application","emailError",url);
	
}

function ApplicantCheckUserName(username) {
	
	var today = new Date();
	cur_time = " "+today.getSeconds()*10;	
	var url = 'phpfiles/usercheck.php?user_name='+username+'&time='+cur_time;
	
 	http.open('GET', url);
    http.onreadystatechange = ApplicantuserResponse;
    http.send(null);	
	
	
}

function ApplicantuserResponse(){
	
	 if(http.readyState == 4){
        var response = http.responseText;
		if(response == 1){
			document.getElementById('email').value = "";
			document.getElementById('emailmsg').innerHTML = "<font color='red'>User already Existing</font>";
			
		}else {
			
			document.getElementById('emailmsg').innerHTML = "Available";
		}
		
	 }
	
}

function ApplicantCheckUser(username) {
	
	var today = new Date();
	cur_time = " "+today.getSeconds()*10;	
	var url = 'phpfiles/usercheck.php?user_name='+username+'&time='+cur_time;
	
 	http.open('GET', url);
    http.onreadystatechange = ApplicantuserResponse1;
    http.send(null);	
	
	
}
function ApplicantuserResponse1(){
	
	 if(http.readyState == 4){
        var response = http.responseText;
		if(response == 1){
			document.getElementById('mail').value = "";
			document.getElementById('emailmsg').innerHTML="<font color='red'>User already Registered</font>";
			
		}else {
			
			document.getElementById('emailmsg').innerHTML = "";
		}
		
	 }
	
}
function showMoreEmp(divID) {
		document.getElementById(divID).style.display = "inline";
	
}
function showMoreEdu(divID) {
		document.getElementById(divID).style.display = "inline";
	
}
function showMoreRes(divID) {
		document.getElementById(divID).style.display = "inline";
	
}

function saveAuth(){
	var  url = "phpfiles/saveAuth.php";
	postValues("req_auth_frm","authResponse",url);
	
	
}
 
 function minRequirement(){
	var  url = "phpfiles/minRequirement.php";
	postValues("min_req","minReq",url);
	
	
}
 function reqPosting(){
	var  url = "phpfiles/reqPosting.php";
	postValues("req_post_frm","req_Posting",url);
	
	
}
	

function requisitionPosting(){
	var  url = "phpfiles/postDetails.php";
	postValues("post_details","post_Detail",url);
	
	
}
	

function saveSubmit(){
	var  url = "phpfiles/submit.php";
	postValues("submit","submitID",url);
	
	
}
function convert($date)
{
$date = explode("-",$date);
if ($date[0]<=9) { $date[0]="0".$date[0]; }
if ($date[1]<=9) { $date[1]="0".$date[1]; }
$date = array($date[2], $date[1], $date[0]);
return $n_date=implode("-", $date);
 }
 
 
 

 
 function Test() {
	 
	alert('Hello'); 
 }
 function saveRequisition(){
	 
	var  url = "phpfiles/addJobRequisition.php";
	
	postValues("formreq","idid",url);
	document.formreq.reset();

	
}
 
  function updateRequisition(editformreq){
	 
	 	 
	
	  if(editformreq.txttitle.value.length==0)
  	  {
	      alert("Please enter Job Title!");
	      editformreq.txttitle.focus();
	      return false;
  	  }
	  if(editformreq.txtdesc.value.length==0)
  	  {
	      alert("Please enter Description of job duties!");
	     editformreq.txtdesc.focus();
	      return false;
  	  }
	     if(editformreq.txtrequirment.value.length==0)
	  	  {
	      alert("Please enter Education requirements!");
	      editformreq.txtrequirment.focus();
	      return false;
  	  }
	  
	  if(editformreq.txtcharge.value.length==0)
	  	  {
	      alert("Please enter Charge Code(s)!");
	    editformreq.txtcharge.focus();
	      return false;
  	  }
	  
	     if(editformreq.txtstart.value.length==0)
  	  {
	      alert("Please enter Requested Start Date!");
	      editformreq.txtstart.focus();
	      return false;
  	  } 
	  
	     if(editformreq.txtopening.value.length==0)
	  	  {
	      alert("Please enter Openings!");
	      editformreq.txtopening.focus();
	      return false;
  	  }
	   	

else{

	var  url = "phpfiles/updateJobRequisition.php";
	postValues("editformreq","req_ID",url);
}
 return true;
    }
	  
	
function update(editformreq){

	  
  	  
	
	  if(editformreq.txttitle.value.length==0)
  	  {
	      alert("Please enter Job Title!");
	      editformreq.txttitle.focus();
	      return false;
  	  }
	  if(editformreq.txtlocation.value.length==0)
  	  {
	      alert("Please enter Location!");
	      editformreq.txtlocation.focus();
	      return false;
  	  }
	   if(editformreq.txtcharge.value.length==0)
	  	  {
	      alert("Please enter Charge Code(s)!");
	    editformreq.txtcharge.focus();
	      return false;
  	  }
	  
	   if(editformreq.txtstart.value.length==0)
  	  {
	      alert("Please enter Requested Start Date!");
	      editformreq.txtstart.focus();
	      return false;
  	  }

           	 
	   if(editformreq.txtopening.value.length==0)
	  	  {
	      alert("Please enter Openings!");
	      editformreq.txtopening.focus();
	      return false;
  	  }
	   
	  
	  if(editformreq.txtdesc.value.length==0)
  	  {
	      alert("Please enter Description of job duties!");
	     editformreq.txtdesc.focus();
	      return false;
  	  }
	   if(editformreq.txtrequirment.value.length==0)
	  	  {
	      alert("Please enter Education requirements!");
	      editformreq.txtrequirment.focus();
	      return false;
  	  }
	  if(editformreq.txtexperience.value.length==0)
	  	  {
	      alert("Please enter Experience required!");
	     editformreq.txtexperience.focus();
	      return false;
  	  }
	

else{
	alert("Requisition has been updated successfully...");
	var  url = "phpfiles/Updaterequisition1.php";
	postValues("editformreq","req_ID",url);
}
 return true;
    }
function UpdateApprove(id,div_id) {
	
	document.getElementById(div_id).innerHTML = "Approved";
	var  url = "../phpfiles/setApprove.php?job_id="+id;
	postValues("Application","resultID",url);
		
}




function UpdateDeny(id,div_id) {
	
	document.getElementById(div_id).innerHTML = "Denied";
	var  url = "../phpfiles/setDeny.php?job_id="+id;
	postValues("Application","resultID",url);
		
}
function AuthorizerApprove(id,div_id) {
	
	document.getElementById(div_id).innerHTML = "Approved";
	var  url = "phpfiles/Approve1.php?requisition_id="+id;
	postValues("Application","resultID",url);
		
}
function AuthorizerDeny(id,div_id) {
	
	document.getElementById(div_id).innerHTML = "Denied";
	var  url = "phpfiles/Deny1.php?requisition_id="+id;
	postValues("Application","resultID",url);
		
}
function Login2(){
	
	document.getElementById(div_id).innerHTML = "Denied";
	var  url = "phpfiles/Login2.php";
	postValues("Loginfrm","tdid",url);
	
		
}
function requisitionPosting(){
	var  url = "phpfiles/addJobsApplied.php";
	postValues("appliedJob","JobDetails",url);
	
	
}
function setCloseReq(form_name,div_id) {

	
	
	postValues(form_name,div_id,'phpfiles/setCloseReq.php');
	
	
}


function showAllApplications(divID) {
		document.getElementById(divID).style.display = "inline";
	
}

function updateRequisition1(editformreq){

	   if(editformreq.txtreq_number.value.length==0)
  	  {
	      alert("Please enter Job Requisition Number!");
	      editformreq.txtreq_number.focus();
	      return false;
  	  }
  	  
	
	  if(editformreq.txttitle.value.length==0)
  	  {
	      alert("Please enter Job Title!");
	      editformreq.txttitle.focus();
	      return false;
  	  }
	  if(editformreq.txtlocation.value.length==0)
  	  {
	      alert("Please enter Location!");
	      editformreq.txtlocation.focus();
	      return false;
  	  }
	   if(editformreq.txtcharge.value.length==0)
	  	  {
	      alert("Please enter Charge Code(s)!");
	    editformreq.txtcharge.focus();
	      return false;
  	  }
	  
	   if(editformreq.txtstart.value.length==0)
  	  {
	      alert("Please enter Requested Start Date!");
	      editformreq.txtstart.focus();
	      return false;
  	  }

           	 
	   if(editformreq.txtopening.value.length==0)
	  	  {
	      alert("Please enter Openings!");
	      editformreq.txtopening.focus();
	      return false;
  	  }
	   
	  
	  if(editformreq.txtdesc.value.length==0)
  	  {
	      alert("Please enter Description of job duties!");
	     editformreq.txtdesc.focus();
	      return false;
  	  }
	   if(editformreq.txtrequirment.value.length==0)
	  	  {
	      alert("Please enter Education requirements!");
	      editformreq.txtrequirment.focus();
	      return false;
  	  }
	  if(editformreq.txtexperience.value.length==0)
	  	  {
	      alert("Please enter Experience required!");
	     editformreq.txtexperience.focus();
	      return false;
  	  }
	

else{
	alert("Requisition has been updated successfully...");
	var  url = "phpfiles/updateRequisitionRecruiter.php";
	postValues("editformreq","req_ID",url);
}
 return true;
    }
