$(function(){
    $('.sublist').hide();
    $(".upbutton").click(function(){$.scrollTo(0,500,{easing:'easein'});return false;});
    $('#systemMessage').hide().slideDown(200).animate({opacity: 0.2}, 200).animate({opacity: 1}, 200);
    $.scrollTo($("#systemMessage"),200,{easing:'easein'});
    $('.closeSystemMessage a').click(function(){$("#systemMessage").slideUp(100);return false;});
});

function showSystemMessage(message, type) {
    if(!type) type = 'warning';
    var html = '<div id="systemMessage" class="' + type + '"><span class="closeSystemMessage"><a href="#">x</a></span><ol>' + message + '</ol></div>';
    $('#messageBox').html(html);
    $('#systemMessage').hide().slideDown(200).animate({opacity: 0.2}, 200).animate({opacity: 1}, 200);
    $('.closeSystemMessage a').click(function(){$("#systemMessage").slideUp(100);return false;});
    $.scrollTo($("#messageBox"),200,{easing:'easein'}); 
}

function showSystemAlert(message, type)
{
    if(!type) type = 'warning';
    var html = '<div id="systemAlert" class="sa' + type + '"><span class="closeSystemMessage"><a href="#">x</a></span><ol>' + message + '</ol></div>';
    $('#messageBox').html(html);
    $('#systemAlert').hide().slideDown(200).animate({opacity: 0.2}, 200).animate({opacity: 1}, 200).animate({opacity: 1}, 10000).slideUp(100); 
    $('#systemAlert').click(function(){$(this).stop();});
    $('span.closeSystemMessage a').click(function(){$(this).stop();});
}

function show_menu(object)
{
    $('.sublist').hide();//slideUp(100);
    $("#" + object).show();//.slideDown(200);
}
