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 HideJobDetails(id){

	var div_id = "DIV"+id;

	document.getElementById(div_id).innerHTML = "";	

}

function ShowHideDIV(showdiv,showdiv2,hidediv){


	document.getElementById(hidediv).style.display = "none";
	document.getElementById(showdiv).style.display = "inline";
	document.getElementById(showdiv2).style.display = "inline";
		

}
function ShowHideDIV2(showdiv,hidediv2,hidediv){


	document.getElementById(hidediv).style.display = "none";
	document.getElementById(hidediv2).style.display = "none";
	document.getElementById(showdiv).style.display = "inline";
		

}

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);

	

	

}



//



var dtCh= "-";

var minYear=2008;

var maxYear=2100;



function isInteger(s){

	var i;

    for (i = 0; i < s.length; i++){   

        // Check that current character is number.

        var c = s.charAt(i);

        if (((c < "0") || (c > "9"))) return false;

    }

    // All characters are numbers.

    return true;

}



function stripCharsInBag(s, bag){

	var i;

    var returnString = "";

    // Search through string's characters one by one.

    // If character is not in bag, append to returnString.

    for (i = 0; i < s.length; i++){   

        var c = s.charAt(i);

        if (bag.indexOf(c) == -1) returnString += c;

    }

    return returnString;

}



function daysInFebruary (year){

	// February has 29 days in any year evenly divisible by four,

    // EXCEPT for centurial years which are not also divisible by 400.

    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );

}

function DaysArray(n) {

	for (var i = 1; i <= n; i++) {

		this[i] = 31

		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}

		if (i==2) {this[i] = 29}

   } 

   return this

}



function isDate(dtStr){

	var daysInMonth = DaysArray(12)

	var pos1=dtStr.indexOf(dtCh)

	var pos2=dtStr.indexOf(dtCh,pos1+1)

	var strMonth=dtStr.substring(0,pos1)

	var strDay=dtStr.substring(pos1+1,pos2)

	var strYear=dtStr.substring(pos2+1)

	strYr=strYear

	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)

	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)

	for (var i = 1; i <= 3; i++) {

		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)

	}

	month=parseInt(strMonth)

	day=parseInt(strDay)

	year=parseInt(strYr)

	if (pos1==-1 || pos2==-1){

		alert("The date format should be : mm-dd-yyyy")

		return false

	}

	if (strMonth.length<1 || month<1 || month>12){

		alert("Please enter a valid month")

		return false

	}

	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){

		alert("Please enter a valid day")

		return false

	}

	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){

		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)

		return false

	}

	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){

		alert("Please enter a valid date")

		return false

	}

return true

}

/*

function ValidateForm(){

	var dt=document.formreq.txtstart

	

	if (isDate(dt.value)==false){

		dt.focus()

		return false

	}

    return true

 }



*/

//

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)

	   {

			

	   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) {

	

	var textDiv = "InterID"+divID;

	var textVal = "InterText"+divID;

	if(comboValue == "Interview") {

		//document.getElementById(textVal).style.display = "none";	

		//document.getElementById(textDiv).style.display = "inline";	

		var url = "phpfiles/setInterview.php?job_id="+job_id+"&user_id="+user_id;

		open_win(url);

	}

	else if(comboValue == "Rejected") {

		var url = "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 CheckEmployer(application3) 

{

	

	  if(application3.txtemployer1.value.length==0)

  	  {

	      alert("Please enter Previous Employer !");

	      application3.txtemployer1.focus();

	      return (false);

  	  }

	  if(application3.txtjobtitle1.value.length==0)

  	  {

	      alert("Please enter Job Title!");

	      application3.txtjobtitle1.focus();

	      return (false);

  	  }

	   if(application3.txtreference1.value.length==0)

	  	  {

	      alert("Please enter Reference !");

	      application3.txtreference1.focus();

	      return (false);

  	  }

	  if(application3.startdate1.value.length==0)

	  	  {

	      alert("Please enter startdate !");

	      application3.startdate1.focus();

	      return (false);

  	  }

	  if(application3.enddate1.value.length==0)

  	  {

	      alert("Please enter enddate!");

	      application3.enddate1.focus();

	      return (false);

  	  }	 

	  if(application3.txtbphone1.value.length==0)

	   {

	      alert("Please enter Business Phone!");

	      application3.txtbphone1.focus();

	      return (false);

  	  }

	  if(application3.txtsalary1.value.length==0)

  	  {

	      alert("Please enter Salary!");

	      application3.txtsalary1.focus();

	      return (false);

	}

		   if(application3.adr1.value.length==0)

	   {

	      alert("Please enter Address!");

	      application3.adr1.focus();

	      return (false);

  	  }

	  if(application3.reson.value.length==0)

  	  {

	      alert("Please enter Reason for leaving!");

	      application3.reson.focus();

	      return (false);



  	  }

	  else 

	  {

  		

		//return true;

		postValues('application3','result','phpfiles/add_emp_details.php');

	  }

	

}

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);

  	  }	

	  var dt=document.formreq.txtstart

	  if (isDate(dt.value)==false){

		dt.focus()

		return false

		}

	  

	/*  if(formreq.txtstart.value == "00-00-0000")

	  {

		 alert("Please Select a Valid 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 select Executive!");

	      formreq.txtexecutive.focus();

	      return (false);

  	  }	 

	  if(formreq.txtrecuriter.value=="Select One")

	   {

	      alert("Please select 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()



{

	 postValues('addInterviewer','AddInter','phpfiles/addInterviewer.php');

	alert("Interviewers successfully added");

	

	 document.getElementById('addd1').style.display = "none";

		document.getElementById('addd').style.display = "none";

 

	return true;

	 	

}

/*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 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 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 showForms(hideDiv1,hideDiv2,hideDiv3,divID){

	document.getElementById(divID).style.display = "";	

	document.getElementById(hideDiv1).style.display = "none";	
	document.getElementById(hideDiv2).style.display = "none";	
	document.getElementById(hideDiv3).style.display = "none";	

}

	function postValues(formName,divID,url) {



		//alert(formName);		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/applicationUserCheck.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('userText').value = "";

			document.getElementById('userName').innerHTML = "<font color='red'>User already Existing</font>";

			

		}else {

			

			document.getElementById('userName').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();



return false;	

}

 

  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?requisition_id="+id;

	postValues("Application","resultID",url);

		

}









function UpdateDeny(id,div_id) {

	

	document.getElementById(div_id).innerHTML = "Denied";

	var  url = "phpfiles/setDeny.php?requisition_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;

    }
