/**
 * the id of the div to update
 */
var updateid = 'featuredprofiles';

/**
 * the style used for the current active tab
 */
var activestyle = 'activetab';

/**
 * the id of the current tab
 */
var currenttab;

/**
 * executes an ajax request to retrieve featured profiles
 * of a specific type
 */
populateFeaturedProfiles = function(type)
{

    // Capitalize the first letter of the type for asthetic appeal
    type_ucw = type.substr(0, 1).toUpperCase() + type.substr(1);

    // Create the HTML block for the loader; centered and pushed down near the middle of the container
    var ajaxloader  = '<div class="floatcenter" style="margin-top: 45px;">';
        ajaxloader += '<span class="weightbolder" style="font-size: 120%;"><img src="images/indicator.gif" align="absmiddle" /> Please wait while loading Featured ' + type_ucw + '...</span>';
        ajaxloader += '</div>';

    // Show the loader
    $('#' + updateid).html(ajaxloader);

    // Make the post to get the featured profiles
    $.post('ajax/featured.php', 'do=profiles&type=' + type, function(data) {

        // Replace the loader with the data returned
        $('#' + updateid).html(data);

    });

}

/**
 * sets the class for the currently active tab
 */
setActiveTab = function(linkid)
{

    if (currenttab != undefined) {

        $('#' + currenttab).attr('class', "");

    }

    $('#' + linkid).addClass(activestyle);

    currenttab = linkid;
}