function getShippingCost(nServiceID, nTotal, nExVAT){
  //get variables to use - weight, value, country, service
  var wgt = document.getElementById("weight").value;
  var val = document.getElementById("val").value;
  var quantity = document.getElementById("quantity").value;
  var el = document.getElementById("shippingCountry");
  var country = el.options[el.selectedIndex].value;
  //show field as calculating
  document.getElementById("delivery_charge").innerHTML = "calculating...";
  var url = "/cart/includes/calculate_shipping.php?w="+wgt+"&v="+val+"&q="+quantity+"&c="+country+"&s="+nServiceID+"&t="+nTotal+"&x="+nExVAT;
  var xmlhttp=false; //Clear our fetching variable
  try {
    xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
  }
  xmlhttp.open('GET', url, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
  xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
      var content = xmlhttp.responseText; //The content data which has been retrieved ***
      if( content ){ //Make sure there is something in the content variable
        document.getElementById("delivery_charge").innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
      }
    }
  }
  xmlhttp.send(null) //Nullify the XMLHttpRequest
}// JavaScript Document




function showNewPrice(nID, pID){
  var url = "../functions/get_price.php?id="+nID;
  var xmlhttp=false; //Clear our fetching variable
  try {
    xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
  }
  xmlhttp.open('GET', url, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
  xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
      var content = xmlhttp.responseText; //The content data which has been retrieved ***
      if( content ){ //Make sure there is something in the content variable
        document.getElementById("show_price").innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
      }
    }
  }
  xmlhttp.send(null) //Nullify the XMLHttpRequest
}



    function reloadList(lstToLoad, curIndex) { // pass in the current index
      if ( curIndex < 0 ) return;  // nothing selected, so do nothing
      //document.forms['checkout'].destination.value = document.forms['checkout'].shippingCountry.options[document.forms['checkout'].shippingCountry.selectedIndex].text;
      var lst = document.getElementById(lstToLoad);
      var master = document.getElementById('master').options;
      var aryOptions = lst.options;  // points to list options array
      aryOptions.length=0;  // first, clear the current options ...
      //add in the '(select service)' option
      aryOptions.length++;  // add a new Option, then put data in it
      aryOptions[aryOptions.length-1].text  = "(Select Service)";
      aryOptions[aryOptions.length-1].value = "";
      // then re-load the options with values for the current index
      for ( var i=0,n=master.length; i<n; i++ ){
        if (master[i].value == curIndex){
          var optionText = master[i].text;
          var aryText = optionText.split('|');      
          aryOptions.length++;  // add a new Option, then put data in it
          aryOptions[aryOptions.length-1].text  = aryText[1];
          aryOptions[aryOptions.length-1].value = aryText[0];
        }
      }
    }
