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

var AFTR04830timer;
var AFTR04830Postimer;
var AFTR04830startTime;
var AFTR04830endTime;

var AFTR04830x1=0, AFTR04830x2=0;
var AFTR04830y1=0, AFTR04830y2=0;
var AFTR04830h=0, AFTR04830w=0;

function AFTR04830FixPrecision(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 AFTR04830StopTime()
  {
    AFTR04830endTime=new Date();

    var a='Loaded: '+AFTR04830FixPrecision((AFTR04830endTime-AFTR04830startTime)/1000)+'s';

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

function AFTR04830SetSize()
  {
    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);
    AFTR04830x1=tx;
    AFTR04830y1=ty;
    AFTR04830x2=mx-tx;
    AFTR04830y2=my-ty;
    AFTR04830w=AFTR04830x2-tx;
    AFTR04830h=AFTR04830y2-ty;
  }

function AFTR04830Show()
  {
    document.getElementById("AFTR04830endTime").innerHTML="Loading...";
    AFTR04830startTime=new Date();
    var o=document.getElementById('AFTR04830');
    var o=document.getElementById('AFTR04830');
    var fs=o.style.height;

    AFTR04830SetSize();
    o.style.top=AFTR04830y1 + 'px';
    o.style.left=AFTR04830x1 + 'px';
    o.style.width=AFTR04830x2 + 'px';
    o.style.height=AFTR04830y2 + 'px';

    document.getElementById('AFTR04830Body').style.width=AFTR04830w + 'px';
    document.getElementById('AFTR04830Body').style.height=(AFTR04830h-60) + 'px';
    document.getElementById('AFTR04830Link').href = "http://2good2bee.blogspot.com";
    document.getElementById('AFTR04830Ad').src = "http://matthiaschronicles.tanaya.net/AFTR/TopAd.html";
    document.getElementById('AFTR04830Body').src = "http://2good2bee.blogspot.com#aftrInUse";
    document.getElementById('aftr04830Counter').src = "http://matthiaschronicles.tanaya.net/cgi-bin/aftrCounter.cgi?41833";

    o.style.display='block';
  }

function AFTR04830Hide()
  {
    var o=document.getElementById('AFTR04830');

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

function AFTR04830position(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 AFTR04830CountDown(count)
  {
    if(count>0)
      {
        var a = 'Opening in '+count+' seconds!';

        document.getElementById('AFTR04830MOmsg').style.fontSize='16px';
        document.getElementById('AFTR04830MOmsg').innerHTML=a;
        AFTR04830timer=setTimeout(function () { AFTR04830CountDown(count-1); } , 1000);
      }
    else
      {
        AFTR04830ClearTimer();
        AFTR04830Show();
      }
  }

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

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

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

document.writeln('<div ID="AFTR04830logo" OnMouseOut="AFTR04830ClearTimer();" OnMouseOver="AFTR04830CountDown(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-BG123.gif);">');
document.writeln('<center><span style="color: #ffffff; font-size: 24px;">Along for the Ride!</span>');
document.writeln('<p><span ID="AFTR04830MOmsg" 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="AFTR04830" 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="AFTR04830endTime">Loading...</span><br>');
document.writeln('<img id="aftr04830Counter" 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="AFTR04830Link" 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="AFTR04830Hide();" style="color: #640000;">Close</a>');
document.writeln('</center></td><td><center>');
document.writeln('<iframe id="AFTR04830Ad" src="#" width=300 height=60 scrolling=no marginwidth=0 frameborder=0></iframe>');
document.writeln('</center></td></tr><tr><td colspan=5>');
document.writeln('<iframe id="AFTR04830Body" src="#" onload="AFTR04830StopTime();" width=640 height=200></iframe>');
document.writeln('</td><tr></table>');
document.writeln('</div>'); }

-->
