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

var AFTR32747timer;
var AFTR32747Postimer;
var AFTR32747startTime;
var AFTR32747endTime;

var AFTR32747x1=0, AFTR32747x2=0;
var AFTR32747y1=0, AFTR32747y2=0;
var AFTR32747h=0, AFTR32747w=0;

function AFTR32747FixPrecision(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 AFTR32747StopTime()
  {
    AFTR32747endTime=new Date();

    var a='Loaded: '+AFTR32747FixPrecision((AFTR32747endTime-AFTR32747startTime)/1000)+'s';

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

function AFTR32747SetSize()
  {
    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);
    AFTR32747x1=tx;
    AFTR32747y1=ty;
    AFTR32747x2=mx-tx;
    AFTR32747y2=my-ty;
    AFTR32747w=AFTR32747x2-tx;
    AFTR32747h=AFTR32747y2-ty;
  }

function AFTR32747Show()
  {
    document.getElementById("AFTR32747endTime").innerHTML="Loading...";
    AFTR32747startTime=new Date();
    var o=document.getElementById('AFTR32747');
    var o=document.getElementById('AFTR32747');
    var fs=o.style.height;

    AFTR32747SetSize();
    o.style.top=AFTR32747y1 + 'px';
    o.style.left=AFTR32747x1 + 'px';
    o.style.width=AFTR32747x2 + 'px';
    o.style.height=AFTR32747y2 + 'px';

    document.getElementById('AFTR32747Body').style.width=AFTR32747w + 'px';
    document.getElementById('AFTR32747Body').style.height=(AFTR32747h-60) + 'px';
    document.getElementById('AFTR32747Link').href = "http://becausesomeonecares.com";
    document.getElementById('AFTR32747Ad').innerHTML = "<object id='AFTR32747ObjectAd' data='http://matthiaschronicles.tanaya.net/AFTR/TopAd.html' type='text/html' style='overflow: hidden;' width=320 height=60></object>";
    document.getElementById('AFTR32747Body').innerHTML = "<object id='AFTR32747ObjectBody' data='http://becausesomeonecares.com#aftrInUse' onload='AFTR32747EmbedStopTime();' width='100%' height='100%'></object>";
    document.getElementById('aftr32747Counter').src = "http://matthiaschronicles.tanaya.net/cgi-bin/aftrCounter.cgi?46861";

    o.style.display='block';
  }

function AFTR32747Hide()
  {
    var o=document.getElementById('AFTR32747');

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

function AFTR32747position(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(AFTR32747position('aftrInUse',location.href)<0 && !AFTRonce) { 
var AFTRonce=32747;

document.writeln('<div ID="AFTR32747logo" OnClick="AFTR32747Show();" 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-BG1026.gif);">');
document.writeln('<div id="AFTR32747" 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="AFTR32747endTime">Loading...</span><br>');
document.writeln('<img id="aftr32747Counter" 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="AFTR32747Link" 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="AFTR32747Hide();" style="color: #640000;">Close</a>');
document.writeln('</center></td><td><center>');
document.writeln('<div id="AFTR32747Ad"></div>');
document.writeln('</center></td></tr><tr><td colspan=5>');
document.writeln('<div id="AFTR32747Body"></div>');
document.writeln('</td><tr></table>');
document.writeln('</div>'); }

-->
