  
var xmlHttp

function showCustomer(str)
{ 

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url=str ;
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("main_body").innerHTML=xmlHttp.responseText;

}
}
/*******************************************************************************************/
function changePassword(str)
{ 
	xmlHttp=GetXmlHttpObject();
	var url=str ;
	url=url+"?sid="+Math.random();
	xmlHttp.onreadystatechange =  function()
	{
		if( xmlHttp.readyState == 4)
			document.getElementById( 'sub_admin' ).innerHTML = xmlHttp.responseText
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
/***************************************************/
function jobs(url)
{
	document.getElementById( 'main_body' ).innerHTML = 'Please wait requested page is loading...'
	url = url + "&sid=" + Math.random()
	
	var http = getHTTPObject()
	http.open( "GET", url, true ) 
	http.onreadystatechange = function()
	{
		if( http.readyState == 4  )
			document.getElementById( 'main_body' ).innerHTML = http.responseText
	}
	http.send( null )
}

function nextPage(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url=str ;
	
	url = url+"&sid="+Math.random();
	
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4)
		{ 
			document.getElementById("next_job_page").innerHTML=xmlHttp.responseText;	
		}
	
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function detailJobs(url)
{
	document.getElementById( 'main_body' ).innerHTML = 'Please wait requested page is loading...'
	url = url + "&sid=" + Math.random()
	var http = GetXmlHttpObject()

	http.onreadystatechange = function()
	{
		if( http.readyState == 4  )
			document.getElementById( 'main_body' ).innerHTML = http.responseText
	}
	http.open( "GET", url, true ) 
	http.send( null )
}

function applyJobs(url)
{
	document.getElementById( 'main_body' ).innerHTML = 'Please wait requested page is loading...'
	url = url + "&sid=" + Math.random()
	
	var http = getHTTPObject()
	http.open( "GET", url, true ) 
	http.onreadystatechange = function()
	{
		if( http.readyState == 4  )
			document.getElementById( 'main_body' ).innerHTML = http.responseText
	}
	http.send( null )
}

function check_user(str)
{ 
	
	var user=document.getElementById('user_name').value;
	if(user=='')
	{
	alert("User name cant be blank");
	return false
	}
	//alert(user);
	xmlHttp=GetXmlHttpObject();
	var url=str ;
	url=url+"&user_name="+user+"&sid="+Math.random();
	xmlHttp.onreadystatechange =  function()
	{
		if( xmlHttp.readyState == 4)
			document.getElementById( 'check_field' ).innerHTML = xmlHttp.responseText
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function check_eamil()
{ 
	
	var mail=document.getElementById('email').value;
	
	
	xmlHttp=GetXmlHttpObject();
	var url="valid_mail.php?pahe=" ;
	url=url+"&email="+mail+"&sid="+Math.random();
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange =  function()
	{
		if( xmlHttp.readyState == 4 )
		{
			document.getElementById( 'email_error' ).innerHTML = xmlHttp.responseText
			if(xmlHttp.responseText!='')
			{
			document.getElementById('email').value=''
			}
		}
	}
	
		
	xmlHttp.send(null);

}

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 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 check()
{		

	var strError="";
	
	if(document.form1.old_password.value=='')
	 	 strError=strError+"\nOld Password Field";	 
	
	if(document.form1.new_password.value=='')
			 strError=strError+"\nNew Password Field";

	if(document.form1.verify_password.value=='')
			 strError=strError+"\nVerify Password Field";
	
	if(document.form1.new_password.value!=document.form1.verify_password.value)
		strError=strError+"\nPassword Does not Match in Two Field";
	
	if(strError!=""){
    	 alert("Check the missing fields:\n==========================\n"+strError);		 
	     return false;
	 }
     else
	  {
     	if(confirm("Are you sure want to change your password"))
				return true;
		else 
			return false
     }
}
function check_easy(str)
{

if(str.length<6)
{
alert("Password Length Should Be Greater Than 6")
document.form1.new_password.value='';
document.form1.new_password.focus;
return false;
}
if(str==document.form1.old_password.value)
{
alert("Old Password and New Password Are Same")
document.form1.new_password.value='';
document.form1.new_password.focus;
return false;
}
if(str=='123456' || str=='234567' ||str=='345678' )

{
alert("Please don't give the serial number for your password")
document.form1.new_password.value='';
document.form1.new_password.focus;
return false;
}

}