// JavaScript Document
function GetXmlHttpObject()
{
var xmlHttp=null;try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

function usercheck(pid)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="usercheck.php";
url=url+"?q="+pid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.send(null);
	
}

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("usercheckmsg").innerHTML=xmlHttp.responseText;

 } 
}
function employercheck(pid)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="employercheck.php";
url=url+"?q="+pid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=employerstateChanged;
xmlHttp.send(null);
	
}

function employerstateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("usercheckmsg").innerHTML=xmlHttp.responseText;

 } 
}

function getFormData(infoid)
{
	
	xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="getFormData.php";
url=url+"?q="+infoid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedGetFormGrid;
xmlHttp.send(null);

}


function makePOSTRequest(url, parameters)
{
	xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 

xmlHttp.open('POST', url, true); 
xmlHttp.onreadystatechange=stateChangedSetsignForm;
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", parameters.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(parameters);
}


function stateChangedSetsignForm() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("myform_errorloc").innerHTML=xmlHttp.responseText;

 } 
}
//serach

function getSearchValues()

{
	var keycan=document.getElementById('keycan').value;
	var exper=document.getElementById('exper').value;
	var rate=document.getElementById('rate').value;
	
	
	xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="search.php";
url=url+"?ex="+exper+"&rat="+rate+"&keycan="+keycan;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedsearch;
xmlHttp.send(null);
	
}
function stateChangedsearch() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("searchresult").innerHTML=xmlHttp.responseText;

 } 
}
//search_load
function getSearchLoad()

{
	
	
	xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="search_load.php";
//url=url+"?ex="+exper+"&rat="+rate;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedsearchload;
xmlHttp.send(null);
	
}
function stateChangedsearchload() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("searchresult").innerHTML=xmlHttp.responseText;

 } 
}

//login checking
function loginCheck()

{
	var login=document.getElementById('login').value;
	var pass=document.getElementById('loginpass').value;
	
	xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="login_check.php";
url=url+"?login="+login+"&pass="+pass;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedlogin;
xmlHttp.send(null);
	
}
function stateChangedlogin() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("loginform_errorloc").innerHTML=xmlHttp.responseText;

 } 
}
// candidates search
function usersearch(pid)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
 
var url="usersearch.php";
url=url+"?q="+pid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedusersearch;
xmlHttp.send(null);
	
}

function stateChangedusersearch() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("profile").innerHTML=xmlHttp.responseText;

 } 
}
// employer search
function empsearch(pid)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
 
var url="empsearch.php";
url=url+"?q="+pid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedempsearch;
xmlHttp.send(null);
	
}

function stateChangedempsearch() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("profile").innerHTML=xmlHttp.responseText;

 } 
}
// store id in session

function getuserinfo(pid)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
var url="saveuserinfo.php";
url=url+"?q="+pid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedusersearchinfo;
xmlHttp.send(null);
	
}

function stateChangedusersearchinfo() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 
 document.getElementById("test1").innerHTML=xmlHttp.responseText;
 } 
}
//request resume
function requestsearch(pid)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 } 
 
var url="request_search.php";
url=url+"?q="+pid;

xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedrequestsearch;
xmlHttp.send(null);
	
}

function stateChangedrequestsearch() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("profile").innerHTML=xmlHttp.responseText;

 } 
}