// JavaScript Document

function f_lavagna()	{
	
//[HomePage].Lavagna - legge: 'lavagne/lavagna.xml
var Mostra = ""; var StringaXml = DSO_lavagna_xml.XMLDocument;
var i;
Mostra += "<div class='Article_black' id='red'>"
	Mostra += "<H4>&nbsp;</H4>"
		Mostra += "<div class='ArticleBody_black'>"
			//for (i=0; i<5; i++){
			
			for (i=0; i<StringaXml.documentElement.childNodes.length; i++)	{
			
				torneo = StringaXml.documentElement.childNodes(i).childNodes(4).text;
			 //Mostra += "<table class='ruler' id='lavagna_quote' border='0' cellpadding='2' cellspacing='0'>"
		if (torneo != "") {
			Mostra += "<p>"
			//Mostra += "<span align='left' id='l_torneo'>"+ StringaXml.documentElement.childNodes(i).childNodes(4).text +"</span>"
			Mostra += "<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td id='l_torneo'>" + torneo + "</td></tr></table>"
			Mostra += "</p>"
			}//chiude if
		else {
		Mostra += "<p align='center'>"
					 Mostra += "<table id='lavagna_quote' class='ruler' width='95%' border='0' cellpadding='0' cellspacing='0'>"
						 Mostra += "<tr>"
							Mostra += "<td id='l_quote_left'>" + StringaXml.documentElement.childNodes(i).childNodes(1).text + "</td>"
							Mostra += "<td id='play1'>" + StringaXml.documentElement.childNodes(i).childNodes(0).text + "</td>"
							Mostra += "<td width='1%'>|</td>"
							Mostra += "<td id='play2'>" + StringaXml.documentElement.childNodes(i).childNodes(2).text + "</td>"
							Mostra += "<td id='l_quote_right'>" + StringaXml.documentElement.childNodes(i).childNodes(3).text + "</td>"
						 Mostra += "</tr>"
					 Mostra += "</table>"
		Mostra += "</p>"
		}
			}
		Mostra += "</div>"
		Mostra += "<div class='ArticleFooter_black'>"
			//Mostra += "<p id='link_dettagli'><a href='html/tennis.php'>lavagna completa...</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>"
			Mostra += "<p>&nbsp;</p>"
		Mostra += "</div>"
Mostra += "</div>"

lavagna_giornaliera.innerHTML = Mostra;
}

//----------------------------------------
function f_bill_summ()	{
/*
Bisogna tenere aggiornati:
- bill_summ_archivio.xml
- betting_tennis_mesecorrente.xml
- bill_summ_2009.xml
*/
	
//OGNI mese bisogna aggiungere "xxxyy" ----------------------
mesi_vet=["gen09"/*, "feb08", "mar08", "apr06", "mag06", "giu06"*/];//l'ultimo elemento del vettore deve essere il mese corrente
nomi_vet=["Gennaio"/*, "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno"*/];
nomi_bill_summ=["GENNAIO_09"/*, "FEBBRAIO_08", "MARZO_08", "APRILE_06", "MAGGIO_06", "GIUGNO_06"*/];
//------------------------------------------------------------
var Mostra = "";
//Gestisce quando si ha un solo mese, in pratica a Gennaio.
if (mesi_vet.length == 1)	
			{
				//Anni precedenti
				// Nella nuova versione, in home c'è il bilancio assoluto...poi in bilancio c'è il dettaglio.
				betting_anni_prec="xml/bilancio/bill_summ/bill_summ_archivio.xml";
				calcola_utile_anni(betting_anni_prec);
				utile_anni_prec=utile_totale_anni;
				stakes_anni_prec=stakes_totale_anni;
				//Mostra += "utile_anni_prec: " + utile_anni_prec;
				//Mostra += "stakes_anni_prec: " + stakes_anni_prec;
				//----------------------------------
			solo_gennaio="xml/bilancio/betting_tennis_mesecorrente.xml";
			calcola_utile(solo_gennaio);
			utile_solo_gennaio=utile_totale;//ritorna da calcola_utile
			stakes_solo_gennaio=stakes_totale;//ritorna da calcola_utile
			//Variabili visualizzate
			tot_utile=Math.round((utile_anni_prec+utile_solo_gennaio)*100)/100;
			tot_stakes=Math.round((stakes_anni_prec+stakes_solo_gennaio)*100)/100;
			tot_roi=Math.round((tot_utile/tot_stakes)*10000)/100;
			}
			else {
//Bilancio anni precedenti a quello in corso
betting_anni_prec="xml/bilancio/bill_summ/bill_summ_archivio.xml";
calcola_utile_anni(betting_anni_prec);
utile_anni_prec=utile_totale_anni;
stakes_anni_prec=stakes_totale_anni;
//Imposta il file relativo al bilancio dei mesi precedenti a quello corrente
betting_prec_xml="xml/bilancio/bill_summ/bill_summ_2009.xml";
//Richiama la funzione che fà i calcoli relativi per estrarre utile e stakes
calcola_utile(betting_prec_xml);
//appoggia i valori in altre variabili per richiamare poi la stessa funzione
utile_mesi_prec=utile_totale;
stakes_mesi_prec=stakes_totale;
j=0;
//------------- L'ho levata, ma bisogna vedere se al cambio mese serve...non dovrebbe servire ------
//f_bill_summ_mensile_y06(betting_prec_xml);			
//--------------------------------------------------------------------------------------------------
//Imposta k per caricare il file del mese corrente...l'ultimo del vettore mesi_vet
//Ora però il file del mese corrente si chiama diversamente
//k=(mesi_vet.length-1);
//Ripete gli stessi passi di prima
//betting_corr_xml="../xml/bilancio/betting_" + mesi_vet[k] + ".xml"
betting_corr_xml="xml/bilancio/betting_tennis_mesecorrente.xml"
calcola_utile(betting_corr_xml);
utile_mese_corr=utile_totale;
stakes_mese_corr=stakes_totale;
//-------------------------------------
//Variabili visualizzate
tot_utile=Math.round((utile_anni_prec+utile_mesi_prec+utile_mese_corr)*100)/100;
tot_stakes=Math.round((stakes_anni_prec+stakes_mesi_prec+stakes_mese_corr)*100)/100;
tot_roi=Math.round((tot_utile/tot_stakes)*10000)/100;
}//fine dell'else

Mostra += "<div class='Article' id='red'>"
//Mostra += "<H6><a href='html/bilancio.htm'>TENNIS</a> da Gennaio 2006</H6>"
Mostra += "<H4><a href='/html/tennis.php'><font color='#000000'>TENNIS</font></a></H4>"
Mostra += "<div class='ArticleBody'>"
Mostra += "<p title='...da quando è nato betblackboard: 2005'>"
	if (tot_utile <= 0)	
			{
			Mostra += "<I>Utile: </I><font color='red'><b>" + tot_utile + "</b></font> unità"
			}
			else {
			Mostra += "<I>Utile: </I><font color='green'><b>" + tot_utile + "</b></font> unità"
			}
Mostra += "</p>"
/*Mostra += "<p>"
	Mostra += "<I>Tot.giocato: </I><b><font color='blue'>" + tot_stakes + "</font></b> unità"
Mostra += "</p>"*/
Mostra += "<p>"
	if (tot_roi <= 0)	
			{
			Mostra += "<I>ROI: </I><font color='red'><b>" + tot_roi + "%" + "</b></font>"
			}
			else {
			Mostra += "<I>ROI: </I><font color='green'><b>" + tot_roi + "%" + "</b></font>"
			}
Mostra += "</p>"
Mostra += "</div>"
Mostra += "<div class='ArticleFooter'>"
Mostra += "<p align='center' class='sommario_footer'>"
	//Mostra += "<a href='/html/bilancio.php'><I>Bilancio</I></a><font color='#999999'>&bull;</font><a href='html/bilancio_2005.htm'><I>Archivio</I></a><font color='#999999'>&bull;</font><a href='#'><I>Tornei</I></a>"
	Mostra += "<a href='/html/bilancio.php'><I>Bilancio</I></a><font color='#999999'>&bull;</font><a href='/html/bilancio_tornei.php'><I>Tornei</I></a>"
Mostra += "</p>"
Mostra += "</div>"
Mostra += "</div>"

// scrive nel td con id=bill_summ_2005
bilancio.innerHTML = Mostra;
}

//---------------------------------------------
function calcola_utile_anni(file)	{

	var utile_txt = " ";var stakes_txt = " ";
	var utile_num;var stakes_num;
	somma_utile_anno=0; somma_stakes_anno=0; roi=0;
	var somma_utile_mese=0;var somma_stakes_mese=0;
	utile_totale_anni=0; stakes_totale_anni=0;
	
	objXml = new ActiveXObject("Microsoft.XMLDOM");
	objXml.async = false;
	objXml.load(file);
	// Leggo tutti i nodi del file col metodo getElementsByTagName()
	var utile = objXml.getElementsByTagName("PROFIT");//questo è un array.
	var stakes = objXml.getElementsByTagName("STAKES");//questo è un array.
	for (i=0; i<utile.length; i++)
			{
			utile_txt = utile[i].text;
			utile_num = parseFloat(utile_txt);//trasforma la stringa in valore numerico
			utile_totale_anni = utile_totale_anni + utile_num;
			//----------------
			stakes_txt = stakes[i].text;
			stakes_num = parseFloat(stakes_txt);//trasforma la stringa in valore numerico
			stakes_totale_anni = stakes_totale_anni + stakes_num;
			}	
}
//---------------------------------------------
function calcola_utile(file)	{
	var utile_txt = " ";var stakes_txt = " ";
	var utile_num;var stakes_num;
	somma_utile_anno=0; somma_stakes_anno=0; roi=0;
	var somma_utile_mese=0;var somma_stakes_mese=0;
	utile_totale=0; stakes_totale=0;
	
	objXml = new ActiveXObject("Microsoft.XMLDOM");
	objXml.async = false;
	objXml.load(file);
	// Leggo tutti i nodi del file col metodo getElementsByTagName()
	var utile = objXml.getElementsByTagName("U_UTILE");//questo è un array.
	var stakes = objXml.getElementsByTagName("U_GIOCATE");//questo è un array.
	for (i=0; i<utile.length; i++)
			{
			utile_txt = utile[i].text;
			utile_num = parseFloat(utile_txt);//trasforma la stringa in valore numerico
			utile_totale = utile_totale + utile_num;
			//----------------
			stakes_txt = stakes[i].text;
			stakes_num = parseFloat(stakes_txt);//trasforma la stringa in valore numerico
			stakes_totale = stakes_totale + stakes_num;
			}
}
//-------------------------------------------------------

function match_preview() {
//[HomePage].BetInCorso - legge: 'bilancio/betting_xxxyy.xml'
oggi = new Date()
data_yyyy = oggi.getDate() + "_" + oggi.getMonth() + "_" + oggi.getYear(); 
miadata = "MATCH_" + data_yyyy;
var Mostra = ""; var StringaXml = DSO_bet_preview.XMLDocument;
var i;
var player1,quota,player2,unita;
var flag;
var count=0;

Mostra += "<table id='contenitore_preview' width='100%' border='0'>"
Mostra += "<tr><td>&nbsp;</td><td width='45px'>Quota</td><td width='45px'>Unità</td></tr>"
//Mostra += "<tr><td><table width='100%' border='1'><tr><td id='preview_left_corner'>&nbsp;</td><td width='80%'>&nbsp;</td><td>&nbsp;</td></tr></table>"
//Mostra += "<tr><td>"

//Mostra += "<dl id='preview'>"
//Mostra += "<dt> </dt>"

for (i=0; i<StringaXml.documentElement.childNodes.length; i++) {
		testo = StringaXml.documentElement.childNodes(i).nodeName;
		player1=StringaXml.documentElement.childNodes(i).childNodes(2).text;
		quota=StringaXml.documentElement.childNodes(i).childNodes(5).text;
		player2=StringaXml.documentElement.childNodes(i).childNodes(3).text;
		unita=StringaXml.documentElement.childNodes(i).childNodes(11).text;
		//Gestione giocata multipla
		gioco = StringaXml.documentElement.childNodes(i).childNodes(4).text;
		multipla = StringaXml.documentElement.childNodes(i).childNodes(6).text;
		if (testo == miadata) {
						if (gioco=="singola"){
						
						Mostra += "<tr><td>"
						//Mostra += "<dd><p><b>" + player1 + "</b>@<b>" + quota + "</b> su " + player2 + "</p></dd>" ........PREC
						//Mostra += "<p><b>" + player1 + "</b>@<b>" + quota + "</b> su " + player2 + "</p>" .....OK
						Mostra += "<p><b>" + player1 + "</b></p>"
						Mostra += "</td>"
						Mostra += "<td>" + quota + "</td>"
						Mostra += "<td>" + unita + "</td>"
						Mostra += "</tr>"
						}
						else if (gioco=="multipla"){
							Mostra += "<tr><td>"
							Mostra += "<p><b>" + multipla + ", </b> <b>" + unita + "</b>u" + "  <b>" + quota + "</b></p>"
							Mostra += "</td></tr>"
						//Mostra += "<dd><b>" + multipla + ", </b> <b>" + unita + "</b>u" + "  <b>" + quota + "</b></dd>" ........PREC
							}//chiude if interno per giocata multipla
				count=count+1;
						}//chiude if
			else {flag="NOBET"}
		}
if (flag == "NOBET" && count==0) {
	//Mostra += "<dd><img src='images/nobet.gif'></dd>"
	//Mostra += "<dd><p>&nbsp;</p><p>NO BET</p></dd>"	
	Mostra += "<tr><td>"
	Mostra += "<p><b>NO BET</b></p>"
	Mostra += "</td>"
	Mostra += "<td>&nbsp;</td>"
	Mostra += "<td>&nbsp;</td>"
	Mostra += "</tr>"
}
Mostra += "</table>"
Mostra += "<table id='contenitore_preview_bottom' width='100%' border='0'>"
//Mostra += "<dd id='link_leggi'><a href='html/lavagna.htm'>leggi...</a></dd>"
Mostra += "<tr><td>"
Mostra += "<p id='link_leggi'><a href='html/lavagna.php'>dettagli...</a></p>"
Mostra += "</td></tr>"
//Mostra += "<dd id='link_leggi'><a href='html/lavagna.php'>dettagli...</a></dd>"
//Mostra += "</dl>"

//Mostra += "<tr><td><table width='100%' border='0'><tr><td >&nbsp;</td><td width='80%'>&nbsp;</td><td id='preview_right_corner'>&nbsp;</td></tr></table>"
//Mostra += "</td></tr></table>"
Mostra += "</table>"

bet_preview.innerHTML = Mostra;
}
//---------------------------------------------
function match_preview_calcio() {
//[HomePage].BetInCorso - legge: 'bilancio/betting_xxxyy.xml'
oggi = new Date()
data_yyyy = oggi.getDate() + "_" + oggi.getMonth() + "_" + oggi.getYear(); 
miadata = "MATCH_" + data_yyyy;
var Mostra = ""; var StringaXml = DSO_calciopreview.XMLDocument;
var i;
var player1,quota,player2,unita;
var flag;
var count=0;
/*Mostra += "<table id='contenitore_preview' width='100%' border='0'>"
Mostra += "<tr><td><table width='100%' border='0'><tr><td id='preview_left_corner'>&nbsp;</td><td width='80%'>&nbsp;</td><td>&nbsp;</td></tr></table>"
Mostra += "<tr><td>"*/
Mostra += "<table id='contenitore_preview' width='100%' border='0'>"
Mostra += "<tr><td>&nbsp;</td><td width='45px'>Quota</td><td width='45px'>Unità</td></tr>"

//Mostra += "<dl id='preview_calcio'>"
Mostra += "<dl>"
Mostra += "<dt> </dt>"
for (i=0; i<StringaXml.documentElement.childNodes.length; i++) {
		testo = StringaXml.documentElement.childNodes(i).nodeName;
		player1=StringaXml.documentElement.childNodes(i).childNodes(2).text;
		quota=StringaXml.documentElement.childNodes(i).childNodes(5).text;
		player2=StringaXml.documentElement.childNodes(i).childNodes(3).text;
		unita=StringaXml.documentElement.childNodes(i).childNodes(11).text;
		tipo=StringaXml.documentElement.childNodes(i).childNodes(15).text;
		pronostico=StringaXml.documentElement.childNodes(i).childNodes(16).text;
		//Gestione giocata multipla
		gioco = StringaXml.documentElement.childNodes(i).childNodes(4).text;
		multipla = StringaXml.documentElement.childNodes(i).childNodes(6).text;
		if (testo == miadata) {//prende solo le giocate del giorno corrente "miadata"
						if (gioco=="singola"){
							if (tipo=="HA"){
								//manipola l' HA separando i vari handicap
								var ha_vect = pronostico.split(",");
								num_set=(ha_vect.length);
								//--------------------
								if	(num_set==1) {//Un solo HA...NEW...x gestire in casa e fuori
									//Mostra += "<dd><b>" + ha_vect[0] + " - </b><font color='#6633ff'><b>" + unita + "</b>u@" + "<b>" + quota + "</b></font></dd>"
									//Mostra += "<dd><b>" + ha_vect[0] + " - </b><b>" + unita + "</b>u@" + "<b>" + quota + "</b></dd>"
									Mostra += "<dd><p><b>" + ha_vect[0] + " @" + "<b>" + quota + "</b></p></dd>"
								}
								/*if	(num_set==1) {//Un solo HA
									Mostra += "<dd><b>" + player1 + " " + ha_vect[0] + " - </b><font color='#6633ff'><b>" + unita + "</b>u@" + "<b>" + quota + "</b></font></dd>"
								}*/
								else if (num_set==2) {//NEW...x gestire in casa e fuori
									//Mostra += "<dd><b>" + ha_vect[0] + "&" + ha_vect[1] + " - </b><font color='#6633ff'><b>" + "" + unita + "</b>u@" + "<b>" + quota + "</b></font></dd>"
									//Mostra += "<dd><b>" + ha_vect[0] + "&" + ha_vect[1] + " - </b><b>" + "" + unita + "</b>u@" + "<b>" + quota + "</b></dd>"
									Mostra += "<dd><p><b>" + ha_vect[0] + "&" + ha_vect[1] + " @" + "<b>" + quota + "</b></p></dd>"
								}
								/*else if (num_set==2) {
									Mostra += "<dd><b>" + player1 + " " + ha_vect[0] + "&" + ha_vect[1] + " - </b><font color='#6633ff'><b>" + "" + unita + "</b>u@" + "<b>" + quota + "</b></font></dd>"
								}*/
								
							}//chiude if tipo==HA
						else {//se il gioco==singola, ma non è HA
							//Mostra += "<dd><b>" + player1 + " - " + player2 + " " + pronostico + " - </b><font color='#6633ff'><b>" + unita + "</b>u@" + "<b>" + quota + "</b></font></dd>"
							Mostra += "<dd><p><b>" + pronostico + " </b>@" + "<b>" + quota + "</b></font></p></dd>"
							}//chiude questo else vicino
						}//chiude if gioco==singola
						else if (gioco=="multipla"){
						Mostra += "<dd><b>" + multipla + " - </b><font color='#6633ff'><b>" + unita + "</b>u@" + "<b>" + quota + "</b></font></dd>"
							}//chiude if gioco==multipla
						count=count+1;
						}//chiude if pricipale testo==miadata
						else {flag="NOBET"}
		}
if (flag == "NOBET" && count==0) {
	//Mostra += "<dd><img src='images/nobet.gif'></dd>"
	//Mostra += "<dd><p>&nbsp;</p><p>NO BET</p></dd>"
	Mostra += "<tr><td>"
	Mostra += "<p><b>NO BET</b></p>"
	Mostra += "</td>"
	Mostra += "<td>&nbsp;</td>"
	Mostra += "<td>&nbsp;</td>"
	Mostra += "</tr>"
	
}
Mostra += "</table>"

Mostra += "<table id='contenitore_preview_bottom' width='100%' border='0'>"
//Mostra += "<dd id='link_leggi'><a href='html/lavagna.htm'>leggi...</a></dd>"
Mostra += "<tr><td>"
Mostra += "<p id='link_leggi'><a href='html/lavagna.php'>dettagli...</a></p>"
Mostra += "</td></tr>"

//Mostra += "<tr><td><table width='100%' border='0'><tr><td >&nbsp;</td><td width='80%'>&nbsp;</td><td id='preview_right_corner'>&nbsp;</td></tr></table>"
Mostra += "</table>"

calcio_preview.innerHTML = Mostra;
}
//------------------------------
//----------------------------------------
function f_bill_summ_calcio()	{

var Mostra = "";

betting_corr_xml="xml/bilancio/calcio_betting_unico.xml";

calcola_utile(betting_corr_xml);
utile_mese_corr=utile_totale;
stakes_mese_corr=stakes_totale;
//-------------------------------------
//Variabili visualizzate
tot_utile=Math.round((utile_mese_corr)*100)/100;
tot_stakes=Math.round((stakes_mese_corr)*100)/100;
tot_roi=Math.round((tot_utile/tot_stakes)*10000)/100;;


Mostra += "<div class='Article' id='red'>"
Mostra += "<H4><a href='/html/calcio.php'><font color='#000000'>CALCIO</font></a></H4>"
Mostra += "<div class='ArticleBody'>"
Mostra += "<p>"
	if (tot_utile <= 0)	
			{
			Mostra += "<I>Utile: </I><font color='red'><b>" + tot_utile + "</b></font> unità"
			}
			else {
			Mostra += "<I>Utile: </I><font color='green'><b>" + tot_utile + "</b></font> unità"
			}
Mostra += "</p>"
/*Mostra += "<p>"
	Mostra += "<I>Tot.giocato: </I><b><font color='blue'>" + tot_stakes + "</font></b> unità"
Mostra += "</p>"*/
Mostra += "<p>"
	if (tot_roi <= 0)	
			{
			Mostra += "<I>ROI: </I><font color='red'><b>" + tot_roi + "%" + "</b></font>"
			}
			else {
			Mostra += "<I>ROI: </I><font color='green'><b>" + tot_roi + "%" + "</b></font>"
			}
Mostra += "</p>"
Mostra += "</div>"
Mostra += "<div class='ArticleFooter'>"
Mostra += "<p align='center' class='sommario_footer'>"
	Mostra += "<a href='/html/bilancio_calcio.php'><I>Bilancio</I></a> - <a href='#'><I>Archivio</I></a>"
Mostra += "</p>"
Mostra += "</div>"
Mostra += "</div>"

bilancio_calcio.innerHTML = Mostra;
}
//------------------------------------------------------------------------
function esposizione_tot() {
//Chiama f_esposizione()
var Mostra = ""; 

file_betting_tennis="xml/bilancio/betting_tennis_mesecorrente.xml";
file_betting_calcio="xml/bilancio/calcio_betting_unico.xml";

exp_tennis=f_esposizione(file_betting_tennis);//Esposizione tennis--------
exp_calcio=f_esposizione(file_betting_calcio);//Esposizione calcio--------

exp_totale=exp_tennis+exp_calcio;
//Mostra += "<p align='right'> Esposizione = <b>" + exp_totale + "</b> unità</p>" 
Mostra += "<p> Esposizione = <b>" + exp_totale + "</b> u</p>" 
esp.innerHTML = Mostra;
}
//------------------------------
//-----------------------------------------------------------------------------------
function f_esposizione(file) {
	oggi = new Date()
	data_yyyy = oggi.getDate() + "_" + oggi.getMonth() + "_" + oggi.getYear(); 
	miadata = "MATCH_" + data_yyyy;
//Load file xml	
	objXml = new ActiveXObject("Microsoft.XMLDOM");
	objXml.async = false;
	objXml.load(file);
//crea un array di tutti i nodi con miadata
	var daily_betting = objXml.getElementsByTagName(miadata);//prende solo i nodi miadata....active bet
	
	var esposizione_totale = 0; 
	var counter = 0;
	var somma_quote = 0;
	
	for (i=0;i<daily_betting.length;i++)
		{
		var quota = parseFloat(daily_betting[i].childNodes[5].text);//[5]
		var u_giocate = parseFloat(daily_betting[i].childNodes[11].text);//[11]

		esposizione_totale = Math.round((esposizione_totale + u_giocate)*10)/10;
		somma_quote = Math.round((somma_quote + quota)*100)/100;//arrotonda a 2 cifre
		counter = counter + 1;
	}//fine del for
	if	(counter==0) {counter=1;}
	
	var quota_media=Math.round((somma_quote/counter)*100)/100;//arrotonda a due cifre decimali
	
	//scrivi.document.writeln("- <b>Bet in corso</b>: esposizione= <b>" + esposizione_totale + "</b>u. , q.media= " + quota_media + "<br \/>");
	return esposizione_totale;
}
//-----------------------------------------------------------------------------------
//------------------------------
/*function startList() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}*/
//-----------------------------------------------------------------------------------------------------
function tableruler()
{
 if (document.getElementById && document.createTextNode)
  {
   var tables=document.getElementsByTagName('table');
   for (var i=0;i<tables.length;i++)
   {
    if(tables[i].className=='ruler')
    {
     var trs=tables[i].getElementsByTagName('tr');
     for(var j=0;j<trs.length;j++)
     {
      if(trs[j].parentNode.nodeName=='TBODY' && trs[j].parentNode.nodeName!='TFOOT')
       {
       trs[j].onmouseover=function(){this.className='ruled';return false}
       trs[j].onmouseout=function(){this.className='';return false}
     }
    }
   }
  }
 }
}
//------------------------------
//***********************	MAIN	***************************************
f_bill_summ();
f_bill_summ_calcio();
esposizione_tot();
match_preview();
match_preview_calcio();
f_lavagna();
//f_tournaments();
//f_month_tournaments();
tableruler();
//startList();
//--------------------------------------------------------
