$(document).ready(function()
{
// Extract domain name and blog location
   var domain, blogLocation = '';
   var txtLocation = new String(location);
   var txtHash = location.hash;

   var aMatches = txtLocation.match(/iloapp\.([^\/]+?)\/blog\/([^\?\/\#]+)/);
   if(aMatches)
   {
      domain = aMatches[1];
      blogLocation = aMatches[2];
   }
   else
   {
      return;
   }

   if(top == window && !jQuery.browser.safari)
   {
   // Not inside the frame, let's redirect
      var txtRedirect = 'http://' + blogLocation + '.' + domain + '/';

      aMatches = txtLocation.match(/Home(?:&(post|category|user|page)=(\d+))?/);
      if(aMatches)
      {
         if(aMatches[1] != null && aMatches[2] != null)
         {
            txtRedirect += '#' + aMatches[1] + aMatches[2];
         }

         location = txtRedirect;
      }
   }
});

function WriteFlash(txtObject)
{
   document.write(txtObject);
}
