var ajaxConn = new XHConn();
var new_mails = new Number();
var check_mail_ajax_done = function (oXML) {
    var mail = new Array();

        mail = oXML.responseText.split(";");

        if (mail[0] == 'off' && mail[1] == 'offline') {
            clearTimeout(check_mail_timer);
        }

        if (mail[0] > 0) {
        document.getElementById("mail").innerHTML = "<a href='/id/1679905' style='color: red;text-decoration:blink'>mail(" + mail[0] + ")</a>";
        }
        check_mail_timer = setTimeout("check_new_mail()", 45 * 1000);
        new_mails = mail[0];
}

function check_new_mail() {
	ajaxConn.connect("/ajax/check_new_mail.php", "GET", "", check_mail_ajax_done);
}

// execute on page load
var check_mail_timer = setTimeout("check_new_mail()", 45 * 1000);