
var country_first_address_form = function(options)
{
    $(options.trigger).live("change", function() {
        var country = $(this).val();
        if (country == "US" || country == "0") {
            $(options.postalcode + ", " + options.province + ", " + options.region).parent("div.elements").hide();
            $(options.zip + ", " + options.state).parent("div.elements").show();
        } else if (country == "CA") {
            $(options.zip + ", " + options.state + ", " + options.region).parent("div.elements").hide();
            $(options.postalcode + ", " + options.province).parent("div.elements").show();
        } else {
            $(options.zip + ", " + options.state + ", " + options.province).parent("div.elements").hide();
            $(options.postalcode + ", " + options.region).parent("div.elements").show();
        }
    });
    $(options.trigger).trigger("change");
};

$(function() {
    $("select.relocateonchange").live("change", function() {
        var arg = $(this).val();
        if (arg != "") {
            var base = $(this).parents("form").attr("action");
            window.location = base + "/" + arg;
        }
    });
});

