var xmlhttp
var a=window.location;


var ad="http://www.thuexetructuyen.com/";
function GetXmlHttpObject()////creat doi tuong ajax
{
if (window.XMLHttpRequest)
  {
  
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
///////////////////////////////////////////
function gethuyenfrom(id)
{

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=ad+"modules.php?name=BookOnline&opcase=returntp";
url=url+"&id="+id;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
  {
      
      document.getElementById("begin_city").innerHTML=xmlhttp.responseText;
      
  }
}
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////

function gethuyento(id)
{

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=ad+"modules.php?name=BookOnline&opcase=returntpto";
url=url+"&id="+id;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=getidtofill;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function getidtofill()
{
if (xmlhttp.readyState==4)
  {
      
      document.getElementById("end_city").innerHTML=xmlhttp.responseText;
      
  }
}
/////
function viewdetail(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=ad+"modules.php?name=Menu";
url=url+"&id="+str;
url=url+"&opcase=detailmenu";
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=showmenuchange;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
/////


function showdetailcontent(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=ad+"modules.php?name=Content";
url=url+"&id="+str;
url=url+"&opcase=detailcontent";
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=showcontentchange;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function showcontentchange()
{
if (xmlhttp.readyState==4)
  {
  //alert(xmlhttp.responseText);
      var arr=xmlhttp.responseText.split("<endbreak>");
      document.getElementById("contentdchang").innerHTML=arr[0];
      document.getElementById("imagecontent").innerHTML=arr[1];
  }
}
function re()
{
history.go();
}


//////
function showjob(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=ad+"modules.php?name=Job&opcase=detailcontent";
url=url+"&id="+str;
url=url+"&sid="+Math.random();
//alert(url);
xmlhttp.onreadystatechange=statejob;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function statejob()
{
if (xmlhttp.readyState==4)
  {
      //var arr=xmlhttp.responseText.split("<lock>");
      document.getElementById("jobscontent").innerHTML=xmlhttp.responseText
      //document.getElementById("imgnew").innerHTML=arr[1];
  }
}