<!--
// copyright 2007, Joachim Loeffel
// insert the 1024 header to my TDA pages

// image array
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
for (i=0; i<14;i++)
{
  fadeimages[i]=["designs/images/1024/joe"+i+".jpg", "", ""];
}


//Set the two dates
days_en="SunMonTueWedThuFriSat";
month_en="JanFebMarAprMayJunJulAugSepOctNovDec";
days_de="So.Mo.Di.Mi.Do.Fr.Sa.";
month_de="JanFebMarAprMaiJunJulAugSepOktNovDez";
var days = days_en;
var month = month_en;
if (my_locale == "de")
{
  days = days_de; 
  month = month_de;
}

var now=new Date();
now.date=now.getDate();
now.month=now.getMonth();
now.day=now.getDay();
now.year=now.getYear()+1900;
var width=5;

var started=new Date(2008, 0, 12) //Month is 0-11 in JavaScript
//Set 1 day in milliseconds
var one_day=1000*60*60*24
var txt=days.substr(now.day*3,3)+' '+now.date+'. '+month.substr(now.month*3,3)+' '+now.year+': ';
//Calculate difference btw the two dates, and convert to days
var delta=Math.ceil((now.getTime()-started.getTime())/(one_day));

var header_txt = '';
header_txt += '      <map name="countrybar">';
header_txt += '       <area title="Section 1" shape="rect" coords="  1,0,160,52" href="sec_01_pharaoh.html?locale='+my_locale+'" alt="Section 1" target="_self">';
header_txt += '       <area title="Section 2" shape="rect" coords="158,0,290,52" href="sec_02_gorge.html?locale='+my_locale+'" alt="section 2" target="_self">';
header_txt += '       <area title="Section 3" shape="rect" coords="288,0,393,52" href="sec_03_meltdown.html?locale='+my_locale+'" alt="Section 3" target="_self">';
header_txt += '       <area title="Section 4" shape="rect" coords="391,0,490,52" href="sec_04_snow.html?locale='+my_locale+'" alt="Ssection 4" target="_self">';
header_txt += '       <area title="Section 5" shape="rect" coords="488,0,578,52" href="sec_05_gin.html?locale='+my_locale+'" alt="Section 5" target="_self">';
header_txt += '       <area title="Section 6" shape="rect" coords="576,0,676,52" href="sec_06_zone.html?locale='+my_locale+'" alt="Section 6" target="_self">';
header_txt += '       <area title="Section 7" shape="rect" coords="674,0,810,52" href="sec_07_elephant.html?locale='+my_locale+'" alt="Section 7" target="_self">';
header_txt += '       <area title="Section 8" shape="rect" coords="812,0,939,52" href="sec_08_diamond.html?locale='+my_locale+'" alt="Section 8" target="_self">';
header_txt += '       <area title="Section 9" shape="rect" coords="940,0,985,52" href="sec_08_safrica.html?locale='+my_locale+'" alt="Section 9" target="_self">';
header_txt += '      </map>';
header_txt += '<table background="designs/images/i.gif" cellpadding="0" cellspacing="0" border="0" width="989">';
header_txt += '<tr>';
header_txt += '  <td valign="top" width="521">';
header_txt += '    <table background="designs/images/1024/logo_bg.gif" cellpadding="0" cellspacing="0" border="0" width="521">';
header_txt += '      <tr>';
header_txt += '        <td colspan="2"><img height="31" width="521" src="designs/images/1024/top.gif"></td>';
header_txt += '      </tr>';
header_txt += '      <tr>';
// today=new Date();
// i = today.getSeconds()%14;
// header_txt += '        <td background="designs/images/1024/logo_bg.gif" width="141" align="right"><img src="designs/images/1024/joe'+i+'.jpg"></td>';
header_txt += '        <td background="designs/images/1024/logo_bg.gif" width="141" align="center"><script type="text/javascript">';
// header_txt += '   //new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)';
header_txt += '        new fadeshow(fadeimages, 131, 102, 0, 5000, 1, "R")';
header_txt += '        </script></td>';
header_txt += '        <td align="right" width="380"><img height="102" width="380" src="designs/images/1024/pyramids1b.jpg"></td>';
header_txt += '      </tr>';
header_txt += '      <tr>';
header_txt += '        <td colspan="2"><img height="36" width="521" src="designs/images/1024/tda-slogan.png"></td>';
header_txt += '      </tr>';
header_txt += '    </table>';
header_txt += '  </td>';
header_txt += '  <td background="designs/images/1024/tablemountain1b.jpg" height="169" width="468" align="left">';
header_txt += '    <table cellpadding="0" cellspacing="0" border="0" height="162" width="459" >';
header_txt += '      <tr>';
header_txt += '        <td valign="bottom" align="right">';
header_txt += '          <a title="Homepage of Tour d Afrique" href="http://www.tourdafrique.com/tourdafrique" target="_blank">';
header_txt += '            <img height="26" width="118" title="Visit the Tour Organizer" alt="tda link" src="designs/images/1024/tda-name-118x26.jpg" align="right" border="0">';
header_txt += '          </a>';
header_txt += '        </td>';
header_txt += '      </tr>';
header_txt += '    </table>';
header_txt += '  </td>';
header_txt += '  <tr>';
header_txt += '    <td colspan="4" align="left" height="51" width="985">';
header_txt += '     <img height="51" width="985" border="0" alt="countries" src="designs/images/1024/countrybar985x52.jpg" usemap="#countrybar"/>';
header_txt += '    </td>';
header_txt += '  </tr>';
header_txt += '</tr>';
header_txt += '</table>';


if (delta > 0) {
// timeline 
header_txt += '<tr>';
header_txt += '  <div align="center">';
header_txt += '  <td colspan="4">';
header_txt += '    <table border="0" cellpadding="0" cellspacing="0">';
header_txt += '      <tr>';
header_txt += '        <td width="5" height="10"></td>';
header_txt += '        <td width="5" height="10" background="designs/images/progress-1x10.gif"></td>';

// print process indicator

  for (i=1;i<delta;i++) {
    if (i < 82) width=7;
    else if (i >= 82 & i < 92) width =9;
    else if (i >= 92 & i < 105) width =13;
    else if (i >= 105) width =7;

    if (i%20 == 0) {
      header_txt += '        <td width="6" height="10" background="designs/images/progress-1x10.gif"></td>';
    }
    header_txt += '        <td width="'+width+'" height="10" background="designs/images/progress-1x10.gif"></td>';
    if (i > 121) break;
  }
  header_txt += '        <td rowspan="1" width="5" height="5"><img height="5" width="5" src="designs/images/brownarrowhead.gif"></td>';
  header_txt += '        <td rowspan="1" width="5" height="5"><img height="10" width="13" src="designs/images/biker.gif"></td>';
header_txt += '      </tr>';
header_txt += '    </table>';
header_txt += '  </div>';
header_txt += '  </td>';
header_txt += '</tr>';
}
header_txt += '<tr>';

var t1 = ' days left until we start into the tour!';
var t2 = ' Tomorrow is the day!';
var t3 = ' day into the tour! Still 119 days to go.';
var t4 = 'th and final tour day!';
var t5 = ' days into the tour! Still ';
var t5a= ' days ahead of us.';
if (delta == 119) t5a= ' day of cycling remaining.';
var t6 = '&nbsp;&nbsp;&nbsp;Done!!! I arrived in Cape Town on May 10th. After 94 cycling days and 11565km I arrived at the final destination ';

if (my_locale == "de")
{
  t1 = ' Tage bis die Tour beginnt!';
  t2 = ' Morgen ist der gro&szlig;e Tag!';
  t3 = ' Tag auf der Tour! Noch 119 Tage liegen vor uns.';
  t4 = '-ter und letzter Tag der Tour!';
  t5 = ' Tage auf der Tour! Noch ';
  if (delta != 119) t5a= ' Tage liegen vor uns.'; else t5a= ' Tag Radfahren bis zum Ziel.';
  t6 = '&nbsp;&nbsp;&nbsp;Geschafft!! Am 10. Mai bin ich in Kapstadt angekommen. Nach 94 Tagen auf dem Rad und 11565km habe ich das Ziel erreicht.';
}

if (delta <= -1)
{
  header_txt += '  <td colspan="4"><font id="tickerhead">&nbsp;&nbsp;&nbsp;'+txt+'</font><font id="tickerhead1">'+(-1)*(delta-1)+'</font><font id="tickerhead">'+t1+'</font></td>';
}
else if (delta == 0)
{
  header_txt += '  <td colspan="4"><font id="tickerhead">&nbsp;&nbsp;&nbsp;'+txt+t2+'</font></td>';
}
else if (delta == 1)
{
  header_txt += '  <td colspan="4"><font id="tickerhead">&nbsp;&nbsp;&nbsp;'+txt+'</font><font id="tickerhead1">'+delta+'</font><font id="tickerhead">'+t3+'</font></td>';
}
else if (delta == 120)
{
  header_txt += '  <td colspan="4"><font id="tickerhead">&nbsp;&nbsp;&nbsp;'+txt+'</font><font id="tickerhead1">'+delta+'</font><font id="tickerhead">'+t4+'</font></td>';
}
else if (delta < 121)
{
  header_txt += '  <td colspan="4"><font id="tickerhead">&nbsp;&nbsp;&nbsp;'+txt+'</font><font id="tickerhead1">'+delta+'</font><font id="tickerhead">'+t5+'</font><font id="tickerhead">'+(120-delta)+'</font><font id="tickerhead">'+t5a+'</font></td>';
}
else 
{
  header_txt += '  <td colspan="4"><font id="tickerhead">&nbsp;&nbsp;&nbsp;'+txt+'</font><font id="tickerhead">'+t6+'</font></td>';
}

header_txt += '</tr>';

// end timeline
-->