function makeRequest5(url, product_id) {
  var http_request = false;
  if (window.XMLHttpRequest) { // Mozilla, Safari,...
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType) {
      http_request.overrideMimeType('text/xml');
      // See note below about this line
    }
  } else if (window.ActiveXObject) { // IE
    try {
      http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {}
    }
  }
  if (!http_request) {
    alert('Giving up cannot create an XMLHTTP instance');
    return false;
  }
  http_request.onreadystatechange = function () {
    alertContents(http_request, product_id);
  };
  http_request.open('GET', url, true);
  http_request.send(null);
}
function alertContents(http_request, product_id) {
  var price;
  var text;
	var shaded;
  var vars = new Array();
  if (http_request.readyState == 4) {
    if (http_request.status == 200) {
      text = http_request.responseText;
      vars = text.split(':');
      price = parseInt(vars[0]);
      shaded = vars[1];
      if (shaded == 0 || shaded == "" || shaded == "0" || shaded == null) {
        shaded = "0";
      }
      try {
        document.getElementById('shaded').value = shaded;
        on_change_shades();
        check_global_constraints();
      } catch (e) {}
      if (price == 0 || price == "" || price == "0") {
        price = "N/A";
      }
      try {
        document.getElementById('base_price').value = price;
      } catch (e) {}
    } else {
      alert('There was a problem with the request. prices.js');
    }
  }
}
function get_width_height_fractions_price() {
	var product_id;
  var width;
  var height;
  var width_fraction;
  var height_fraction;
  var url_addr;
	width = document.getElementById('select_width').value;
  width_fraction = document.getElementById('select_width_frac').value;
  height = document.getElementById('select_height').value;
  height_fraction = document.getElementById('select_height_frac').value;
  product_id = document.getElementById('product_id').value;
	url_addr = "classes/get_product_price.php?product_id=" + product_id + "&width=" + width + "&height=" + height + "&wf=" + width_fraction + "&hf=" + height_fraction;
  makeRequest5(url_addr, product_id);
}
function my_get_price(product_id, mult) {
  var width;
  var height;
  var width_fraction;
  var height_fraction;
  var url_addr;
  width = document.getElementById('select_width').value;
  width_fraction = document.getElementById('select_width_frac').value;
  height = document.getElementById('select_height').value;
  height_fraction = document.getElementById('select_height_frac').value;
  url_addr = "classes/get_product_price.php?product_id=" + product_id + "&width=" + width + "&height=" + height + "&wf=" + width_fraction + "&hf=" + height_fraction;
  document.write(url_addr);
  makeRequest(url_addr);
}
