
function getNext(header, type) {
	var url = type+".php?page="+header+"&type="+type;
	window.location = url;
}


function doCountry(ctry){
  document.getElementById('country_code').value = ctry;
  document.getElementById('country').style.display = 'none';
  document.getElementById('agegate').innerHTML = '';
  document.getElementById('agegate').style.display = 'block';
	var url = "./includes/getagetxt_change.php?id="+ctry;
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Browser does not support HTTP Request")
    return
  }
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function(){ callback('agegate') };
	xmlHttp.send(null);
}

function callback(objn)
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
	  var ranDigit = Math.floor(Math.random()*3);
		getObject(objn).innerHTML=xmlHttp.responseText;
		if(objn == 'revise')
		  ScrollLoad();
  }
}

function getObject(obj) {
	var o;
	if(document.getElementById) o = document.getElementById(obj);
	else if(document.all) o = document.all.obj;
	return o;
}

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