   function makeRequest5(url,with_sign,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,with_sign,product_id); };
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents(http_request,with_sign,product_id) {
		
    	   var Price;
        var Text,Shaded;
        var vars = new Array();
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
            		
            		Text = http_request.responseText;
            		vars = Text.split(':');
            		Price = vars[0];
            		Shaded = vars[1];
            	//	alert(Shaded);
          /*      
                if(document.getElementById('base_price')) {
                    var quantity = parseInt(document.getElementById('Quantity').options[document.getElementById('Quantity').selectedIndex].value);
                    if (quantity < 0 || quantity == 0 || quantity == "") {
                        quantity = 1;
                    }
                    
                    document.getElementById('base_price').value = parseInt(Price/quantity);
                }
*/
               	
				if (Shaded == 0 || Shaded == "" || Shaded == "0" || Shaded == null) {
               		Shaded = "0";
				}
				try {
					document.getElementById('shaded').value =Shaded;
					on_change_shades();
					check_global_constraints();
				} catch(e) {
					
				}
				Price = parseInt(Price);	
				if (with_sign == true) {
					if (Price == 0 || Price == "" || Price == "0" ) {
               			Price = "N/A";
               			try {
               				document.getElementById('product_price').value = Price;
               			} catch(e) {
               				
               			}
					} else {
						try {
               				document.getElementById('product_price').value = "$" + Price;
						} catch(e) {
							
						}
					}
				} else {
					if (Price == 0 || Price == "" || Price == "0" ) {
               			Price = "N/A";
					}
					try {
						document.getElementById('product_price').value = Price;
					}	catch(e) {
						
					}
				}
				
				//set_all_prices(product_id);
                //	alert(document.getElementById('quote').value);
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
    
/*    
    function get_price(product_id,mult,with_sign,account_id) {
    		var width;
    		var height;
    		var width_fraction;
    		var height_fraction;
    		var url_addr;
    		var quantity;
    			
    		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;
    		try {
    			 quantity = parseInt(document.getElementById('Quantity').options[document.getElementById('Quantity').selectedIndex].value);
	 		if (quantity < 0 || quantity == 0 || quantity == "") {
	 			quantity = 1;
	 		}
    		}	catch(e) {
    			quantity = 1;
    		}
    		url_addr = "/get_product_price.php?pid=" + product_id  + "&width=" + width +  "&qu=" + quantity + "&height=" + height + "&wf=" + width_fraction + "&hf=" + height_fraction + "&ac=" + account_id ;
    		makeRequest5(url_addr,with_sign,product_id);
    		
    			
    }
*/
function get_price(product_id,option_id,with_sign,account_id) {
    
    var width;
    var height;
    var width_fraction;
    var height_fraction;
    var url_addr;
    var quantity;

//    width = parseInt(document.getElementById('select_width').value);
//    width_fraction = parseFloat(document.getElementById('select_width_frac').value);
    height = parseInt(document.getElementById('select_height').value);
    height_fraction = parseFloat(document.getElementById('select_height_frac').value);
    
    var headrail = document.getElementById('headrail').value;
    var stack = document.getElementById('stack').value;
    
    switch(headrail) {
        case "1":
            width = parseInt(document.getElementById('select_width').value);
            width_fraction = parseFloat(document.getElementById('select_width_frac').value);
            break;
        case "2":
            width_1 = parseInt(document.getElementById('width_left').value);
            width_fraction_1 = parseFloat(document.getElementById('width_frac_left').value);
            width_2 = parseInt(document.getElementById('width_right').value);
            width_fraction_2 = parseFloat(document.getElementById('width_frac_right').value);
            width_3 = 0;
            width_fraction_3 = 0;
            break;
        case "3":
            width_1 = parseInt(document.getElementById('width_left').value);
            width_fraction_1 = parseFloat(document.getElementById('width_frac_left').value);
            width_2 = parseInt(document.getElementById('width_center').value);
            width_fraction_2 = parseFloat(document.getElementById('width_frac_center').value);
            width_3 = parseInt(document.getElementById('width_right').value);
            width_fraction_3 = parseFloat(document.getElementById('width_frac_right').value);
            break;
    }
    try {
         quantity = parseInt(document.getElementById('Quantity').options[document.getElementById('Quantity').selectedIndex].value);
         if (quantity < 0 || quantity == 0 || quantity == "") {
             quantity = 1;
         }
    }
    catch(e) {
        quantity = 1;
    }

    if (stack == "Split-Draw") {
        width = parseInt(document.getElementById('select_width').value)/2;
        width_fraction = parseFloat(document.getElementById('select_width_frac').value)/2;
        quantity = 2;
    }
    
    if (headrail != "1") {
        url_addr = "/get_product_price.php?pid=" + product_id + "&qu=" + quantity  + "&width_1=" + width_1 + "&wf_1=" + width_fraction_1  + "&width_2=" + width_2 + "&wf_2=" + width_fraction_2  + "&width_3=" + width_3 + "&wf_3=" + width_fraction_3 + "&height=" + height + "&hf=" + height_fraction + "&ac=" + account_id  + "&headrail=" + headrail;
    }
    else {
        url_addr = "/get_product_price.php?pid=" + product_id  + "&width=" + width +  "&qu=" + quantity + "&height=" + height + "&wf=" + width_fraction + "&hf=" + height_fraction + "&ac=" + account_id;
    }
    
    makeRequest5(url_addr,with_sign,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 = "/get_product_price.php?pid=" + product_id  + "&width=" + width + "&height=" + height + "&wf=" + width_fraction + "&hf=" + height_fraction;

            document.write(url_addr);

    		makeRequest(url_addr);

    		

    			

    }
