/**
 * Show div class="infoblock" with message at the top of the page
 *
 * @access public
 * @return void
 **/
function message(message, type, delay, absolute, parent){
    // defaults
    message = typeof(message) != 'undefined' ? message : '';
    type = typeof(type) != 'undefined' ? type : 'info';     // posible type values -- ok, info, warning, error
    absolute = typeof(absolute) != 'undefined' ? absolute : false;
    delay = typeof(delay) != 'undefined' ? delay : 0;
    if (typeof(parent)=='undefined') {
        parent = $('#content .box div.content');
    }
    // set variables
    var ts = new Date().getTime();
    var message_id = 'infoblock'+ts;
    var style = '';
    if (absolute) {
        style = "position:absolute;";
    }
    // create message div
    $(parent).prepend('<div id="'+message_id+'" class="infoblock '+type+'" style="display:none;'+style+'">'+message+'</div>');
    // do animation of message div
    $('#'+message_id).slideDown("fast", function(){
        if (delay>0) {
            $(this).delay(delay).slideUp("fast", function(){
                $(this).remove()
            });
        }
    });
}

