function Schedule(UITag) { Date.prototype.getWeekey = function() { switch(this.getDay()) { case 0 : return '星期日'; case 1 : return '星期一'; case 2 : return '星期二'; case 3 : return '星期三'; case 4 : return '星期四'; case 5 : return '星期五'; case 6 : return '星期六'; } } String.prototype.parseDate = function() { return new Date( parseInt(this.substr(0 , 4) , 10) , parseInt(this.substr(5 , 2) , 10) - 1 , parseInt(this.substr(8 , 2) , 10) ); } function getAttribute(sender, key) { return sender.attributes.getNamedItem(key) ? sender.attributes.getNamedItem(key).text : ''; } window.temp = new Object(); window.temp.static = new Object(); window.temp.collection = new Object(); window.temp.collection.date = new Object(); window.temp.collection.matche = new Object(); window.temp.collection.checkbox = new Object(); window.XmlDocument = new ActiveXObject('MICROSOFT.XMLDOM'); window.XmlDocument.async = true; window.XmlDocument.onreadystatechange = function() { //try { if (window.XmlDocument.parseError.errorCode != 0) { setTimeout(reloadXML , 100); window.defaultStatus = 'Xml Exception(' + ++RELOADXML_ERROR_COUNT + '):' + window.XmlDocument.parseError.reason; } else if(window.XmlDocument.readyState == 4) { RELOADXML_ERROR_COUNT = 0; work(); } //} catch(e) { // window.defaultStatus = e.message; //} } var RELOADXML_ERROR_COUNT = 0; var reloadXML = function() { if(typeof(window['SERVER_TIME$']) == 'undefined') window['SERVER_TIME$'] = 3428534081; else window['SERVER_TIME$'] += 1; window.XmlDocument.load('/xml/schedule/15_day.xml?' + window['SERVER_TIME$']); } this.reloadXML = reloadXML; document.getElementById('date_select_all').onclick = function() { for(var key in window.temp.collection.date) { document.getElementById(key).checked = true; document.getElementById(key).onclick(); } } document.getElementById('date_select_not').onclick = function() { for(var key in window.temp.collection.date) { document.getElementById(key).checked = ! document.getElementById(key).checked; document.getElementById(key).onclick(); } } document.getElementById('matches_select_all').onclick = function() { for(var key in window.temp.collection.matche) { document.getElementById(key).checked = true; document.getElementById(key).onclick(); } } document.getElementById('matches_select_not').onclick = function() { for(var key in window.temp.collection.matche) { document.getElementById(key).checked = ! document.getElementById(key).checked; document.getElementById(key).onclick(); } } function work() { window.temp.static.nodes = window.XmlDocument.selectNodes('/mso/row'); var html = makeHTML(0); var html2 = ''; for(var key in window.temp.static.matche_select_div) { html2 += window.temp.static.matche_select_div[key]; } document.getElementById(UITag[0]).innerHTML = window.temp.static.date_select_div; document.getElementById(UITag[1]).innerHTML = html2; document.getElementById(UITag[2]).innerHTML = html; /* window.open('' , 'mso').document.write(window.temp.static.date_select_div + html2 + html); */ } function makeHTML(index) { var nodes = window.temp.static.nodes; //没有信息时 if(nodes.length == 0) { return '' + '
当前无信息存在.
'; } //结束信息时 if(index >= nodes.length) { return '' + ' \n' + ' \n' + '\n\n'; } //临时值 var date = getAttribute(nodes[index], 'd').substr(0 , 10); // 2006-03-06 02:00 var matche = getAttribute(nodes[index], 'b'); var vs_id = getAttribute(nodes[index], 'a'); var html = ''; //日期有改变时处理 if(window.temp.static.date != date) { //入一个 checkbox 对象 id 到 date 集合中 window.temp.collection.date['mso,nba,schedule,checkbox,' + date] = date; if(! window.temp.collection.checkbox['mso,nba,schedule,checkbox,' + date]) window.temp.collection.checkbox['mso,nba,schedule,checkbox,' + date] = new Object(); if(! window.temp.static.date_select_div) window.temp.static.date_select_div = ''; window.temp.static.date_select_div += '' + '\n'; html += '' + (window.temp.static.date ? ( ' \n' + ' \n' + '\n\n') : '') + '
\n' + '
\n' + ' ' + date + ' (' + date.parseDate().getWeekey() + ')\n' + '
\n'; window.temp.static.matche = null; window.temp.static.date = date; } //联赛有改变时处理 if(window.temp.static.matche != matche) { //入一个 checkbox 对象 id 到 matche 集合中 window.temp.collection.matche['mso,nba,schedule,checkbox,' + matche] = matche; if(! window.temp.collection.checkbox['mso,nba,schedule,checkbox,' + matche]) window.temp.collection.checkbox['mso,nba,schedule,checkbox,' + matche] = new Object(); if(! window.temp.static.matche_select_div) window.temp.static.matche_select_div = new Object(); window.temp.static.matche_select_div[matche] = '' + '\n'; html += '' + (window.temp.static.matche ? ( ' \n' + '
\n') : '') + '
\n' + '
\n' + ' ' + getAttribute(nodes[index], 'c') + ' ' + getAttribute(nodes[index], 'l') + ' | 排名榜\n' + '
\n' + ' \n'; window.temp.static.currentIndex = 0; window.temp.static.matche = matche; } var bgcolor = window.temp.static.currentIndex++ % 2 == 0 ? '#F1F1F1' : '#ECECE4'; return html + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + makeHTML(index + 1); } reloadXML(); } Schedule(['date_select_div' , 'matche_select_div' , 'data_div']);
' + getAttribute(nodes[index], 'd').substr(11 , 6) + '\n' + ' \n' + ' \n' + ' ' + getAttribute(nodes[index], 'f') + '\n' + ' \n' + ' \n' + ' \n' + ' ' + getAttribute(nodes[index], 'h') + '\n' + ' \n' + ' \n' + ' ' + getAttribute(nodes[index], 'i') + '让分大小欧赔分析' + (getAttribute(nodes[index], 'j') != '' ? ( '' ) : '') + '' + (getAttribute(nodes[index], 'k') != '' ? ( '' ) : '') + '