
  var lastShippingCalculationsUpdate = 0;
  var cookieZipCode = Cookie.read("austinShippingZipCode:31995");
  var buyerZipCode = "";
  var cookieCanadaPostalCode = Cookie.read("austinCanadaPostalCode:31995");
  var cookieOtherPostalCode = Cookie.read("austinOtherPostalCode:31995");
  var buyerCanadaPostalCode = "";
  var buyerOtherPostalCode = "";
  var cookieCountry = Cookie.read("austinShippingCountry:31995");
  var buyerCountry = "";
  var cookieAddressType = Cookie.read("austinShippingAddressType:31995");
  var buyerAddressType = "";
  var zipCode = null;
  var canadaPostalCode = null;
  var otherPostalCode = null;
  var country = "110";
  var addressType = "1";
  var options = null;
  var forCart = false;
  var upsRateDisclaimer = null;
  var selectedCarrier = null;
  var cheapestRateFound = -1;
  var handlingFee = "";
  if (cookieZipCode && cookieZipCode != '') {
    zipCode = cookieZipCode;
  } else if (buyerZipCode && buyerZipCode != '') {
    zipCode = buyerZipCode;
  }
  if (cookieCanadaPostalCode && cookieCanadaPostalCode != '') {
    canadaPostalCode = cookieCanadaPostalCode;
  } else if (buyerCanadaPostalCode && buyerCanadaPostalCode != '') {
    canadaPostalCode = buyerCanadaPostalCode;
  }
  if (cookieOtherPostalCode && cookieOtherPostalCode != '') {
    otherPostalCode = cookieOtherPostalCode;
  } else if (buyerOtherPostalCode && buyerOtherPostalCode != '') {
    otherPostalCode = buyerOtherPostalCode;
  }
  if (cookieCountry && cookieCountry != '') {
    country = cookieCountry;
  } else if (buyerCountry && buyerCountry != '') {
    country = buyerCountry;
  }
  if (cookieAddressType && cookieAddressType != '') {
    addressType = cookieAddressType;
  } else if (buyerAddressType && buyerAddressType != '') {
    addressType = buyerAddressType;
  }
  if (!(forCart && !dataIsReadyToCalculate())) {
    showInitial();
    checkForShippingCalculations();
  } else {
    hideCartInitial();
  }
  function showInitial() {
    showZipPostalCode();
    showCountryDisplay(country,true);
    showAddressTypeDisplay(addressType,true);
    showZipPostalCodeLabel();
    if (!forCart) {
      showQuantityDisplay(true);
    } else {
      showCartInitial();
    }
  }
  function hideCartInitial() {
    setDivWithHtmlContent("cartShippingCalculatorTitle","");
    setDivWithHtmlContent("cartShippingCalculatorCountryLabel","");
    setDivWithHtmlContent("cartShippingCalculatorAddressTypeLabel","");
  }
  function showCartInitial() {
    setDivWithHtmlContent("cartShippingCalculatorTitle","<div class='shippingOptionsMainLabel'>Shipping Options and Rates</div>");
    setDivWithHtmlContent("cartShippingCalculatorCountryLabel","Country:");
    setDivWithHtmlContent("cartShippingCalculatorAddressTypeLabel","Address Type:");
  }
  function checkForShippingCalculations() {
    if (dataIsReadyToCalculate()) {
      getAndShowShippingCalculations();
    }
  }
  function dataIsReadyToCalculate() {
    var showShippingCalculations = false;
    if (country && country != '') {
      if (country == '110') {
        if (zipCode  && zipCode != '') {
          showShippingCalculations = true;
        }
      } else if (country == '111') {
        if (canadaPostalCode  && canadaPostalCode != '') {
          showShippingCalculations = true;
        }
      } else {
        showShippingCalculations = true;
      }
    }
    return showShippingCalculations;
  }
  function getProductParamsAppend() {
    var productAppend = "&vpid1=5681028&vpid1_qty="+getQuantityOrOne()+"";
    return productAppend;
  }
  function getValue(div) {
    return $(div).get("value");
  }
  function getAndShowShippingCalculations() {
    var params = "&isAjax=true&vendor_id=31995&vcid="+country+"&addresstype="+addressType+getProductParamsAppend();
    if (country == "110") {
      params += "&zipcode="+zipCode;
    } else if (country == "111") {
      params += "&postalcode="+canadaPostalCode;
    } else if (otherPostalCode) {
      params += "&otherpostalcode="+otherPostalCode;
    }
    updateCalculating();
    callServer(updateShippingCalculations, params, "Shipping");
  }
  function updateCalculating() {
    setDivWithHtmlContent("shippingMsgDiv","<table id='shippingLoaderMessage'><tr><td><img src='https://app.infopia.com/optimizedsf/images/shipping-calculator-loader.gif' /></td><td>Calculating...</td></tr></table>");
    setDivWithHtmlContent("shippingDestinationDiv","");
    setDivWithHtmlContent("shippingCalculationsDiv","");
    setDivWithHtmlContent("shippingCarrierSelectDiv","");
    setDivWithHtmlContent("shippingHandlingFeeDiv","");
    setDivWithHtmlContent("shippingCarrierLogoDiv","");
  }
  function updateShippingCalculations(responseXML) {
    // Get the root "cart" element from the document
    var shippingCalculations = getShippingCalculationsFromResponseXML(responseXML);
    if (shippingCalculationsOk(shippingCalculations)) {
      var destination = shippingCalculations.getAttribute("destination");
      upsRateDisclaimer = shippingCalculations.getAttribute("upsRateDisclaimer");
      handlingFee = shippingCalculations.getAttribute("handlingFee");
      if (destination != null && destination != "") {
        var availableStr = "Available Shipping ";
        setDivWithHtmlContent("shippingDestinationDiv","<div id='shippingDestinationDivInner'></div>");
        setDivWithHtmlContent("shippingDestinationDivInner",availableStr+destination+":");
      }  
      if (handlingFee && handlingFee != '') {
      	setDivWithHtmlContent("shippingHandlingFeeDiv","<div id='shippingHandlingFeeDivInner'></div>");
        setDivWithHtmlContent("shippingHandlingFeeDivInner","<table cellpadding='2' id='shippingHandlingFeeDivMessage'><tr><td>Handling Fee</td><td>"+handlingFee+"</td></tr></table>");
      }
      options = getOptionsFromResponseXML(responseXML);
      showOptions(true);
    }
  }
  function updateSubtotal() {
    if (cheapestRateFound > -1) {
      if (handlingFee && handlingFee != '') {
        cheapestRateFound = parseFloat(cheapestRateFound) + parseFloat(handlingFee.substring(1));
      }
      var subtotalDisplay = "$"+currencyFormatted(cheapestRateFound);
      if (cheapestRateFound == 0) {
        subtotalDisplay = "FREE";
      }
      setDivWithHtmlContent("cartShippingAndHandlingContainer",subtotalDisplay);
    }
  }
  function currencyFormatted(amount) {
    var i = parseFloat(amount);
    if(isNaN(i)) { i = 0.00; }
    var minus = '';
    if(i < 0) { minus = '-'; }
    i = Math.abs(i);
    i = parseInt((i + .005) * 100);
    i = i / 100;
    s = new String(i);
    if(s.indexOf('.') < 0) { s += '.00'; }
    if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
    s = minus + s;
    return s;
  }
  function showCarrierLogo() {
    if (selectedCarrier == 'UPS') {
      setDivWithHtmlContent("shippingCarrierLogoDiv","<div id='shippingCarrierLogoDivInner'></div>");
      setDivWithHtmlContent("shippingCarrierLogoDivInner",upsRateDisclaimer);      
    } else if (selectedCarrier == 'USPS') {
      setDivWithHtmlContent("shippingCarrierLogoDiv","<div id='shippingCarrierLogoDivInner'></div>");
      setDivWithHtmlContent("shippingCarrierLogoDivInner","<table><tr><td><img src='https://app.infopia.com/optimizedsf/images/usps_logo.gif' /></td></tr></table>");  
    } else if (selectedCarrier == 'FED-EX') {
      setDivWithHtmlContent("shippingCarrierLogoDiv","<div id='shippingCarrierLogoDivInner'></div>");
      setDivWithHtmlContent("shippingCarrierLogoDivInner","<table><tr><td><img src='https://app.infopia.com/optimizedsf/images/fedex_logo.gif' /></td></tr></table>");
    } else {
      setDivWithHtmlContent("shippingCarrierLogoDivInner","");
    }
  }
  function showOptions(doShowCarrierSelect,carrier) {
    if (doShowCarrierSelect) {
      showCarrierSelect();
    }  
    showRates(carrier);
    if (carrier && carrier != '') {
      selectedCarrier = carrier;
    }
    if (country != '110' && country != '111') {
      if (!otherPostalCode) {
        showOtherPostalCodeInput();
      }
    }
    showCarrierLogo();
  }
  function showCarrierSelect() {
    if (options) {
      showCarrierSelectTable();
    }
  }
  function showNoRatesFound() {
    $("shippingCalculationsDiv").set("html","No rates found.");
  }
  function showRates(carrier) {
    if (options && options.length > 0) {
      setDivWithHtmlContent("shippingCalculationsDiv","<div id='shippingCalculationsDivInner'></div>");
      setDivWithHtmlContent("shippingCalculationsDivInner",getRatesTable(carrier));
      if (forCart) {
        updateSubtotal();
      }  
    } else {
      showNoRatesFound();
    }
  }
  function getRatesTable(carrier) {
    var ratesTable = "<table cellpadding='2'>";
    var i = 0;    
    var filteredOptions = getOptionsForCarrier(carrier);
    for (i = 0; i < filteredOptions.length; i++) {
      var option = filteredOptions[i];
      var nextCarrier = option.getAttribute("carrier");
      var type = option.getAttribute("type");
      var price = option.getAttribute("price");
      if (i == 0) {
        cheapestRateFound = price.substring(1);
      }
      var firstLastCarrierLabelClass = "";
      var firstLastRateLabelClass = "";
      if (i == 0) {
        firstLastCarrierLabelClass = " carrierLabelFirst";
        firstLastRateLabelClass = " carrierRateFirst";
      } else if (i == options.length -1) {
        firstLastCarrierLabelClass = " carrierLabelLast";
        firstLastRateLabelClass = " carrierRateLast";
      }
      var oddEvenCarrierLabelClass = "";
      var oddEvenRateLabelClass = "";
      if (i % 2 == 0) {
        oddEvenCarrierLabelClass = " carrierLabelEven";
        oddEvenRateLabelClass = " carrierRateEven";
      } else {
        oddEvenCarrierLabelClass = " carrierLabelOdd";
        oddEvenRateLabelClass = " carrierRateOdd";
      }
      ratesTable += "<tr>";
      ratesTable += "<td class='carrierLabel"+firstLastCarrierLabelClass+oddEvenCarrierLabelClass+"'>";
      ratesTable += nextCarrier+" ";
      ratesTable += type;
      ratesTable += "</td>";
      ratesTable += "<td class='rateLabel"+firstLastRateLabelClass+oddEvenRateLabelClass+"'>";
      if (price == "$0.00") {
        ratesTable += "<b>FREE</b>";
      } else {
        ratesTable += price;
      }  
      ratesTable += "</td>";
      ratesTable += "</tr>";
    }
    ratesTable += "</table>";
    return ratesTable;
  }
  function getOptionsForCarrier(carrier) {
    var filteredOptions = new Array();
    var curCarrier = getCurrentCarrier();
    if (carrier && carrier != '') {
      curCarrier = carrier;
    }
    var ind = 0;
    for (i = 0; i < options.length; i++) {
      var option = options[i];
      var nextCarrier = option.getAttribute("carrier");
      if (curCarrier == "" || nextCarrier == curCarrier) {
        filteredOptions[ind++] = option;
      }
    }
    return filteredOptions;
  }
  function showCarrierSelectTable() {
    var carrierSelect = "<div id='carrierMessage'>Please select a Carrier to view Shipping Options:</div>";
    carrierSelect += "<table>";
    carrierSelect += "<tr>";
    carrierSelect += "<td>";
    var curCarrier = getCurrentCarrier();
    var i = 0;
    var carriersFound = new Object();
    for (i = 0; i < options.length; i++) {
      var option = options[i];
      var carrier = option.getAttribute("carrier");
      if (carriersFound[carrier] == null) {
        var checked = "";
        if (curCarrier == carrier || (i == 0 && curCarrier == "")) {
          checked = " checked";
          selectedCarrier = carrier;
        }
        var carrierInput = "<input type='radio' id='carrier' name='carrier' onClick=\"showOptions(false,'"+carrier+"')\" value='"+carrier+"'"+checked+"> "+carrier+"<br>";
        carrierSelect += carrierInput;
        carriersFound[carrier] = "1";
      }
    }
    carrierSelect += "</td>";
    carrierSelect += "</tr>";
    carrierSelect += "</table>";
    setDivWithHtmlContent("shippingCarrierSelectDiv",carrierSelect);
  }
  function getCurrentCarrier() {
    var curCarrier = "";
    if ($("carrier")) {
      curCarrier = $("carrier").get("value");
    }
    return curCarrier;
  }  
  function getOptionsFromResponseXML(responseXML) {
    return responseXML.getElementsByTagName("option")
  }
  function getShippingCalculationsFromResponseXML(responseXML) {
    return responseXML.getElementsByTagName("shippingCalculations")[0];
  }
  function shippingCalculationsOk(shippingCalculations) {
    if (shippingCalculations != null) {
      // Check that a more recent objec document hasn't been processed
      // already
      var generated = shippingCalculations.getAttribute("generated");
      if (generated > lastShippingCalculationsUpdate) {
        var message = shippingCalculations.getAttribute("message");
        setDivWithHtmlContent("shippingMsgDiv",message);
        lastShippingCalculationsUpdate = generated;    
        return true;
      }
    }
    return false;
  }
  function showZipPostalCodeLabel() {
    if (country == '110') {
      $("shippingZipPostalCode").set("html","Zip Code:");
    } else if (country == '111') {
      $("shippingZipPostalCode").set("html","Postal Code:");
    } else {
      $("shippingZipPostalCode").set("html","Postal Code:");
    }
  }
  function showZipPostalCode() {
    if (country == '110') {
      if (zipCode) {
        showZipCodeDisplay(zipCode,true);
      } else {
        showZipCodeInput();
      }
    } else if (country == '111') {
      if (canadaPostalCode) {
        showCanadaPostalCodeDisplay(canadaPostalCode,true);
      } else {
        showCanadaPostalCodeInput();
      }
    } else {
      if (otherPostalCode) {
        showOtherPostalCodeDisplay(otherPostalCode,true);
      } else {
        showOtherPostalCodeInput();
      }
    }
  }
  function showZipCodeInput() {
    var currentZipCode = '';
    if (cookieZipCode && cookieZipCode != '') {
      currentZipCode = cookieZipCode;
    } else if (buyerZipCode && buyerZipCode != '') {
      currentZipCode = buyerZipCode;
    } else {
      setInitialZipPostalCodeMsg("Zip Code");
    }
    var zipCodeInput = "<input type='textbox' name='austinShippingZipCode' id='austinShippingZipCode' value='"+currentZipCode+"' size='6' maxlength='5'>";
    showInput("shippingZipPostalCodeDiv",zipCodeInput,"saveZipCode");
  }
  function setInitialZipPostalCodeMsg(zipPostalCodeLabel) {
    var msg = "Enter your "+zipPostalCodeLabel+" and click Save to see shipping rates.";
    if (true) {
      msg = "Enter your "+zipPostalCodeLabel+" and click Save to see shipping rates, or click to change the Country.";
    }
    $("shippingZipPostalCodeMsg").set("html","<font size='1'>"+msg+"</font>");
  }
  function getQuantityOrOne() {
    var quantity = "1";
    if ($("quantity") && $("quantity") != '') {
      quantity = $("quantity").get("value");
    }
    return quantity;
  }
  function showQuantityDisplayAndRecalculate() {
    showQuantityDisplay();
    checkForShippingCalculations();
  }
  function showQuantityInput() {
    var currentQuantity = getQuantityOrOne();
    var quantityCodeInput = "<input type='textbox' name='austinShippingQuantity' id='austinShippingQuantity' value='"+currentQuantity+"' size='4' maxlength='4'>";
    showInput("shippingQuantityDiv",quantityCodeInput,"saveQuantity");
  }
  function saveQuantity() {
    var newQuantity = $("austinShippingQuantity").get("value");
    if (newQuantity == "") {
      alert("You must enter quantity.");
      return;
    }
    $("quantity").set("value",newQuantity);
    showQuantityDisplay(true);
    checkForShippingCalculations();
  }
  function showQuantityDisplay(showChangeLink) {
    var quantity = getQuantityOrOne();
    if ($("shippingQuantityDiv")) {
      showDisplay("shippingQuantityDiv",quantity,"showQuantityInput",showChangeLink);
    }
  }
  function focusOnQuantity() {
    $("quantity").focus();
  }
  function showZipCodeDisplay(currentZipCode,showChangeLink) {
    showDisplay("shippingZipPostalCodeDiv",currentZipCode,"showZipCodeInput",showChangeLink);
  }
  function saveZipCode() {
    var newZipCode = $("austinShippingZipCode").get("value");
    if (newZipCode == "") {
      alert("You must enter zip code.");
      return;
    }
    if (country == '110' && (newZipCode.length != 5 || !isNumeric(newZipCode))) {
      alert("You must enter a 5 digit number for the zip code.");
      return;
    }
    writeCookie('austinShippingZipCode:31995', newZipCode);
    cookieZipCode = newZipCode;
    zipCode = newZipCode;
    showZipCodeDisplay(newZipCode,true);
    $("shippingZipPostalCodeMsg").set("html","");
    checkForShippingCalculations();
  }
  function showCanadaPostalCodeInput() {
    var currentCanadaPostalCode = '';
    if (cookieCanadaPostalCode && cookieCanadaPostalCode != '') {
      currentCanadaPostalCode = cookieCanadaPostalCode;
    } else if (buyerCanadaPostalCode && buyerCanadaPostalCode != '') {
      currentCanadaPostalCode = buyerCanadaPostalCode;
    } else {
      setInitialZipPostalCodeMsg("Postal Code");
    }
    var canadaPostalCodeInput = "<input type='textbox' name='austinCanadaPostalCode' id='austinCanadaPostalCode' value='"+currentCanadaPostalCode+"' size='8' maxlength='7'>";
    showInput("shippingZipPostalCodeDiv",canadaPostalCodeInput,"saveCanadaPostalCode");
  }
  function showCanadaPostalCodeDisplay(currentCanadaPostalCode,showChangeLink) {
    showDisplay("shippingZipPostalCodeDiv",currentCanadaPostalCode,"showCanadaPostalCodeInput",showChangeLink);
  }  
  function saveCanadaPostalCode() {
    var newCanadaPostalCode = $("austinCanadaPostalCode").get("value");
    if (newCanadaPostalCode == "") {
      alert("You must enter postal code.");
      return;
    }
    if (newCanadaPostalCode.length != 6 && newCanadaPostalCode.length != 7) {
      alert("You must enter a valid postal code.");
      return;
    }
    writeCookie('austinCanadaPostalCode:31995', newCanadaPostalCode);
    cookieCanadaPostalCode = newCanadaPostalCode;
    canadaPostalCode = newCanadaPostalCode;
    showCanadaPostalCodeDisplay(newCanadaPostalCode,true);
    $("shippingZipPostalCodeMsg").set("html","");
    checkForShippingCalculations();
  }
  function showOtherPostalCodeInput() {
    var currentOtherPostalCode = '';
    if (cookieOtherPostalCode && cookieOtherPostalCode != '') {
      currentOtherPostalCode = cookieOtherPostalCode;
    } else if (buyerOtherPostalCode && buyerOtherPostalCode != '') {
      currentOtherPostalCode = buyerOtherPostalCode;
    } else {
      setInitialZipPostalCodeMsg("Postal Code");
    }
    var otherPostalCodeInput = "<input type='textbox' name='austinOtherPostalCode' id='austinOtherPostalCode' value='"+currentOtherPostalCode+"' size='11' maxlength='10'>";
    showInput("shippingZipPostalCodeDiv",otherPostalCodeInput,"saveOtherPostalCode");
  }
  function showOtherPostalCodeDisplay(currentOtherPostalCode,showChangeLink) {
    showDisplay("shippingZipPostalCodeDiv",currentOtherPostalCode,"showOtherPostalCodeInput",showChangeLink);
  }  
  function saveOtherPostalCode() {
    var newOtherPostalCode = $("austinOtherPostalCode").get("value");
    writeCookie('austinOtherPostalCode:31995', newOtherPostalCode);
    cookieOtherPostalCode = newOtherPostalCode;
    otherPostalCode = newOtherPostalCode;
    showOtherPostalCodeDisplay(newOtherPostalCode,true);
    $("shippingZipPostalCodeMsg").set("html","");
    checkForShippingCalculations();
  }
  function showCountryInput() {
    var currentCountry = '110';
    if (cookieCountry && cookieCountry != '') {
      currentCountry = cookieCountry;
    } else if (buyerCountry && buyerCountry != '') {
      currentCountry = buyerCountry;
    }
    var countrySelect = "<select name='austinShippingCountry' id='austinShippingCountry'>";

      countrySelect += getShippingCountryOption("112",currentCountry);

      countrySelect += getShippingCountryOption("113",currentCountry);

      countrySelect += getShippingCountryOption("114",currentCountry);

      countrySelect += getShippingCountryOption("116",currentCountry);

      countrySelect += getShippingCountryOption("117",currentCountry);

      countrySelect += getShippingCountryOption("118",currentCountry);

      countrySelect += getShippingCountryOption("119",currentCountry);

      countrySelect += getShippingCountryOption("120",currentCountry);

      countrySelect += getShippingCountryOption("121",currentCountry);

      countrySelect += getShippingCountryOption("122",currentCountry);

      countrySelect += getShippingCountryOption("123",currentCountry);

      countrySelect += getShippingCountryOption("124",currentCountry);

      countrySelect += getShippingCountryOption("125",currentCountry);

      countrySelect += getShippingCountryOption("126",currentCountry);

      countrySelect += getShippingCountryOption("127",currentCountry);

      countrySelect += getShippingCountryOption("128",currentCountry);

      countrySelect += getShippingCountryOption("129",currentCountry);

      countrySelect += getShippingCountryOption("130",currentCountry);

      countrySelect += getShippingCountryOption("131",currentCountry);

      countrySelect += getShippingCountryOption("132",currentCountry);

      countrySelect += getShippingCountryOption("133",currentCountry);

      countrySelect += getShippingCountryOption("134",currentCountry);

      countrySelect += getShippingCountryOption("135",currentCountry);

      countrySelect += getShippingCountryOption("136",currentCountry);

      countrySelect += getShippingCountryOption("137",currentCountry);

      countrySelect += getShippingCountryOption("361",currentCountry);

      countrySelect += getShippingCountryOption("138",currentCountry);

      countrySelect += getShippingCountryOption("139",currentCountry);

      countrySelect += getShippingCountryOption("141",currentCountry);

      countrySelect += getShippingCountryOption("142",currentCountry);

      countrySelect += getShippingCountryOption("143",currentCountry);

      countrySelect += getShippingCountryOption("144",currentCountry);

      countrySelect += getShippingCountryOption("145",currentCountry);

      countrySelect += getShippingCountryOption("146",currentCountry);

      countrySelect += getShippingCountryOption("147",currentCountry);

      countrySelect += getShippingCountryOption("148",currentCountry);

      countrySelect += getShippingCountryOption("111",currentCountry);

      countrySelect += getShippingCountryOption("350",currentCountry);

      countrySelect += getShippingCountryOption("149",currentCountry);

      countrySelect += getShippingCountryOption("150",currentCountry);

      countrySelect += getShippingCountryOption("151",currentCountry);

      countrySelect += getShippingCountryOption("152",currentCountry);

      countrySelect += getShippingCountryOption("153",currentCountry);

      countrySelect += getShippingCountryOption("154",currentCountry);

      countrySelect += getShippingCountryOption("155",currentCountry);

      countrySelect += getShippingCountryOption("156",currentCountry);

      countrySelect += getShippingCountryOption("157",currentCountry);

      countrySelect += getShippingCountryOption("158",currentCountry);

      countrySelect += getShippingCountryOption("159",currentCountry);

      countrySelect += getShippingCountryOption("160",currentCountry);

      countrySelect += getShippingCountryOption("161",currentCountry);

      countrySelect += getShippingCountryOption("162",currentCountry);

      countrySelect += getShippingCountryOption("163",currentCountry);

      countrySelect += getShippingCountryOption("164",currentCountry);

      countrySelect += getShippingCountryOption("165",currentCountry);

      countrySelect += getShippingCountryOption("362",currentCountry);

      countrySelect += getShippingCountryOption("166",currentCountry);

      countrySelect += getShippingCountryOption("167",currentCountry);

      countrySelect += getShippingCountryOption("168",currentCountry);

      countrySelect += getShippingCountryOption("169",currentCountry);

      countrySelect += getShippingCountryOption("170",currentCountry);

      countrySelect += getShippingCountryOption("171",currentCountry);

      countrySelect += getShippingCountryOption("172",currentCountry);

      countrySelect += getShippingCountryOption("173",currentCountry);

      countrySelect += getShippingCountryOption("174",currentCountry);

      countrySelect += getShippingCountryOption("175",currentCountry);

      countrySelect += getShippingCountryOption("176",currentCountry);

      countrySelect += getShippingCountryOption("177",currentCountry);

      countrySelect += getShippingCountryOption("178",currentCountry);

      countrySelect += getShippingCountryOption("179",currentCountry);

      countrySelect += getShippingCountryOption("180",currentCountry);

      countrySelect += getShippingCountryOption("181",currentCountry);

      countrySelect += getShippingCountryOption("182",currentCountry);

      countrySelect += getShippingCountryOption("183",currentCountry);

      countrySelect += getShippingCountryOption("184",currentCountry);

      countrySelect += getShippingCountryOption("186",currentCountry);

      countrySelect += getShippingCountryOption("187",currentCountry);

      countrySelect += getShippingCountryOption("188",currentCountry);

      countrySelect += getShippingCountryOption("189",currentCountry);

      countrySelect += getShippingCountryOption("190",currentCountry);

      countrySelect += getShippingCountryOption("370",currentCountry);

      countrySelect += getShippingCountryOption("191",currentCountry);

      countrySelect += getShippingCountryOption("192",currentCountry);

      countrySelect += getShippingCountryOption("193",currentCountry);

      countrySelect += getShippingCountryOption("194",currentCountry);

      countrySelect += getShippingCountryOption("195",currentCountry);

      countrySelect += getShippingCountryOption("196",currentCountry);

      countrySelect += getShippingCountryOption("197",currentCountry);

      countrySelect += getShippingCountryOption("198",currentCountry);

      countrySelect += getShippingCountryOption("200",currentCountry);

      countrySelect += getShippingCountryOption("371",currentCountry);

      countrySelect += getShippingCountryOption("201",currentCountry);

      countrySelect += getShippingCountryOption("202",currentCountry);

      countrySelect += getShippingCountryOption("203",currentCountry);

      countrySelect += getShippingCountryOption("204",currentCountry);

      countrySelect += getShippingCountryOption("205",currentCountry);

      countrySelect += getShippingCountryOption("206",currentCountry);

      countrySelect += getShippingCountryOption("207",currentCountry);

      countrySelect += getShippingCountryOption("208",currentCountry);

      countrySelect += getShippingCountryOption("209",currentCountry);

      countrySelect += getShippingCountryOption("210",currentCountry);

      countrySelect += getShippingCountryOption("211",currentCountry);

      countrySelect += getShippingCountryOption("212",currentCountry);

      countrySelect += getShippingCountryOption("213",currentCountry);

      countrySelect += getShippingCountryOption("214",currentCountry);

      countrySelect += getShippingCountryOption("215",currentCountry);

      countrySelect += getShippingCountryOption("372",currentCountry);

      countrySelect += getShippingCountryOption("216",currentCountry);

      countrySelect += getShippingCountryOption("217",currentCountry);

      countrySelect += getShippingCountryOption("218",currentCountry);

      countrySelect += getShippingCountryOption("219",currentCountry);

      countrySelect += getShippingCountryOption("373",currentCountry);

      countrySelect += getShippingCountryOption("220",currentCountry);

      countrySelect += getShippingCountryOption("221",currentCountry);

      countrySelect += getShippingCountryOption("222",currentCountry);

      countrySelect += getShippingCountryOption("223",currentCountry);

      countrySelect += getShippingCountryOption("224",currentCountry);

      countrySelect += getShippingCountryOption("225",currentCountry);

      countrySelect += getShippingCountryOption("226",currentCountry);

      countrySelect += getShippingCountryOption("227",currentCountry);

      countrySelect += getShippingCountryOption("228",currentCountry);

      countrySelect += getShippingCountryOption("374",currentCountry);

      countrySelect += getShippingCountryOption("229",currentCountry);

      countrySelect += getShippingCountryOption("230",currentCountry);

      countrySelect += getShippingCountryOption("231",currentCountry);

      countrySelect += getShippingCountryOption("232",currentCountry);

      countrySelect += getShippingCountryOption("233",currentCountry);

      countrySelect += getShippingCountryOption("234",currentCountry);

      countrySelect += getShippingCountryOption("235",currentCountry);

      countrySelect += getShippingCountryOption("236",currentCountry);

      countrySelect += getShippingCountryOption("237",currentCountry);

      countrySelect += getShippingCountryOption("238",currentCountry);

      countrySelect += getShippingCountryOption("239",currentCountry);

      countrySelect += getShippingCountryOption("240",currentCountry);

      countrySelect += getShippingCountryOption("241",currentCountry);

      countrySelect += getShippingCountryOption("242",currentCountry);

      countrySelect += getShippingCountryOption("243",currentCountry);

      countrySelect += getShippingCountryOption("244",currentCountry);

      countrySelect += getShippingCountryOption("245",currentCountry);

      countrySelect += getShippingCountryOption("246",currentCountry);

      countrySelect += getShippingCountryOption("247",currentCountry);

      countrySelect += getShippingCountryOption("248",currentCountry);

      countrySelect += getShippingCountryOption("249",currentCountry);

      countrySelect += getShippingCountryOption("250",currentCountry);

      countrySelect += getShippingCountryOption("251",currentCountry);

      countrySelect += getShippingCountryOption("252",currentCountry);

      countrySelect += getShippingCountryOption("253",currentCountry);

      countrySelect += getShippingCountryOption("254",currentCountry);

      countrySelect += getShippingCountryOption("255",currentCountry);

      countrySelect += getShippingCountryOption("256",currentCountry);

      countrySelect += getShippingCountryOption("257",currentCountry);

      countrySelect += getShippingCountryOption("258",currentCountry);

      countrySelect += getShippingCountryOption("259",currentCountry);

      countrySelect += getShippingCountryOption("260",currentCountry);

      countrySelect += getShippingCountryOption("261",currentCountry);

      countrySelect += getShippingCountryOption("262",currentCountry);

      countrySelect += getShippingCountryOption("263",currentCountry);

      countrySelect += getShippingCountryOption("264",currentCountry);

      countrySelect += getShippingCountryOption("265",currentCountry);

      countrySelect += getShippingCountryOption("266",currentCountry);

      countrySelect += getShippingCountryOption("267",currentCountry);

      countrySelect += getShippingCountryOption("268",currentCountry);

      countrySelect += getShippingCountryOption("269",currentCountry);

      countrySelect += getShippingCountryOption("270",currentCountry);

      countrySelect += getShippingCountryOption("272",currentCountry);

      countrySelect += getShippingCountryOption("273",currentCountry);

      countrySelect += getShippingCountryOption("274",currentCountry);

      countrySelect += getShippingCountryOption("275",currentCountry);

      countrySelect += getShippingCountryOption("276",currentCountry);

      countrySelect += getShippingCountryOption("277",currentCountry);

      countrySelect += getShippingCountryOption("278",currentCountry);

      countrySelect += getShippingCountryOption("279",currentCountry);

      countrySelect += getShippingCountryOption("280",currentCountry);

      countrySelect += getShippingCountryOption("281",currentCountry);

      countrySelect += getShippingCountryOption("282",currentCountry);

      countrySelect += getShippingCountryOption("283",currentCountry);

      countrySelect += getShippingCountryOption("285",currentCountry);

      countrySelect += getShippingCountryOption("286",currentCountry);

      countrySelect += getShippingCountryOption("287",currentCountry);

      countrySelect += getShippingCountryOption("288",currentCountry);

      countrySelect += getShippingCountryOption("289",currentCountry);

      countrySelect += getShippingCountryOption("290",currentCountry);

      countrySelect += getShippingCountryOption("291",currentCountry);

      countrySelect += getShippingCountryOption("292",currentCountry);

      countrySelect += getShippingCountryOption("293",currentCountry);

      countrySelect += getShippingCountryOption("294",currentCountry);

      countrySelect += getShippingCountryOption("295",currentCountry);

      countrySelect += getShippingCountryOption("296",currentCountry);

      countrySelect += getShippingCountryOption("297",currentCountry);

      countrySelect += getShippingCountryOption("346",currentCountry);

      countrySelect += getShippingCountryOption("298",currentCountry);

      countrySelect += getShippingCountryOption("299",currentCountry);

      countrySelect += getShippingCountryOption("300",currentCountry);

      countrySelect += getShippingCountryOption("301",currentCountry);

      countrySelect += getShippingCountryOption("302",currentCountry);

      countrySelect += getShippingCountryOption("303",currentCountry);

      countrySelect += getShippingCountryOption("304",currentCountry);

      countrySelect += getShippingCountryOption("363",currentCountry);

      countrySelect += getShippingCountryOption("305",currentCountry);

      countrySelect += getShippingCountryOption("306",currentCountry);

      countrySelect += getShippingCountryOption("307",currentCountry);

      countrySelect += getShippingCountryOption("367",currentCountry);

      countrySelect += getShippingCountryOption("308",currentCountry);

      countrySelect += getShippingCountryOption("364",currentCountry);

      countrySelect += getShippingCountryOption("309",currentCountry);

      countrySelect += getShippingCountryOption("365",currentCountry);

      countrySelect += getShippingCountryOption("310",currentCountry);

      countrySelect += getShippingCountryOption("311",currentCountry);

      countrySelect += getShippingCountryOption("312",currentCountry);

      countrySelect += getShippingCountryOption("313",currentCountry);

      countrySelect += getShippingCountryOption("314",currentCountry);

      countrySelect += getShippingCountryOption("315",currentCountry);

      countrySelect += getShippingCountryOption("316",currentCountry);

      countrySelect += getShippingCountryOption("317",currentCountry);

      countrySelect += getShippingCountryOption("366",currentCountry);

      countrySelect += getShippingCountryOption("318",currentCountry);

      countrySelect += getShippingCountryOption("319",currentCountry);

      countrySelect += getShippingCountryOption("320",currentCountry);

      countrySelect += getShippingCountryOption("321",currentCountry);

      countrySelect += getShippingCountryOption("322",currentCountry);

      countrySelect += getShippingCountryOption("323",currentCountry);

      countrySelect += getShippingCountryOption("324",currentCountry);

      countrySelect += getShippingCountryOption("325",currentCountry);

      countrySelect += getShippingCountryOption("326",currentCountry);

      countrySelect += getShippingCountryOption("327",currentCountry);

      countrySelect += getShippingCountryOption("328",currentCountry);

      countrySelect += getShippingCountryOption("329",currentCountry);

      countrySelect += getShippingCountryOption("330",currentCountry);

      countrySelect += getShippingCountryOption("331",currentCountry);

      countrySelect += getShippingCountryOption("332",currentCountry);

      countrySelect += getShippingCountryOption("333",currentCountry);

      countrySelect += getShippingCountryOption("334",currentCountry);

      countrySelect += getShippingCountryOption("110",currentCountry);

      countrySelect += getShippingCountryOption("336",currentCountry);

      countrySelect += getShippingCountryOption("337",currentCountry);

      countrySelect += getShippingCountryOption("338",currentCountry);

      countrySelect += getShippingCountryOption("339",currentCountry);

      countrySelect += getShippingCountryOption("340",currentCountry);

      countrySelect += getShippingCountryOption("341",currentCountry);

      countrySelect += getShippingCountryOption("343",currentCountry);

      countrySelect += getShippingCountryOption("368",currentCountry);

      countrySelect += getShippingCountryOption("344",currentCountry);

      countrySelect += getShippingCountryOption("345",currentCountry);

      countrySelect += getShippingCountryOption("347",currentCountry);

      countrySelect += getShippingCountryOption("348",currentCountry);

    countrySelect += "</select>";
    showInput("shippingCountryDiv",countrySelect,"saveCountry");
  }
  function getShippingCountryOption(country,currentCountry) {
    var selected = "";
    if (currentCountry == country) {
      selected = " selected";
    }
    return '<option value="'+country+'"'+selected+'> '+getCountryDsc(country);    
  }
  function showCountryDisplay(currentCountry,showChangeLink) {
    showDisplay("shippingCountryDiv",getCountryDsc(currentCountry),"showCountryInput",showChangeLink);
  }  
  function saveCountry() {
    var newCountry = $("austinShippingCountry").get("value");
    Cookie.write('austinShippingCountry:31995', newCountry, {domain: 'app.infopia.com', duration: 30, path: '/'});
    cookieCountry = newCountry;
    country = newCountry;
    if (country != '110') {
      if ($("poApoMessage")) {
        $("poApoMessage").set("html","");
      } 
      if (addressType == '3' || addressType == '4') {
        addressType = '1';
        cookieAddressType = '1';
        Cookie.write('austinShippingAddressType:31995', addressType, {domain: 'app.infopia.com', duration: 30, path: '/'});
        showAddressTypeDisplay(addressType,true);        
      }
    }
    showCountryDisplay(newCountry,true);
    showZipPostalCode();
    showZipPostalCodeLabel();
    $("shippingZipPostalCodeMsg").set("html","");
    checkForShippingCalculations();
  }
  function showAddressTypeInput() {
    var currentAddressType = '1';
    if (cookieAddressType && cookieAddressType != '') {
      currentAddressType = cookieAddressType;
    } else if (buyerAddressType && buyerAddressType != '') {
      currentAddressType = buyerAddressType;
    }
    var addressTypeSelect = "<select name='austinShippingAddressType' id='austinShippingAddressType'>";
    for (var i = 1; i <= 4; i++) {
      var showOption = false;
      if (i < 3) {
        showOption = true;
      } else if (i == 3 && country == '110' && false) {
        showOption = true;
      } else if (i == 4 && country == '110' && false) {
        showOption = true;
      }
      if (showOption) {
        addressTypeSelect += getShippingAddressTypeOption(''+i,currentAddressType);
      }
    }
    addressTypeSelect += "</select>";
    showInput("shippingAddressTypeDiv",addressTypeSelect,"saveAddressType");
  }
  function getShippingAddressTypeOption(addressType,currentAddressType) {
    var selected = "";
    if (currentAddressType == addressType) {
      selected = " selected";
    }
    return "<option value='"+addressType+"'"+selected+"> "+getAddressTypeDsc(addressType);    
  }
  function showAddressTypeDisplay(currentAddressType,showChangeLink) {
    var message = "";
    if (country == '110') {
      if (!false && !false) {
        message = "&nbsp;<span id='poApoMessage'><font size='1'>Note: We do not ship to P.O. Boxes or Military Bases (APO/FPO).</font></span>";
      } else if (!false) {
        message = "&nbsp;<span id='poApoMessage'><font size='1'Note: We do not ship to P.O. Boxes.</font></span>";
      } else if (!false) {
        message = "&nbsp;<span id='poApoMessage'><font size='1'Note: We do not ship to Military Bases (APO/FPO).</font></span>";
      }
    }
    showDisplay("shippingAddressTypeDiv",getAddressTypeDsc(currentAddressType),"showAddressTypeInput",showChangeLink,message);
  }  
  function saveAddressType() {
    var newAddressType = $("austinShippingAddressType").get("value");
    writeCookie('austinShippingAddressType:31995', newAddressType);
    cookieAddressType = newAddressType;
    addressType = newAddressType;
    showAddressTypeDisplay(newAddressType,true);
    checkForShippingCalculations();
  }
  function writeCookie(cookieName,cookieValue) {
    Cookie.write(cookieName, cookieValue, {domain: 'app.infopia.com', duration: 30, path: '/'});
  }
  function showInput(div,inputContent,method) {
    var content = inputContent+" [ <a href='javascript:"+method+"()'>Set</a> ]";
    $(div).set("html",content);
  }
  function showDisplay(div,content,method,showChangeLink,message) {
    var displayContent = content;
    if (showChangeLink) {
      displayContent = "<a href='javascript:"+method+"()'>"+content+"</a>";
    }
    if (message && message != '') {
      displayContent += message;
    }
    displayContent += "";
    $(div).set("html",displayContent);
  }
  function getAddressTypeDsc(addressType) {
    addressTypeDsc = "Residential";
    if (addressType == '2') {
      addressTypeDsc = "Business";
    } else if (addressType == '3') {
      addressTypeDsc = "P.O. Box";
    } else if (addressType == '4') {
      addressTypeDsc = "Military Base (APO/FPO)";
    }
    return addressTypeDsc;
  }
  function getCountryDsc(country) {
    if (country == "338") {
        return "Vanuatu";
      }
    if (country == "339") {
        return "Venezuela";
      }
    if (country == "332") {
        return "Ukraine";
      }
    if (country == "333") {
        return "United Arab Emirates";
      }
    if (country == "330") {
        return "Tuvalu";
      }
    if (country == "159") {
        return "Congo";
      }
    if (country == "331") {
        return "Uganda";
      }
    if (country == "158") {
        return "Comoros";
      }
    if (country == "336") {
        return "Uruguay";
      }
    if (country == "157") {
        return "Colombia";
      }
    if (country == "337") {
        return "Uzbekistan";
      }
    if (country == "156") {
        return "Cocos (Keeling) Islands";
      }
    if (country == "334") {
        return "United Kingdom";
      }
    if (country == "155") {
        return "Christmas Island";
      }
    if (country == "154") {
        return "China";
      }
    if (country == "152") {
        return "Chad";
      }
    if (country == "153") {
        return "Chile";
      }
    if (country == "150") {
        return "Cayman Islands";
      }
    if (country == "151") {
        return "Central African Republic";
      }
    if (country == "202") {
        return "Guinea-Bissau";
      }
    if (country == "349") {
        return "Other";
      }
    if (country == "203") {
        return "Guyana";
      }
    if (country == "204") {
        return "Haiti";
      }
    if (country == "205") {
        return "Heard and Mc Donald Islands";
      }
    if (country == "200") {
        return "Guatemala";
      }
    if (country == "201") {
        return "Guinea";
      }
    if (country == "341") {
        return "Virgin islands (British)";
      }
    if (country == "169") {
        return "Djibouti";
      }
    if (country == "343") {
        return "Wallis and Futuna Islands";
      }
    if (country == "344") {
        return "Western Sahara";
      }
    if (country == "345") {
        return "Yemen";
      }
    if (country == "166") {
        return "Cyprus";
      }
    if (country == "206") {
        return "Holy See (Vatican City Stat";
      }
    if (country == "165") {
        return "Cuba";
      }
    if (country == "207") {
        return "Honduras";
      }
    if (country == "346") {
        return "Serbia-Montenegro";
      }
    if (country == "347") {
        return "Zambia";
      }
    if (country == "168") {
        return "Denmark";
      }
    if (country == "208") {
        return "Hong Kong";
      }
    if (country == "348") {
        return "Zimbabwe";
      }
    if (country == "167") {
        return "Czech Republic";
      }
    if (country == "209") {
        return "Hungary";
      }
    if (country == "161") {
        return "Cook Islands";
      }
    if (country == "162") {
        return "Costa Rica";
      }
    if (country == "163") {
        return "Cote D'ivoire";
      }
    if (country == "164") {
        return "Croatia";
      }
    if (country == "340") {
        return "Vietnam";
      }
    if (country == "160") {
        return "Congo, Democratic Republic of the";
      }
    if (country == "211") {
        return "India";
      }
    if (country == "212") {
        return "Indonesia";
      }
    if (country == "210") {
        return "Iceland";
      }
    if (country == "318") {
        return "Taiwan";
      }
    if (country == "215") {
        return "Ireland";
      }
    if (country == "319") {
        return "Tajikistan";
      }
    if (country == "216") {
        return "Israel";
      }
    if (country == "316") {
        return "Switzerland";
      }
    if (country == "213") {
        return "Iran";
      }
    if (country == "317") {
        return "Syrian Arab Republic";
      }
    if (country == "214") {
        return "Iraq";
      }
    if (country == "314") {
        return "Swaziland";
      }
    if (country == "179") {
        return "Ethiopia";
      }
    if (country == "219") {
        return "Japan";
      }
    if (country == "315") {
        return "Sweden";
      }
    if (country == "178") {
        return "Estonia";
      }
    if (country == "312") {
        return "Suriname";
      }
    if (country == "177") {
        return "Eritrea";
      }
    if (country == "217") {
        return "Italy";
      }
    if (country == "313") {
        return "Svalbard and Jan Mayen Isla";
      }
    if (country == "176") {
        return "Equatorial Guinea";
      }
    if (country == "218") {
        return "Jamaica";
      }
    if (country == "310") {
        return "St. Pierre and Miquelon";
      }
    if (country == "311") {
        return "Sudan";
      }
    if (country == "170") {
        return "Dominica";
      }
    if (country == "171") {
        return "Dominican Republic";
      }
    if (country == "174") {
        return "Egypt";
      }
    if (country == "175") {
        return "El Salvador";
      }
    if (country == "172") {
        return "East Timor";
      }
    if (country == "173") {
        return "Ecuador";
      }
    if (country == "220") {
        return "Jordan";
      }
    if (country == "221") {
        return "Kazakhstan";
      }
    if (country == "222") {
        return "Kenya";
      }
    if (country == "223") {
        return "Kiribati";
      }
    if (country == "327") {
        return "Turkey";
      }
    if (country == "224") {
        return "Korea, North";
      }
    if (country == "328") {
        return "Turkmenistan";
      }
    if (country == "225") {
        return "Korea, Republic of (South Korea)";
      }
    if (country == "329") {
        return "Turks and Caicos Islands";
      }
    if (country == "226") {
        return "Kuwait";
      }
    if (country == "227") {
        return "Kyrgyzstan";
      }
    if (country == "323") {
        return "Tokelau";
      }
    if (country == "188") {
        return "French Southern Territories";
      }
    if (country == "228") {
        return "Lao People's Democratic Rep";
      }
    if (country == "324") {
        return "Tonga";
      }
    if (country == "187") {
        return "French Polynesia";
      }
    if (country == "229") {
        return "Latvia";
      }
    if (country == "325") {
        return "Trinidad and Tobago";
      }
    if (country == "326") {
        return "Tunisia";
      }
    if (country == "189") {
        return "Gabon";
      }
    if (country == "320") {
        return "Tanzania";
      }
    if (country == "321") {
        return "Thailand";
      }
    if (country == "322") {
        return "Togo";
      }
    if (country == "180") {
        return "Falkland Islands (Malvinas)";
      }
    if (country == "181") {
        return "Faroe Islands";
      }
    if (country == "182") {
        return "Fiji";
      }
    if (country == "183") {
        return "Finland";
      }
    if (country == "184") {
        return "France";
      }
    if (country == "186") {
        return "French Guiana";
      }
    if (country == "116") {
        return "Andorra";
      }
    if (country == "117") {
        return "Angola";
      }
    if (country == "114") {
        return "Algeria";
      }
    if (country == "112") {
        return "Afghanistan";
      }
    if (country == "113") {
        return "Albania";
      }
    if (country == "110") {
        return "United States";
      }
    if (country == "111") {
        return "Canada";
      }
    if (country == "118") {
        return "Anguilla";
      }
    if (country == "119") {
        return "Antarctica";
      }
    if (country == "125") {
        return "Austria";
      }
    if (country == "126") {
        return "Azerbaijan";
      }
    if (country == "300") {
        return "Singapore";
      }
    if (country == "127") {
        return "Bahamas";
      }
    if (country == "128") {
        return "Bahrain";
      }
    if (country == "302") {
        return "Slovenia";
      }
    if (country == "121") {
        return "Argentina";
      }
    if (country == "301") {
        return "Slovak Republic";
      }
    if (country == "122") {
        return "Armenia";
      }
    if (country == "304") {
        return "Somalia";
      }
    if (country == "123") {
        return "Aruba";
      }
    if (country == "303") {
        return "Solomon Islands";
      }
    if (country == "124") {
        return "Australia";
      }
    if (country == "306") {
        return "South Georgia and the South";
      }
    if (country == "305") {
        return "South Africa";
      }
    if (country == "308") {
        return "Sri Lanka";
      }
    if (country == "307") {
        return "Spain";
      }
    if (country == "129") {
        return "Bangladesh";
      }
    if (country == "309") {
        return "St. Helena";
      }
    if (country == "120") {
        return "Antigua and Barbuda";
      }
    if (country == "134") {
        return "Benin";
      }
    if (country == "135") {
        return "Bermuda";
      }
    if (country == "132") {
        return "Belgium";
      }
    if (country == "133") {
        return "Belize";
      }
    if (country == "138") {
        return "Bosnia-Herzegovina";
      }
    if (country == "139") {
        return "Botswana";
      }
    if (country == "136") {
        return "Bhutan";
      }
    if (country == "137") {
        return "Bolivia";
      }
    if (country == "131") {
        return "Belarus";
      }
    if (country == "130") {
        return "Barbados";
      }
    if (country == "143") {
        return "Brunei Darussalam";
      }
    if (country == "144") {
        return "Bulgaria";
      }
    if (country == "145") {
        return "Burkina Faso";
      }
    if (country == "146") {
        return "Burundi";
      }
    if (country == "147") {
        return "Cambodia";
      }
    if (country == "148") {
        return "Cameroon";
      }
    if (country == "149") {
        return "Cape Verde";
      }
    if (country == "142") {
        return "British Indian Ocean Territory";
      }
    if (country == "141") {
        return "Brazil";
      }
    if (country == "281") {
        return "Pitcairn";
      }
    if (country == "280") {
        return "Philippines";
      }
    if (country == "285") {
        return "Qatar";
      }
    if (country == "283") {
        return "Portugal";
      }
    if (country == "282") {
        return "Poland";
      }
    if (country == "288") {
        return "Russia";
      }
    if (country == "289") {
        return "Rwanda";
      }
    if (country == "286") {
        return "Reunion";
      }
    if (country == "287") {
        return "Romania";
      }
    if (country == "270") {
        return "Norfolk Island";
      }
    if (country == "272") {
        return "Norway";
      }
    if (country == "274") {
        return "Pakistan";
      }
    if (country == "273") {
        return "Oman";
      }
    if (country == "275") {
        return "Palau";
      }
    if (country == "276") {
        return "Panama";
      }
    if (country == "277") {
        return "Papua New Guinea";
      }
    if (country == "278") {
        return "Paraguay";
      }
    if (country == "279") {
        return "Peru";
      }
    if (country == "294") {
        return "San Marino";
      }
    if (country == "293") {
        return "Samoa";
      }
    if (country == "296") {
        return "Saudi Arabia";
      }
    if (country == "295") {
        return "Sao Tome and Principe";
      }
    if (country == "290") {
        return "Saint Kitts and Nevis";
      }
    if (country == "292") {
        return "Saint Vincent and the Grena";
      }
    if (country == "291") {
        return "Saint Lucia";
      }
    if (country == "297") {
        return "Senegal";
      }
    if (country == "298") {
        return "Seychelles";
      }
    if (country == "299") {
        return "Sierra Leone";
      }
    if (country == "240") {
        return "Malawi";
      }
    if (country == "241") {
        return "Malaysia";
      }
    if (country == "195") {
        return "Greece";
      }
    if (country == "194") {
        return "Gibraltar";
      }
    if (country == "197") {
        return "Grenada";
      }
    if (country == "196") {
        return "Greenland";
      }
    if (country == "191") {
        return "Georgia, Republic of";
      }
    if (country == "190") {
        return "Gambia";
      }
    if (country == "193") {
        return "Ghana";
      }
    if (country == "192") {
        return "Germany";
      }
    if (country == "198") {
        return "Guadeloupe";
      }
    if (country == "245") {
        return "Marshall Islands";
      }
    if (country == "244") {
        return "Malta";
      }
    if (country == "243") {
        return "Mali";
      }
    if (country == "242") {
        return "Maldives";
      }
    if (country == "249") {
        return "Mayotte";
      }
    if (country == "248") {
        return "Mauritius";
      }
    if (country == "247") {
        return "Mauritania";
      }
    if (country == "246") {
        return "Martinique";
      }
    if (country == "230") {
        return "Lebanon";
      }
    if (country == "370") {
        return "Gaza Strip";
      }
    if (country == "371") {
        return "Guernsey";
      }
    if (country == "372") {
        return "Isle of Man";
      }
    if (country == "373") {
        return "Jersey";
      }
    if (country == "239") {
        return "Madagascar";
      }
    if (country == "374") {
        return "Laos";
      }
    if (country == "232") {
        return "Liberia";
      }
    if (country == "231") {
        return "Lesotho";
      }
    if (country == "234") {
        return "Liechtenstein";
      }
    if (country == "233") {
        return "Libyan Arab Jamahiriya";
      }
    if (country == "236") {
        return "Luxembourg";
      }
    if (country == "235") {
        return "Lithuania";
      }
    if (country == "238") {
        return "Macedonia";
      }
    if (country == "237") {
        return "Macau";
      }
    if (country == "262") {
        return "Netherlands";
      }
    if (country == "263") {
        return "Netherlands Antilles";
      }
    if (country == "260") {
        return "Nauru";
      }
    if (country == "261") {
        return "Nepal";
      }
    if (country == "361") {
        return "Bonaire";
      }
    if (country == "362") {
        return "Curacao";
      }
    if (country == "366") {
        return "Tahiti";
      }
    if (country == "365") {
        return "St. Maarten";
      }
    if (country == "364") {
        return "St. Barthelemy";
      }
    if (country == "363") {
        return "Somaliland, Rep of (North Somalia)";
      }
    if (country == "368") {
        return "West Bank";
      }
    if (country == "367") {
        return "Spratly Islands";
      }
    if (country == "269") {
        return "Niue";
      }
    if (country == "268") {
        return "Nigeria";
      }
    if (country == "267") {
        return "Niger";
      }
    if (country == "266") {
        return "Nicaragua";
      }
    if (country == "265") {
        return "New Zealand";
      }
    if (country == "264") {
        return "New Caledonia";
      }
    if (country == "250") {
        return "Mexico";
      }
    if (country == "251") {
        return "Micronesia";
      }
    if (country == "252") {
        return "Moldova";
      }
    if (country == "350") {
        return "Canary Islands";
      }
    if (country == "258") {
        return "Myanmar";
      }
    if (country == "257") {
        return "Mozambique";
      }
    if (country == "259") {
        return "Namibia";
      }
    if (country == "254") {
        return "Mongolia";
      }
    if (country == "253") {
        return "Monaco";
      }
    if (country == "256") {
        return "Morocco";
      }
    if (country == "255") {
        return "Montserrat";
      }

    return "United States";
  }
