﻿
/* 图表类型 */
var map_type = "ssl";

/* XML名称 */
var nameXML = "ssl_kjhm.xml?u="+Math.random();

/* 更新图表 */
update = function() {
    var now = new Date();
    var minute = now.getMinutes();
    var second = now.getSeconds();

    if ((minute >= 2 && minute < 9) || (minute >= 32 && minute < 39)) {
        if (second % 20 == 0) {
            try {
                tb.ajax.callFile("http://tubiao.178cpw.com/tubiao/include/kj_getxml.php?cptype=ssl&r=" + Math.random(), function(response) {
                    if (response == false) return;
                    var oDom = tb.xml.str2oDom(response);
                    var rs = function(name) { return oDom.getElementsByTagName(name); }
                    var issue = rs("issue").item(0).firstChild.data;
                    var number = rs("jg").item(0).firstChild.data;
                    var kjtime = rs("kjtime").item(0).firstChild.data;
                    
                    var expect = $("data").lastChild.cells[1].innerHTML;
                    issue = issue.substring(2, issue.length);

                    if (parseInt(issue, 10) > parseInt(expect, 10)) map.add_row(issue, number, kjtime);
                })
            } catch (e) { }
        };
    }

    setTimeout("update()", 1000);
}

/* 图表头部 */
load_head("ssl");
