/* COPYRIGHT (C) 2004 Visuworld.NET - ALL RIGHTS RESERVED Live TICKER Engine V 4.2c - final 4 */
/* ANY USE OF THIS SOURCE AND FILES OR SOURCES IS STRICTLY NOT ALLOWED ! */

tcss=0;tcsa=0;tcat=100;xrun=0;pre=0;xltmp=1;e=new Array();pars=new Array();dp=new Array();bg=new Array("lvc_snd_off.gif","lvc_snd_on.gif","100","1","#dae6eb","#d1e1e9","#9cbecf");c=100;
function livescores(c) {tcat=c;if (c!=bg[2]) { bg[2]=c; ev_new(); };if (document.implementation && document.implementation.createDocument) {domXml=document.implementation.createDocument("","",null);domXml.onload = prescore;pev=document.getElementById('pev'); } else if (window.ActiveXObject) {domXml=new ActiveXObject("MSXML2.DOMDocument");domXml.async=false;domXml.onreadystatechange = function () {if (domXml.readyState == 4) prescore();};} else {alert('Your browser can not handle this Live Scores - Please update to a newer Version.');return;};domXml.load('./lvc/'+bg[2]+'/evt.xml?t='+tcss);}
function prescore() { pre=domXml.getElementsByTagName('wettpoint');scores(); }
function scores() { var snd=0;if(pre[0].childNodes[0]){for(i=0;i<pre[0].childNodes.length;i++) {var po=pre[0].childNodes[i];var id=po.getAttribute("id");pars[id]=new Array(po.getAttribute("cat"),po.getAttribute("lp1"),po.getAttribute("lp2"),po.getAttribute("tab"),po.getAttribute("dec"));if(!dp[id]){ev_cre(id,po)} else if(dp[id]>1){if(po.getAttribute("sta")=='AC') {ev_act(id,po)};if(po.getAttribute("cid")!=e[id].c) {ev_upd(id,po,1);if(e[id].s>0) {snd=1};} else {pev.rows[e[id].i].bgColor=pev.rows[e[id].i].cells[6].bgColor};};e[id].c=po.getAttribute("cid");};if (snd>0 && bg[3]>0) {sound()};} else {ev_noe()}; }
function ev_cre(id,po) {var x=pev.rows.length;if (bg[7]==bg[5]) {bg[7]=bg[4]} else {bg[7]=bg[5]};pev.insertRow(x);pev.rows[x].insertCell(0);pev.rows[x].insertCell(1);pev.rows[x].insertCell(2);pev.rows[x].insertCell(3);pev.rows[x].insertCell(4);pev.rows[x].insertCell(5);pev.rows[x].insertCell(6);pev.rows[x].setAttribute('bgColor',bg[7]);pev.rows[x].cells[0].setAttribute('id',id);pev.rows[x].cells[6].setAttribute('align','right');pev.rows[x].cells[6].setAttribute('bgColor',bg[7]);pev.rows[x].cells[0].innerHTML='<img src=lvc/ctn/'+po.getAttribute("lnd")+'.gif class=lnc alt="'+po.getAttribute("lnc")+' - '+po.getAttribute("dec")+'" onClick=ev_dtl('+id+')><span id=z'+id+'></span>';pev.rows[x].cells[1].innerHTML='<div class=sta id=s'+id+' onClick=ev_dtl('+id+') title=""></div>';pev.rows[x].cells[2].innerHTML='<b id=a'+id+'></b>';pev.rows[x].cells[3].innerHTML='<a id=n'+id+' style=color:#000000 onClick=ev_dtl('+id+')  title="Spiel Details..."></a>';pev.rows[x].cells[4].innerHTML='&nbsp;';pev.rows[x].cells[6].innerHTML='<div class=ste><div class=dpl onClick=ev_del('+id+')></div> <div id=m'+id+' class=sdi onClick=ev_snd('+id+')></div></div>';e[id]=new Object({'i':x,'s':1});e['d'+id]=new Object({'i':0});dp[id]=2;ev_upd(id,po,0);if (po.getAttribute("sta")=='AC') {ev_act(id,po)};}
function ev_upd(id,po,ch) {if (ch>0) {pev.rows[e[id].i].bgColor=bg[6]};document.getElementById('z'+id).innerHTML=po.getAttribute("dtm");pev.rows[e[id].i].cells[5].innerHTML='<b>'+po.getAttribute("res")+'</b> &nbsp; '+po.getAttribute("prs");ev_sta(id,po);evm_dtl(id,po);if (po.getAttribute("wns")!="") {ev_wns(id,po)};}
function evm_dtl(id,po) {var x=new Array();for(j=3;j<po.childNodes.length;j++) {var t=po.childNodes[j].firstChild.nodeValue.split('|');var y=po.childNodes[j].getAttribute("tim");if (!x[y]) {x[y]=''};if (y>9) {x[y]+='<b>'+y} else {x[y]+='<b>0'+y};x[y]+='\'</b> min. <b><font color=#cc0000>'+t[0]+'</font> '+t[1]+' </b>('+po.childNodes[t[2]].firstChild.nodeValue+')<br>';};e[id].d=x.join('');if (e["d"+id].i>0) {document.getElementById('dt'+id).innerHTML=e[id].d};}
function ev_wns(id,po) {pev.rows[e[id].i].cells[4].innerHTML='';var x=po.getAttribute("wns").split('||');for (l in x) {var t=x[l].split('|');if (t.length>1) {pev.rows[e[id].i].cells[4].innerHTML+=t[0]+'\'<img src=lvc/'+t[1]+'.gif border=0 align=absmiddle hspace=4 alt="'+t[2]+'">';};};}
function ev_dtl(id) {var x=e[id].i+1;if (e["d"+id].i<1) {pev.insertRow(x);pev.rows[x].insertCell(0);pev.rows[x].insertCell(1);pev.rows[x].setAttribute('bgColor','#e1ebf0');pev.rows[x].cells[0].setAttribute('id',"d"+id);pev.rows[x].cells[0].setAttribute('colSpan',3);pev.rows[x].cells[1].setAttribute('colSpan',4);pev.rows[x].cells[1].setAttribute('id',"dt"+id);if (e[id].d!='') { pev.rows[x].cells[1].innerHTML=e[id].d } else { pev.rows[x].cells[1].innerHTML='Derzeit keine Details vorhanden...' };
if (pars[id][0]==104 && pars[id][1]>0 && pars[id][2]>0) { pev.rows[x].cells[1].innerHTML='<img src="m_r.gif" class="nav1"> <a href="http://tennis.wettpoint.com/spieler/'+pars[id][1]+'.html" target="_blank">Statistik Spieler 1</a><br><img src="m_r.gif" class="nav1"> <a href="http://tennis.wettpoint.com/spieler/'+pars[id][2]+'.html" target="_blank">Statistik Spieler 2</a><br><img src="m_rx.gif" class="nav1"> <a href="http://tennis.wettpoint.com/h2h/'+pars[id][1]+'-'+pars[id][2]+'.html" target="_blank">Head-to-Head Statistik</a>'; };
if (pars[id][0]==100) { if (pars[id][3]!='') { pev.rows[x].cells[1].innerHTML+='<br><img src="m_r.gif" class="nav1"> <a href="http://fussball.wettpoint.com/tabellen/'+pars[id][3]+'.html" target="_blank">'+pars[id][4]+' Tabelle</a>'; };if (pars[id][1]>0 && pars[id][2]>0) { pev.rows[x].cells[1].innerHTML+='<br><img src="m_r.gif" class="nav1"> <a href="http://fussball.wettpoint.com/teams/'+pars[id][1]+'.html" target="_blank">Statistik Team 1</a> &nbsp; <img src="m_r.gif" class="nav1"> <a href="http://fussball.wettpoint.com/teams/'+pars[id][2]+'.html" target="_blank">Statistik Team 2</a><br><img src="m_rx.gif" class="nav1"> <a href="http://fussball.wettpoint.com/h2h/'+pars[id][1]+'-'+pars[id][2]+'.html" target="_blank">Head-to-Head Statistik</a>'; }; };
if (pars[id][0]==103) { if (pars[id][3]!='') { pev.rows[x].cells[1].innerHTML+='<br><img src="m_r.gif" class="nav1"> <a href="http://handball.wettpoint.com/tabellen/'+pars[id][3]+'.html" target="_blank">'+pars[id][4]+' Tabelle</a>'; };if (pars[id][1]>0 && pars[id][2]>0) { pev.rows[x].cells[1].innerHTML+='<br><img src="m_r.gif" class="nav1"> <a href="http://handball.wettpoint.com/teams/'+pars[id][1]+'.html" target="_blank">Statistik Team 1</a> &nbsp; <img src="m_r.gif" class="nav1"> <a href="http://handball.wettpoint.com/teams/'+pars[id][2]+'.html" target="_blank">Statistik Team 2</a><br><img src="m_rx.gif" class="nav1"> <a href="http://handball.wettpoint.com/h2h/'+pars[id][1]+'-'+pars[id][2]+'.html" target="_blank">Head-to-Head Statistik</a>'; }; };
if (pars[id][0]==109) { if (pars[id][3]!='') { pev.rows[x].cells[1].innerHTML+='<br><img src="m_r.gif" class="nav1"> <a href="http://basketball.wettpoint.com/tabellen/'+pars[id][3]+'.html" target="_blank">'+pars[id][4]+' Tabelle</a>'; };if (pars[id][1]>0 && pars[id][2]>0) { pev.rows[x].cells[1].innerHTML+='<br><img src="m_r.gif" class="nav1"> <a href="http://basketball.wettpoint.com/teams/'+pars[id][1]+'.html" target="_blank">Statistik Team 1</a> &nbsp; <img src="m_r.gif" class="nav1"> <a href="http://basketball.wettpoint.com/teams/'+pars[id][2]+'.html" target="_blank">Statistik Team 2</a><br><img src="m_rx.gif" class="nav1"> <a href="http://basketball.wettpoint.com/h2h/'+pars[id][1]+'-'+pars[id][2]+'.html" target="_blank">Head-to-Head Statistik</a>'; }; };
} else { pev.deleteRow(x);e["d"+id].i=0; };for (x=e[id].i;x<pev.rows.length;x++) {id=pev.rows[x].cells[0].getAttribute('id');e[id].i=x;};}
function ev_del(id) {e[id].s=0;bg[7]=bg[4];if (dp[id]>1) {bg[7]=pev.rows[e[id].i].cells[6].bgColor;pev.deleteRow(e[id].i);if (e["d"+id].i>0) {pev.deleteRow(e[id].i);e["d"+id].i=0;};dp[id]=1;};for (i=e[id].i;i<pev.rows.length;i++) {id=pev.rows[i].cells[0].getAttribute('id');if (pev.rows[i].cells[6]) {e[id].i=i;pev.rows[i].setAttribute('bgColor',bg[7]);pev.rows[i].cells[6].setAttribute('bgColor',bg[7]);if (bg[7]!=bg[4]) {bg[7]=bg[4]} else {bg[7]=bg[5]};};};}
function ev_new() {bg[7]=bg[4];dp = new Array();e = new Array();for (i=pev.rows.length-1;i>0;i--) {pev.deleteRow(i);};}
function ev_sta(id,po) {document.getElementById('n'+id).innerHTML=po.firstChild.nodeValue;switch (po.getAttribute("sta")) { case 'AC': { bg[8]='#009900';document.getElementById('n'+id).innerHTML='<b>'+po.firstChild.nodeValue+'</b>'; } break;case 'PO': { bg[8]='#ff9933'; } break;case 'IN': { bg[8]='#cc0000'; } break;case 'CA': { bg[8]='#cc0000'; } break;case 'FT': { bg[8]='#0000cc';document.getElementById('a'+id+'').innerHTML='';document.getElementById('n'+id).style.color='#333333';var tp=po.getAttribute("res").split(' : ');if (tp[0]>tp[1]) { document.getElementById('n'+id).innerHTML='<b>'+po.childNodes[1].firstChild.nodeValue+'</b> - '+po.childNodes[2].firstChild.nodeValue+''; } else if (tp[0]<tp[1]) { document.getElementById('n'+id).innerHTML=''+po.childNodes[1].firstChild.nodeValue+' - <b>'+po.childNodes[2].firstChild.nodeValue+'</b>'; }; } break;default : {bg[8]='#0000cc';} };document.getElementById('s'+id+'').style.backgroundColor=bg[8];document.getElementById('s'+id+'').innerHTML=po.getAttribute("sta");document.getElementById('s'+id+'').title='Spiel '+sw_stat(po.getAttribute("sta"));}
function ev_act(id,po) {var ct=Math.floor(((new Date().getTime()/1000)-po.getAttribute("tid"))/60);if (ct<0) {ct=0};if (po.getAttribute("cat")=="100") {if (ct>44 && ct<61) {ct=45;document.getElementById('s'+id+'').style.backgroundColor='#ff9900';document.getElementById('s'+id+'').innerHTML='HT';document.getElementById('s'+id+'').title='Halftime';} else if (document.getElementById('s'+id+'').innerHTML=='HT') {document.getElementById('s'+id+'').style.backgroundColor='#009900';document.getElementById('s'+id+'').innerHTML='AC';document.getElementById('s'+id+'').title='Spiel aktiv';};if (ct>60) { ct=Math.floor(ct-15);if(ct>90) {ct=90;document.getElementById('s'+id+'').innerHTML='OT';document.getElementById('s'+id+'').title='Overtime / Spiel aktiv'; }; };};document.getElementById('a'+id+'').innerHTML=ct+'\' ';}
function score() {if (document.getElementById('sport').width>80) { bg[10]=document.getElementById('sport').innerHTML;document.getElementById('sport').innerHTML='';document.getElementById('sport').width='1px'; } else { document.getElementById('sport').innerHTML=bg[10];document.getElementById('sport').width='90px'; }; }
function ev_snd(id) {if (e[id].s>0) {e[id].s=0} else {e[id].s=1};document.getElementById('m'+id).style.backgroundImage="url('lvc/"+bg[e[id].s]+"')";}
function doc_snd() {if (bg[3]<1) {bg[3]=1} else {bg[3]=0};document.images["GSI"].src='lvc/'+bg[bg[3]];}
function doc_boot() {checkup(bg[2]);if (document.getElementById("xltmp").innerHTML!=xltmp || xltmp.length<3){xltmp=document.getElementById("xltmp").innerHTML;livescores(bg[2]);xrun=1;}else{if(xrun>0){scores();};};setTimeout("doc_boot()",25000);}
function doc_tes(tcsa) {tcss=tcsa;};
function snd_init() {document.getElementById('spsd').innerHTML='';document.getElementById('spsd').innerHTML='<embed src="/eventsound.swf" id="esfnd" name="esfnd" autoplayervar="1" swliveconnect="true" quality="high" bgcolor="#9CBECF" width="1" height="1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';}
function sound() {document.embeds['esfnd'].Play();setTimeout("snd_init()",5000);};
function ev_ticker(c,inid) {var rs=480;if(pev.rows.length>17){rs=Math.floor(480+((pev.rows.length-17)*16));if(rs>695){rs=695};};window.open('score.php?inid='+inid+'','newWindow','width=840 height='+rs+',left=50,top=50,dependent=yes,location=no,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes');this.window.location.href='main.php';}
function ev_noe() {if(!pev.rows[1]) {pev.insertRow(1);pev.rows[1].insertCell(0);pev.rows[1].insertCell(1);pev.rows[1].cells[0].setAttribute('colSpan',7);pev.rows[1].cells[0].setAttribute('align','center');pev.rows[1].cells[0].innerHTML='<font size="2"><b>Derzeit keine Ereignisse von dieser Sportart vorhanden !</b></font>';};}
function checkup(cat) {xtmp=1;var xmlhttp=false;/*@cc_on @*/ /*@if (@_jscript_version >= 5) try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} catch (E) {xmlhttp=false;};}; @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') {xmlhttp=new XMLHttpRequest();};xmlhttp.open("HEAD","/lvc/"+cat+"/evt.xml",true);xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4) {document.getElementById("xltmp").innerHTML=xmlhttp.getResponseHeader("Last-Modified");};};xmlhttp.send(null);}
function sw_stat(sta) {var tmp ='';switch (sta) {case "AC":tmp+='aktiv';break;case "IN":tmp+='unterbrochen';break;case "CA":tmp+='abgebrochen';break;case "PO":tmp+='verschoben';break;case "FT":tmp+='beendet Endstand';break;default:tmp+='noch nicht gestartet';break;};return tmp;}