//	This makes a soap call to bongo to get the estimated shipping cost on a particular product.  
//	This is for the product detail page.
//	bongo_key is set in /application.cfm	

    function getBongoRate() {
        // Create the ajax proxy instance.
        var B_rate = new bongomethods;
        // setForm() implicitly passes the form fields to the CFC function.
		B_rate.setForm("PSB_Bongo");
        //Call the CFC validateCredentials function.
		var ws=B_rate.GetSingleRate();
		if (ws.COUNTRY !="" && ws.RATE !="") {
			var setselectedcountry=document.getElementById("bongocountryflag");
			setselectedcountry.value=ws.COUNTRY;
			setselectedcountry.checked=false;
			
			var msg=document.getElementById("bongo_rate_data");
            if (ws.COUNTRY.length < 12) {
				msg.innerHTML = '' +"<b>" + ws.COUNTRY + ":</b> " + ws.RATE + " USD";
			}
			else{
				msg.innerHTML = '' +"<b>" + ws.COUNTRY + ":</b><br>" + ws.RATE + " USD";
			}
			document.getElementById("bongo_quote_disclaimer").style.display="block";
			document.getElementById("bongo_country_saved").style.display="none";	
			document.getElementById("bongo_remember_form").style.display="block";
			document.getElementById("bongo_rate_data_session").style.display="none";						
		} else {
            document.getElementById("bongo_rate_data").innerHTML = "<font color='red'><b>International quotes are unavailable at this time.</b></font>";
        }
    }

    function putBongoCountry() {
			// Create the ajax proxy instance.
			var B_country = new bongomethods;
			// setForm() implicitly passes the form fields to the CFC function.
			B_country.setForm("Bongo_Flag");
			//Call the CFC validateCredentials function.
			var ws = B_country.PutBongoCountry();
			document.getElementById("bongo_country_saved").style.display="block";
			document.getElementById("bongo_remember_form").style.display="none";
			document.getElementById("bongo_rate_data_session").style.display="none";
			document.getElementById("bongo_quote_disclaimer").style.display="none";					
    }