﻿
/* 时时乐组选分布图 */
show_kjzs = function(n) {
    var html = "<div style=\"width:980px;margin:0 auto; \"><table class=\"wrap_body\" border=\"0\" cellpadding=\"0\" cellspacing=\"5\"><tr><td>";
    html += "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> \
                   <tr><td align=\"center\" class=\"Title_lottery\">时时乐组选分布图</td></tr> \
                   <tr><td align=\"center\"><a href=\"?id=30\">最近30期</a> &nbsp; <a href=\"?id=50\">最近50期</a> &nbsp; <a href=\"?id=100\">最近100期</a></td></tr> \
                   <tr> \
                     <td align=\"center\" class=\"choose\"> 标注形式选择：\
                       <input type=\"checkbox\" name=\"checkbox\" id=\"c_d\" onclick=\"map.select_checkbox('gYL',this);\" /> <label for=\"c_d\">不带遗漏数据</label> \
                       <input type=\"checkbox\" name=\"checkbox\" id=\"c_o\" onclick=\"map.select_checkbox('gLayer',this);\" /> <label for=\"c_o\">遗漏分层</label> \
                       <input type=\"checkbox\" name=\"checkbox\" id=\"c_l\" onclick=\"map.select_checkbox('spaceLine',this);\" checked=\"checked\" /> <label for=\"c_l\">辅助线</label> \
                     </td> \
                   </tr> \
                 </table> \
                 <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" class=\"tab_bg\"> \
                   <tbody id=\"head\"> \
                     <tr> \
                       <td rowspan=\"2\" class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
		               <td rowspan=\"2\" class=\"bLine\"><img src=\"images/space.gif\" width=\"60\" height=\"1\" /><br /><B>期号</B></td> \
		               <td rowspan=\"2\" class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
		               <td rowspan=\"2\" class=\"bLine\"><img src=\"images/space.gif\" width=\"60\" height=\"1\" /><br /><B>开奖号码</B></td> \
		               <td rowspan=\"2\" class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
					   <td rowspan=\"2\" class=\"bLine\"><img src=\"images/space.gif\" width=\"40\" height=\"1\" /><br /><B>时间</B></td> \
		               <td rowspan=\"2\" class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
		               <td colspan=\"22\"><B>0-9分布</B></td> \
		               <td rowspan=\"2\" class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
		             </tr> \
		             <tr> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />5</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />6</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />7</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />8</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />9</td> \
		               <td class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />0</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />1</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />2</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />3</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />4</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />5</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />6</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />7</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />8</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />9</td> \
		               <td class=\"padd_1\"><img src=\"images/space.gif\" width=\"1\" height=\"1\" /></td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />0</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />1</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />2</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />3</td> \
		               <td class=\"line_top bLine\"><img src=\"images/space.gif\" width=\"18\" height=\"1\" /><br />4</td> \
		             </tr> \
		           </tbody>";

    // 参数说明：号码(","：分割符；"-"：空列；"->"：直接输出)$背景样式$字体样式$球样式$是否连线,连线颜色,连线尺寸
    var colspan = ["5,6,7,8,9$cbg2$yl02$chartBall02", "0,1,2,3,4,5,6,7,8,9$cbg1$yl01$chartBall01", "0,1,2,3,4$cbg2$yl02$chartBall02"];

    // 初始化图表显示类
    map = new tb.display(nameXML, colspan, true, true, "0_0_7");

    html += map.show_map(n) + "</table></td></tr>";
    html += "<tr><td colspan=\"30\" class=\"boot_css\"> \
                <div style=\"width:300px;float:left;\"> \
                 参数说明： <br/> \
                 [遗漏分层] 将当期遗漏标注出来 <br/> \
                 [辅助线] 每五期使用分隔线，使横向导航更加清晰 \
                </div> \
             </td></tr>";
    html += "</table></div>";

    document.write(html);

    map.operate();
}

show_kjzs(nExpect(30, 20, 100));

/************************ 以下为图表选号 ************************/

/* 预选区选号事件 */
select_singleball = function(css, obj) {
    if ((tb.ball).test(obj.className)) {
        obj.className = obj.className.replace(" " + css, "");
    } else {
        obj.className += " " + css;
    }
}

/* 处理行选号 */
function docompose_code(temp) {
    var s = [];
    var code = temp.split("|");

    if (code[1] == "") {
        s.push("未选择");
        s.push("");
        s.push("");
        s.push("");
        s.push("<a href=\"javascript:void(0);\" onclick=\"change_code(this);\">添加</a>");
        s.push("");
    } else {
        var select = code[1].replace(/,/g, "");
        var choice = select_choice();
        var zhu = getnzhu(select, choice);
        if (zhu > 0) {
            s.push("√");
            s.push(select);
            s.push(zhu);
        } else {
            s.push("玩法不符");
            s.push(select);
            s.push("");
        }
        s.push("包号投注");
        s.push("<a href=\"javascript:void(0);\" onclick=\"change_code(this);\">修改</a>");
        s.push("<img src=\"images/close.gif\" style=\" cursor:pointer;\" onclick=\"delete_code(this);\" />");
    }
    return s;
}

/* 计算注数 */
var zu3 = new Array(0, 0, 2, 6, 12, 20, 30, 42, 56, 72, 90);
var zu6 = new Array(0, 0, 0, 1, 4, 10, 20, 35, 56, 84, 120);
function getnzhu(code, choice) {
    var zhu = 0;
    var len = code.length;
    switch (choice) {
        case "直选":
            zhu = Math.pow(len, 3);
            break;
        case "组选":
            zhu = zu3[len] + zu6[len];
            break;
        case "组三":
            zhu = zu3[len];
            break;
        case "组六":
            zhu = zu6[len];
            break;
    }
    return zhu;
}

show_layerHTML();
