function set_chat(channel, xsl)
{
    channel = (channel) ? channel : '0';
    var xsl = (xsl) ? xsl : jQuery.ajax({
        url: '/chat/channel.xsl',
        async: false,
        dataType: 'text'
    }).responseText;
    result = jQuery.transform(
    {
        xslParams: {
            cur_mess_id: (cur_mess_id = jQuery('#chat div:first').attr('message_id')) ? cur_mess_id : 0
            },
        async: false,
        cache: true,
        xml: '/chat/'+channel+'.xml',
        xslstr: xsl
    }
    );
    if (result)
    {
        jQuery('#chat').prepend(result);
    }
    window.setTimeout(function(){
        set_chat(channel, xsl);
    }, 5000);
}

