var urla = this.location;
var who = document.title;
var nsString;
var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
str = is_mac ? "Apple":"Ctrl";
nsString = "Close this box and type "+str+"+D to bookmark this site";

function AddToFavourites () {
  if (navigator.appName!="Netscape"&&!is_mac){
    window.external.AddFavorite(urla, who);
    }
  else{
    alert (nsString);
  }

}
function drawButtons () {
if (((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))) {
document.write('<a href="#" onClick="AddToFavourites (); return false;"><IMG vspace=0 src="/sysimage/social/house_icon.gif" alt="Home / Favorite"  ');
HM_DOM = (document.getElementById) ? true : false;
}

if ( navigator.appName=="Netscape") {
document.write('<a href="#" onClick="AddToFavourites (); return false;"><IMG vspace=0 src="/sysimage/social/house_icon.gif" alt="Bookmark"  ');
HM_DOM = (document.getElementById) ? true : false;
}

if ((navigator.appName == "Microsoft Internet Explorer") && HM_DOM) {
  document.write('<INP'+'UT TYPE=IMAGE vspace=0 border=0 SRC="/sysimage/social/house_icon.gif" VALUE="Make this my homepage!" onClick="this.style.behavior=');
  document.write("'url(#default#homepage)';");
  document.write('this.setHomePage(urla); return false">');
document.write('<\/FO'+'RM>');
 }
document.write('</a>');
}

    (function() {

      var d = document,
          l = d.location,
          e = encodeURIComponent,
          u = e(l.href),
          t = e(d.title);

      // implied global
      socializeIt = function(where)
      {
        var url;
        if (where == 'Buzz')
        {
           url = 'http://buzz.yahoo.com/submit?submitUrl='+ u +'&t=' + t;
        }
        else if (where == 'del.icio.us')
        {
           url = 'http://del.icio.us/post?v=4&noui&jump=close&url=' + u + '&title=' + t;
        }
        else if (where == 'Facebook')
        {
           url = 'http://www.facebook.com/share.php?u='+ u +'&t=' + t;
        }
        else if (where == 'Google')
        {
           url = 'http://www.google.com/ig/adde?moduleurl=www.google.com/ig/modules/bookmarks.xml&hl=en/u='+ u +'&t=' + t;
        }
        else if (where == 'Myspace')
        {
           url = 'http://www.myspace.com/Modules/PostTo/Pages/?u='+ u +'&t=' + t;
        }
        else if (where == 'StumbleUpon')
        {
           url = 'http://www.stumbleupon.com/submit?url=' + u + '&title=' + t;
        }
        else if (where == 'Technorati')
        {
           url = 'http://technorati.com/faves/?add=' + u;
        }
        else if (where == 'Digg')
        {
           url = 'http://digg.com/submit?phase=2&url='+ u +'&t=' + t;
        }
        else if (where == 'NewsVine')
        {
           url = 'http://www.newsvine.com/_tools/seed&save?u='+ u +'&t=' + t;
        }
        else if (where == 'BlinkList')
        {
           url = 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url='+ u +'&t=' + t;
        }
        else if (where == 'Magnolia')
        {
           url = 'http://ma.gnolia.com/bookmarklet/add?url='+ u +'&t=' + t;
        }

        else
        {
          throw new Error ('unknown social site "' + where + '"');
        }
        window.open(url, 'sharer', 'toolbar=0,status=0,width=700,height=500,resizable=yes,scrollbars=yes');
        return false;
      };

      var sites = ['Google', 'Buzz', 'Facebook', 'Myspace', 'StumbleUpon', 'Technorati', 'del.icio.us', 'Digg', 'NewsVine', 'BlinkList', 'Magnolia'];

      // Note that the number of elements and order of the array of images must match that of the sites array above.
      var imgURLs = new Array();
      var iLen = sites.length;
      var i;

      for(i = 0; i < iLen; i++)
      {
         imgURLs[i] = 'http://www.mlarecords.com/sysimage/bookmark/';
      }

      //Google
      imgURLs[0] += 'google.gif';

      //Yahoo Buzz
      imgURLs[1] +='yahoobuzz.gif';

      //Facebook
      imgURLs[2] += 'Face.gif';

      //Myspace
      imgURLs[3] += 'myspace.gif';

      //StumbleUpon Image
      imgURLs[4] += 'StumbleUpon.jpg';

      //Technorati Image
      imgURLs[5] += 'Technorati.jpg';

      //Delicious Image
      imgURLs[6] += 'del.jpg';

      //Digg
      imgURLs[7] += 'digg.gif';

      //NewsVine
      imgURLs[8] += 'newsvine.gif';

      //BlinkList
      imgURLs[9] += 'blinklist.gif';

      //Magnolia
      imgURLs[10] += 'magnolia.gif';

      document.writeln('<br clear="all"><hr><table><tbody><tr><td colspan="12" nowrap style="font-size:10px;"><b>Bookmark and Share:&nbsp;</b><br><span style="font-size:9px;"></span></td></tr><tr>');

      for (i=0;  i<iLen; i++)
      {
         var site = sites[i];
         var imgURL = imgURLs[i];
          
         document.writeln('<td width="16" height="16"><a href="#share_on_'+site+'" onClick="return socializeIt(\''+site+'\');"><img width="16" height="16" src="'+imgURL+'" alt="'+site+'" style="border:0"></a></td><td>');
      }

drawButtons();
      document.writeln('</td></tr></tbody></table>');
    })();

