/* $Id: piste.js,v 1.3 2008/06/07 11:34:16 Mario Exp $ */
/*
  Copyright (c) 2002-2008 Mario Cimento - cimario@tiscali.it --- http://creativecommons.org/licenses/by-nc-nd/2.5/it/
  Script per scrivere la pagina delle piste
*/
function write_track(A){if((typeof (A)!="object")||(typeof (A.name)!="string")||(typeof (A.plant)!="object")||(typeof (A.albo)!="object")||(typeof (A.records)!="object")){return }document.write('<div align="center"><a name="'+A.name+'"></a>');document.write("<br>");document.write("</div>");document.write('<table width="500" align="center" border="1" bgcolor="#aaaa22"');document.write('       bordercolor="#555555" bordercolordark="#000000" bordercolorlight="#CCCCCC">');document.write('  <tr><td width="100%" align="center" valign="top">');document.write('    <table width="100%" border="0">');document.write('      <tr><td bgcolor="#eeeedd">');document.write('        <table style="font-family:Verdana;" border="2" width="100%" bordercolor="#0000FF" bordercolordark="#008000" bordercolorlight="#003030">');document.write("          <tr>");document.write('            <td bgcolor="#eeeedd" align="center" width="100%">');document.write('              <div align="center" style="font-size:18pt;color:#000000"><b>'+A.title+"</b></div>");document.write('              <div align="center" style="font-size:16pt;"><b>'+A.loc+"</b></div>");document.write('              <div align="center" style="font-size:12pt;"><b>'+A.addr+"</b></div>");if(A.url.length>0){document.write('            <a href="'+A.url+'" target="_blank" style="font-size:18pt;color:#000000">');document.write('              <img border="0" src="../images/www_ani.gif">');document.write("            </a>")}document.write("            </td>");document.write("          </tr>");if(typeof (A.map)=="string"){document.write('          <tr><td bgcolor="#ffffff" align="center" width="100%">');document.write('            <table width="90%" cellspacing="0" cellpadding="0" border="0" align="center">');document.write('              <tr><td align="center" width="100%">');document.write(A.map);document.write("              </td></tr>");document.write("            </table>");document.write("          </td></tr>")}else{if((typeof (A.map_url)=="string")&&(A.map_url.length>0)){document.write('          <tr><td bgcolor="#ffffff" align="center" width="100%">');document.write('            <table width="90%" cellspacing="0" cellpadding="0" border="0" align="center">');document.write('              <tr><td align="center" width="100%">');document.write('                <a href="'+A.map_url+'" target="_blank">');document.write('                 <img border="0" src="../images/mappa_ani.gif"><br>');document.write('                 <img border="0" src="'+A.map_img+'">');document.write("                </a>");document.write("              </td></tr>");document.write("            </table>");document.write("          </td></tr>")}}plants=A.plant;plants_n=plants.length;document.write('          <tr><td bgcolor="#ffffff" align="center" width="100%">');document.write('            <table width="90%" cellspacing="0" cellpadding="0" border="0" align="center">');for(p=0;p<plants_n;p++){document.write('            <tr><td align="center" width="100%">');if(plants[p].tit.length>0){document.write('              <font face="Tahoma" size="2"><b>'+plants[p].tit+"</b></font><br>")}document.write('              <img src="'+plants[p].url+'">');document.write("            </td></tr>");if(p<(plants_n-1)){document.write('          <tr><td colspan="2"><hr></td></tr>')}}document.write("            </table>");document.write("          </td></tr>");albo=A.albo;albo_n=albo.length;document.write('          <tr><td bgcolor="#ffdddd" align="center" width="100%">');document.write('            <font size="1"><br></font><font size="4" color="#ee2222"><b>Albo d\'Oro</b></font>');document.write('            <table width="90%" cellspacing="0" cellpadding="0" border="0" align="center">');document.write('              <tr><td colspan="2"><hr></td></tr>');for(a=0;a<albo_n;a++){document.write('            <tr valign="top">');document.write('              <td width="210" align="left"><font face="Verdana" size="2"><b>'+albo[a].year+" - "+albo[a].pil+"</b></font></td>");document.write('              <td align="right"><font face="Verdana" size="1"><b>'+albo[a].race+"</b></font></td>");document.write("            </tr>");document.write('            <tr><td colspan="2"><hr></td></tr>')}document.write("            </table>");document.write("          </td></tr>");recs=A.records;recs_n=recs.length;document.write('          <tr><td bgcolor="#ddffdd" align="center" width="100%">');document.write('            <font size="1"><br></font><font size="4" color="#229922"><b>Record</b></font>');document.write('            <table width="90%" cellspacing="0" cellpadding="0" border="0" align="center">');document.write('              <tr><td colspan="2"><hr></td></tr>');for(r=0;r<recs_n;r++){if(recs[r].rec_title.length>0){document.write('            <tr valign="top">');document.write('              <td bgcolor="#000000" colspan="2" align="center"><font face="Verdana" size="2" color="#eeee66"><b>'+recs[r].rec_title+"</b></font></td>");document.write("            </tr>")}document.write('            <tr valign="top"><td align="left" colspan="2">');document.write('              <font face="Verdana" size="2">Sul giro:</font>');document.write("            </td></tr>");document.write('            <tr valign="top">');document.write('              <td align="left">');document.write('                <font face="Verdana" size="2"><b>'+recs[r].lap_time+"</b></font>");document.write("              </td>");document.write('              <td align="left">');document.write('                <font face="Verdana" size="2"><b>'+recs[r].lap_pil+'</font> <font size="1">('+recs[r].lap_year+")</b></font>");document.write("              </td>");document.write("            </tr>");document.write('            <tr valign="top"><td colspan="2"><font size="1">&nbsp;</font></td></tr>');document.write('            <tr valign="top"><td colspan="2">');document.write('              <font face="Verdana" size="2">Sulla distanza ('+recs[r].race_laps+"):</font>");document.write("            </td></tr>");document.write('            <tr valign="top">');document.write('              <td width="100" align="left">');document.write('                <font face="Verdana" size="2"><b>'+recs[r].race_time+"<br>"+recs[r].race_avspd+"</b></font>");document.write("              </td>");document.write('              <td align="left">');if(recs[r].race_pil.length>0){document.write('                <font face="Verdana" size="2"><b>'+recs[r].race_pil+'</font> <font size="1">('+recs[r].race_year+")</b></font>")}document.write("              </td>");document.write("            </tr>");document.write('            <tr><td colspan="2"><hr></td></tr>')}document.write("            </table>");document.write("          </td></tr>");document.write("        </table>");document.write("      </td></tr>");document.write("    </table>");document.write("  </td></tr>");document.write("</table>")}
