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 '' + '
| ' + getAttribute(nodes[index], 'd').substr(11 , 6) + ' | \n' + '\n' +
' \n' +
' | \n' +
' \n' +
' \n' +
' ' + getAttribute(nodes[index], 'h') + '\n' +
' | \n' +
' ' + getAttribute(nodes[index], 'i') + ' | \n' + '让分 | \n' + '大小 | \n' + '欧赔 | \n' + '分析 | \n' + '' + (getAttribute(nodes[index], 'j') != '' ? (
' | \n' +
' ' + (getAttribute(nodes[index], 'k') != '' ? (
' | \n' +
'