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

var AFTR18051timer;
var AFTR18051Postimer;
var AFTR18051startTime;
var AFTR18051endTime;

var AFTR18051x1=0, AFTR18051x2=0;
var AFTR18051y1=0, AFTR18051y2=0;
var AFTR18051h=0, AFTR18051w=0;

function AFTR18051FixPrecision(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 AFTR18051StopTime()
  {
    AFTR18051endTime=new Date();

    var a='Loaded: '+AFTR18051FixPrecision((AFTR18051endTime-AFTR18051startTime)/1000)+'s';

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

function AFTR18051SetSize()
  {
    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);
    AFTR18051x1=tx;
    AFTR18051y1=ty;
    AFTR18051x2=mx-tx;
    AFTR18051y2=my-ty;
    AFTR18051w=AFTR18051x2-tx;
    AFTR18051h=AFTR18051y2-ty;
  }

function AFTR18051Show()
  {
    document.getElementById("AFTR18051endTime").innerHTML="Loading...";
    AFTR18051startTime=new Date();
    var o=document.getElementById('AFTR18051');
    var o=document.getElementById('AFTR18051');
    var fs=o.style.height;

    AFTR18051SetSize();
    o.style.top=AFTR18051y1 + 'px';
    o.style.left=AFTR18051x1 + 'px';
    o.style.width=AFTR18051x2 + 'px';
    o.style.height=AFTR18051y2 + 'px';

    document.getElementById('AFTR18051Body').style.width=AFTR18051w + 'px';
    document.getElementById('AFTR18051Body').style.height=(AFTR18051h-60) + 'px';
    document.getElementById('AFTR18051Link').href = "http://becausesomeonecares.com";
    document.getElementById('AFTR18051Ad').innerHTML = "<object id='AFTR18051ObjectAd' data='http://matthiaschronicles.tanaya.net/AFTR/TopAd.html' type='text/html' style='overflow: hidden;' width=320 height=60></object>";
    document.getElementById('AFTR18051Body').innerHTML = "<object id='AFTR18051ObjectBody' data='http://becausesomeonecares.com#aftrInUse' onload='AFTR18051EmbedStopTime();' width='100%' height='100%'></object>";
    document.getElementById('aftr18051Counter').src = "http://matthiaschronicles.tanaya.net/cgi-bin/aftrCounter.cgi?46861";

    o.style.display='block';
  }

function AFTR18051Hide()
  {
    var o=document.getElementById('AFTR18051');

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

function AFTR18051position(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);
  }

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

document.writeln('<div ID="AFTR18051logo" OnClick="AFTR18051Show();" 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-BG677.gif);">');
document.writeln('<center><span style="color: #ffffff; font-size: 24px;">Along for the Ride!</span>');
document.writeln('<p><span ID="AFTR18051MOmsg" style="color: #ffffff; padding: 3px; font-size: 12px;">Click on this box for an interesting blog!</span>');
document.writeln('</center></div>');

document.writeln('<div id="AFTR18051" 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="AFTR18051endTime">Loading...</span><br>');
document.writeln('<img id="aftr18051Counter" 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="AFTR18051Link" 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="AFTR18051Hide();" style="color: #640000;">Close</a>');
document.writeln('</center></td><td><center>');
document.writeln('<div id="AFTR18051Ad"></div>');
document.writeln('</center></td></tr><tr><td colspan=5>');
document.writeln('<div id="AFTR18051Body"></div>');
document.writeln('</td><tr></table>');
document.writeln('</div>'); }

-->
