<!--
// Along for the ride
// By Mar Matthias Darin
// Copyright (C) 2009 All Rights Reserved

var AFTR18009timer;
var AFTR18009Postimer;
var AFTR18009startTime;
var AFTR18009endTime;

var AFTR18009x1=0, AFTR18009x2=0;
var AFTR18009y1=0, AFTR18009y2=0;
var AFTR18009h=0, AFTR18009w=0;

function AFTR18009FixPrecision(num)
  {
    var stringNum = String(num);

    if (stringNum.indexOf('.')==-1)
      return stringNum+'.00';

    var newNum = stringNum.split('.');

    newNum[1]=(newNum[1].length>2)?newNum[1].subString(0,2):newNum[1];

    if (newNum[1].length==1)
      newNum[1]+='0';

    return newNum[0]+'.'+newNum[1];
  }

function AFTR18009StopTime()
  {
    AFTR18009endTime=new Date();

    var a='Loaded: '+AFTR18009FixPrecision((AFTR18009endTime-AFTR18009startTime)/1000)+'s';

    document.getElementById('AFTR18009endTime').innerHTML=a;
  }

function AFTR18009SetSize()
  {
    var mx=0, my=0, tx=0, ty=0;
    var scrOfX=0, scrOfY=0;

    if(typeof(window.innerWidth) == 'number')
      {
        mx = window.innerWidth - 16;
        my = window.innerHeight;
      }
    else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
      {
        mx = document.documentElement.clientWidth;
        my = document.documentElement.clientHeight;
      }
    else if(document.body && (document.body.clientWidth || document.body.clientHeight))
      {
        mx = document.body.clientWidth;
        my = document.body.clientHeight;
      }

    if(typeof(window.pageYOffset) == 'number')
      {
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
      }
    else if(document.body && (document.body.scrollLeft || document.body.scrollTop))
      {
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      }
    else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
      {
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
      }

    tx=parseInt(mx/10);
    ty=parseInt(my/10);
    AFTR18009x1=tx;
    AFTR18009y1=ty;
    AFTR18009x2=mx-tx;
    AFTR18009y2=my-ty;
    AFTR18009w=AFTR18009x2-tx;
    AFTR18009h=AFTR18009y2-ty;
  }

function AFTR18009Show()
  {
    document.getElementById("AFTR18009endTime").innerHTML="Loading...";
    AFTR18009startTime=new Date();
    var o=document.getElementById('AFTR18009');
    var o=document.getElementById('AFTR18009');
    var fs=o.style.height;

    AFTR18009SetSize();
    o.style.top=AFTR18009y1 + 'px';
    o.style.left=AFTR18009x1 + 'px';
    o.style.width=AFTR18009x2 + 'px';
    o.style.height=AFTR18009y2 + 'px';

    document.getElementById('AFTR18009Body').style.width=AFTR18009w + 'px';
    document.getElementById('AFTR18009Body').style.height=(AFTR18009h-60) + 'px';
    document.getElementById('AFTR18009Link').href = "http://becausesomeonecares.com";
    document.getElementById('AFTR18009Ad').innerHTML = "<object id='AFTR18009ObjectAd' data='http://matthiaschronicles.tanaya.net/AFTR/TopAd.html' type='text/html' style='overflow: hidden;' width=320 height=60></object>";
    document.getElementById('AFTR18009Body').innerHTML = "<object id='AFTR18009ObjectBody' data='http://becausesomeonecares.com#aftrInUse' onload='AFTR18009EmbedStopTime();' width='100%' height='100%'></object>";
    document.getElementById('aftr18009Counter').src = "http://matthiaschronicles.tanaya.net/cgi-bin/aftrCounter.cgi?46861";

    o.style.display='block';
  }

function AFTR18009Hide()
  {
    var o=document.getElementById('AFTR18009');

    o.style.display='none';
    clearTimeout(AFTR18009Postimer);
  }

function AFTR18009position(srch,name)
  {
    var l=srch.length;
    var t=name.length;
    var e=t-l+1;
    var done=-1;

    for(var i=0;i<e && done<0;i++)
      {
        var sub=name.substring(i,i+l);
        if(sub==srch)
          done=i;
      }
    return(done);
  }

function AFTR18009CountDown(count)
  {
    if(count>0)
      {
        var a = 'Opening in '+count+' seconds!';

        document.getElementById('AFTR18009MOmsg').style.fontSize='16px';
        document.getElementById('AFTR18009MOmsg').innerHTML=a;
        AFTR18009timer=setTimeout(function () { AFTR18009CountDown(count-1); } , 1000);
      }
    else
      {
        AFTR18009ClearTimer();
        AFTR18009Show();
      }
  }

function AFTR18009ClearTimer()
  {
        var a = 'Mouse over this box for an interesting blog!';

        document.getElementById('AFTR18009MOmsg').style.fontSize='12px';
        document.getElementById('AFTR18009MOmsg').innerHTML=a;
        clearTimeout(AFTR18009timer);
  }

if(AFTR18009position('aftrInUse',location.href)<0 && !AFTRonce) { 
var AFTRonce=18009;

document.writeln('<div ID="AFTR18009logo" OnMouseOut="AFTR18009ClearTimer();" OnMouseOver="AFTR18009CountDown(3);" style="width:125px; height: 125px; line-height: normal; padding: normal; margin: normal; color: #ffffff; font-weight: bold; font-family: Verdana,Geneva,Arial,Sans-serif; background-image: url(http://matthiaschronicles.tanaya.net/AFTR/Images/AlongForTheRide-BG408.gif);">');
document.writeln('<center><span style="color: #ffffff; font-size: 24px;">Along for the Ride!</span>');
document.writeln('<p><span ID="AFTR18009MOmsg" style="color: #ffffff; padding: 3px; font-size: 12px;">Mouse over this box for an interesting blog!</span>');
document.writeln('</center></div>');

document.writeln('<div id="AFTR18009" style="display: none; z-index: 50; position: fixed; font-size: 16px; font-weight: bold; font-family: Verdana,Geneva,Arial,Sans-serif;">');
document.writeln('<table style="background-color: #aeaeff;" width=645>');
document.writeln('<tr height=80><td valign="center"><center>');
document.writeln('Along For The Ride!<br><span id="AFTR18009endTime">Loading...</span><br>');
document.writeln('<img id="aftr18009Counter" src="#" border=0 height=1 width=1>');
document.writeln('<a target="_blank" href="http://whos.amung.us/stats/vkhrlhtdwxxw/"><img src="http://whos.amung.us/swidget/vkhrlhtdwxxw.png" width="80" height="15" border="0" title="Visitors" /></a>');
document.writeln('</center></td><td><center>');
document.writeln('<a id="AFTR18009Link" target="_blank" href="#">Open</a>');
document.writeln('</center></td><td><center>');
document.writeln('<a target="_blank" href="http://matthiaschronicles.tanaya.net/AFTR/">Join!</a>');
document.writeln('</center></td><td><center>');
document.writeln('<a href="#" OnClick="AFTR18009Hide();" style="color: #640000;">Close</a>');
document.writeln('</center></td><td><center>');
document.writeln('<div id="AFTR18009Ad"></div>');
document.writeln('</center></td></tr><tr><td colspan=5>');
document.writeln('<div id="AFTR18009Body"></div>');
document.writeln('</td><tr></table>');
document.writeln('</div>'); }

-->
