﻿<!---#INCLUDE FILE="functions.asp"--->
    var iCurrentChatters = 0
    var surl = location.href.substring(0,location.href.lastIndexOf('/')) + '/Includes/SystemConsole.asp';
    function elemfunction(params,id,msg){
        if (msg.length > 0){
            $(id).innerHTML =  msg 
        }else{
            $(id).innerHTML = "&nbsp;<img src='images/wait24trans.gif' /> Loading...&nbsp;";   
        }
    var req = new Ajax.Request(
        surl,
        {
            method: 'post',
            parameters: params,
            onComplete: function(r){$(id).innerHTML = r.responseText;}
        }); 
    }
    function dingchat(params,id,msg){
        /*if (msg.length > 0){
            $(id).innerHTML =  msg 
        }else{
            $(id).innerHTML = "&nbsp;<img src='images/wait24trans.gif' /> Loading...&nbsp;";   
        }*/
        var req = new Ajax.Request(
        surl,
        {
            method: 'post',
            parameters: params,
            onComplete: function(r){
            if ((r.responseText > 0) && (r.responseText != iCurrentChatters))
                {
                elemfunction('todo=chatcount&date='+Date(),'chatcount','');
                $('sound1').Play();
                }
            else if ((r.responseText != iCurrentChatters))
                {
                elemfunction('todo=chatcount&date='+Date(),'chatcount','');
                $('sound2').Play();
                }
            iCurrentChatters = r.responseText;
            }
        }); 
    } 
   


