var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
}

function UpdateCity(val,div,url) {
  
  http.abort();
  http.open("GET", url + "/ajax.php?type=city&countryid=" + val, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(div).innerHTML = http.responseText;
    }
  }
  http.send(null);
}

function UpdateAccompanying(val,div,url) {
  
  http.abort();
  http.open("GET", url + "/ajax.php?type=accompanying&jml=" + val, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(div).innerHTML = http.responseText;
    }
  }
  http.send(null);
}

function UpdateAccompanying2(val,div,url) {
  
  http.abort();
  http.open("GET", url + "/ajax.php?type=accompanying2" , true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(div).innerHTML = http.responseText;
    }
  }
  http.send(null);
}

function UpdateRoom(val,div,url) {
  
  http.abort();
  http.open("GET", url + "/ajax.php?type=room&id=" + val , true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(div).innerHTML = http.responseText;
    }
  }
  http.send(null);
}

function CheckPayment(id){
  if(id==7){
    alert('milih ' + id);
  }else{
    alert('milih ' + id + ' ye');
  }
}