function displayProfileSelector() {
    var $profileSelector = jQuery("div#profile-selector").eq(0);

    if ($profileSelector.length == 1) {        
        var combo = new PipenoUI.ComboBox($profileSelector.find(".pipeno-combobox"));

        $profileSelector.find(".pipeno-combobox ul").corner("bottom 5px");
        $profileSelector.find("div.outer-container").corner("5px");

        var submitButton = new PipenoUI.SubmitButton($profileSelector.find(".submit-button"));

        jQuery(submitButton).bind("submit-data", function() {
            jQuery.ajax({
                url: profileChangePostUrl,
                type: 'POST',
                cache: false,
                data: { id: combo.SelectedValue() },
                success: function(data) {
                    if (data.response == "ok") {
                        //reload the window so that we can apply the new changes
                        window.location.reload(true);
                    } else {
                        //treat error here
                    }
                    $profileSelector.hide();
                    submitButton.Stop();
                },
                error: function() {
                    $profileSelector.hide();
                    submitButton.Stop();
                },
                timeout: function() {
                    $profileSelector.hide();
                    submitButton.Stop();
                }
            });
            return false;
        });
        
        $profileSelector.show();
    }
}

function useTargetBlank(obj) {
    var newWindow = window.open($(obj).attr('href'), '_blank');
    newWindow.focus();
    return false;
}