function getShippingCost(nServiceID, nTotal, nMethod, nPostcode) {
  //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 country = document.getElementById("shippingCountry").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+"&m="+nMethod+"&p="+nPostcode;
  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 = "/includes/functions/get-price.php?id="+ nID +"&p="+ pID;

	var xmlhttp=false;

	try {

		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');

	} catch (e) {

		try {

			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');

		} catch (E) {

			xmlhttp = false;

		}

	}

	if(!xmlhttp && typeof XMLHttpRequest != 'undefined') {

		xmlhttp = new XMLHttpRequest();

	}

	xmlhttp.open('GET', url, true);

	xmlhttp.onreadystatechange = function() {

		if(xmlhttp.readyState == 4) {

			var content = xmlhttp.responseText;

			if(content) {

				document.getElementById("product-price").innerHTML = content;

			}

		}

	}

	xmlhttp.send(null);
	
	showDiscountPrice(nID, pID);

}



function showDiscountPrice(nID, pID) {

	var url = "/includes/functions/get-price.php?id="+ nID +"&p="+ pID +"&discount=true";

	var xmlhttp=false;

	try {

		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');

	} catch (e) {

		try {

			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');

		} catch (E) {

			xmlhttp = false;

		}

	}

	if(!xmlhttp && typeof XMLHttpRequest != 'undefined') {

		xmlhttp = new XMLHttpRequest();

	}

	xmlhttp.open('GET', url, true);

	xmlhttp.onreadystatechange = function() {

		if(xmlhttp.readyState == 4) {

			var content = xmlhttp.responseText;

			if(content) {

				document.getElementById("your-product-price").innerHTML = content;

			}

		}

	}

	xmlhttp.send(null);

}