// blogsLayout.js v0.02d
// (c) Tale 2006-2008
//
// Dynamically changes the layout of the Bloglines blogroll, highlighting
// any Oh, Rats! links.


var blogsOnLoad = null;


function blogsInit(event)
{
  if (!event)
    event = window.event;

  var div = window.ieVersion ? document.all.tags("DIV") : document.getElementsByTagName("DIV");

  for (var n = 0, count = 0; n < div.length; n++)
  {
    if(div[n].className == "blogrollitem")
    {
      var oh_rats = false;
      var a = window.ieVersion ? div[n].all.tags("A") : div[n].getElementsByTagName("A");
      if (a.length == 1)
      {
        var title = window.ieVersion ? a[0].innerText : a[0].text;
        if (title && title.indexOf("Oh, Rats!") >= 0)
        {
          oh_rats = true;
          div[n].style.fontWeight = "bold";
          if (a[0].href == "http://www.youtube.com/rss/user/TaleTN/videos.rss")
            a[0].href = "http://www.youtube.com/view_play_list?p=3E46E39FB641971F";
        }
      }

      if (count%2 == 0)
      {
        if (oh_rats)
          div[n].className += " OddAlt";
        else
          div[n].className += " Odd";
      }
      else
        if (oh_rats)
          div[n].className += " EventAlt";
      count++;
    }
  }

  if (blogsOnLoad)
    return blogsOnLoad(event);
  return true;
}


if (window.ieVersion >= 5.0 || window.mozillaVersion >= 5.0 || window.safariVersion >= 522 || window.operaVersion >= 9.27)
{
  // Install the window.onload handler.
  blogsOnLoad = window.onload;
  window.onload = blogsInit;
}

