// JavaScript Document
var ds=new Array(7); ds[0]="ΚΥΡ"; ds[1]="ΔΕΥ"; ds[2]="ΤΡΙ"; ds[3]="ΤΕΤ"; ds[4]="ΠΕΜ"; ds[5]="ΠΑΡ"; ds[6]="ΣΑΒ";
var sl=0
var bl=0
var rown=0;
function r(val) {return "<font color=red><b>"+val+"</b></font>"}
function redcard1(c1) {if (c1>0) {return "<img src='graphics/rcard.gif' align='absmiddle'/><font color=red><b>"+c1+"</b></font>"} else {return ""}}
function redcard2(c1) {if (c1>0) {return "<font color=red><b>"+c1+"</b></font><img src='graphics/rcard.gif' align='absmiddle'/>"} else {return ""}}
function team1(n,c1) {return n + "&nbsp;" + redcard1(c1)}
function team2(n,c1) {return redcard2(c1)+ "&nbsp;" + n}
function cell (val,cl) { return "<td class=" + cl + ">"+val+"</td>" }
function hmCell (val,cl) { return "<td nowrap class=" + cl + ">"+val+"</td>" }
function linkCell (val,cl,id,k) { return "<td nowrap class="+cl+"><a style=\"font-weight: bold;\" onclick=\'window.open(\"showscorers.asp?k="+k+"&mid="+id+"\",\"scorers\",\"location=no,toolbar=no,status=no,width=150,height=150,top=0,left=0\")\'>"+val+"</a></td>"}
function livecell (sc,st,cl) {if (st==1) {return hmCell(r(sc),cl)} else {return hmCell(sc,cl)}}
function livecellf (sc,st,cl,id,koupno) {if (st==1) {return linkCell(r(sc),cl,id,koupno)} else {return linkCell(sc,cl,id,koupno)}}
function m(t,h) { var r=t+1+"\'"; if (t>89) {r="90\'+"}; if ((t>44) && (h=='')) {r="45\'+"}; return r }
function scorecell (val,val2,cl,tim,st,ht) {if ((tim==0) && (st=='')) {val=''}; if (st==2) {val="<font color=gray>HM.</font>"}; if ((tim>0) && ((st==0) || (st==1))) {val="<font color=green>"+m(parseInt(tim/60),ht)+"</font>"}; 
	return "<td nowrap class="+cl+"><b>"+val+"</b></td><td nowrap class=dior><b>"+val2+"</b></td>"}
function scorecellb (val,cl,tim,st) {if ((tim==0) && (st=='')) {val=''}; if (st==2) {val="<font color=gray>HM.</font>"}; if ((tim>0) && ((st==0) || (st==1))) {val="<font color=green>"+parseInt(tim/60)+"</font>"};
	return "<td nowrap class="+cl+"><b>"+val+"</b></td>"}
function line (di,or,co,ee,as,pg,gi,xi,fi,pf,dip,sc,ht,fin,apot,st,c1,c2,tim,ful,ind,ch,id,koupno) {
	if ((sc=='') && (st==0)) {showit=0} else {showit=1};
	if ((showit==1) || ((rown<8) && ((sc=='') || (st==0)))) {showit=1};
	if ((st>4) && (ch=='')) {showit=0};
	if (ful==1) {showit=1};
	if (showit==1) {
	rown=rown+1;
	document.write ("<tr>");
    document.write ( cell(di,'dior')+cell(or,'ora')+cell(co,'code')+cell(ee,'ee')+cell(as,'sim')+
	cell(pg,'pleon')+cell(team1(gi,c1),'team1')+cell(xi,'sim')+cell(team2(fi,c2),'team2')+cell(pf,'pleon')+
	cell(dip,'sim')+livecellf(sc,st,'final',id,koupno)+hmCell(ht,'dior')+scorecell(fin,apot,'final',tim,st,ht));
	document.write("</tr>");
	if (ful==0) {
	if ((st==1) || (st==8)) {
		if (sl==0) {sl=1; parent.document.getElementById("scroller2").innerHTML=''};
		var m = parent.document.getElementById("scroller2").innerHTML;
		if (st==1) {
		m = "<font color=\'#ffcc00\'>"+co+".</font> "+gi+"-"+fi+" <font color=lightgreen>"+sc+"</font> &nbsp;" + m ; }
		if (st==8) {m=m+"<font color=\'#ffcc00\'>"+co+".</font> "+gi+"-"+fi+" "+fin+ "<font color=\'#cccccc\'> (ΤΕΛ.)</font>"+" &nbsp;";}
		parent.document.getElementById("scroller2").innerHTML=m;
	}}
	}}
function bline (di,or,co,ee,pg,gi,fi,pf,sc,s1,s2,s3,s4,ap,st,tim) {
	document.write ("<tr>")
    document.write ( cell(di,'dior')+cell(or,'ora')+cell(co,'code')+cell(ee,'ee')+cell(pg,'pleonb')+cell(gi,'team1')+cell(fi,'team2')+cell(pf,'pleonb')+livecell(sc,st,'final')+hmCell(s1,'sim2')+hmCell(s2,'sim2')+hmCell(s3,'sim2')+hmCell(s4,'final')+scorecellb(ap,'final',tim,st));
	document.write("</tr>");
	if (st==1) {
		if (bl==0) {bl=1; parent.document.getElementById("scroller2").innerHTML=''}
		var m = parent.document.getElementById("scroller2").innerHTML;
		m = m+"<font color=\'#ffcc00\'>"+co+".</font> "+gi+"-"+fi+" "+sc+" &nbsp;";
		parent.document.getElementById("scroller2").innerHTML=m;
	}}
function dcell (im,im2,cl) { return "<td class="+cl+">"+ds[im]+" "+im2+"</td>" }
function grline (im,im2,or,gi,fi,sc,ht,fin,apot,st,c1,c2,tim,ch) {
	document.write ("<tr>");
    document.write ( dcell(im,im2,'dior')+cell(or,'ora')+cell(team1(gi,c1),'team1')+cell(team1(fi,c2),'team1')+livecell(sc,st,'final')+hmCell(ht,'dior')+scorecell(fin,apot,'final',tim,st,ht));
	document.write("</tr>");
	}
				  
