function pageInit() {
    $("p#whyLoyaltySelect").show();

    $("select#whyLoyaltyCountries").change(function() {
        handleCarrierSelect(this);
    });

    var objSelect = $("select#whyLoyaltyCountries").get(0);
    if (document.location.search !== '') {
        var currCountry = document.location.search.substring(1,document.location.search.length).split('=')[1];
        for (var i=0; i<objSelect.length; i++) {
            if (objSelect[i].value == currCountry) {
                objSelect[i].selected = true;
                break;
            }
        }
    }
}

function handleCarrierSelect(objSelect) {
    if (objSelect[objSelect.selectedIndex].value !== "") {
        window.location = "/about/why/loyalty/programs.html?country=" + objSelect[objSelect.selectedIndex].value;
    }
}