var socializeit = function(options) {
  if (!options || !options.domain) {
    throw new Error('Error: must pass socializeit a domain (e.g. socializeit({domain:"www.example.com"})).')
  }

  var d = document,
      l = d.location,
      e = encodeURIComponent,
      u = e(l.href),
      t = e(d.title),
      domain = options.domain,
      urlroot = 'http://www.'+domain+'/objects/';

  var sites = [
    {name: 'Google', 
     img: urlroot+'google.gif',
     url: 'http://www.google.com/ig/adde?moduleurl=www.google.com/ig/modules/bookmarks.xml&amp;hl=en/u='+ u +'&amp;t=' + t},
    {name: 'Buzz',
     img: urlroot+'yahoobuzz1.gif',
     url: 'http://buzz.yahoo.com/submit?submitUrl='+ u +'&amp;t=' + t},
    {name: 'Facebook',
     img: urlroot+'Facebook.jpg',
     url: 'http://www.facebook.com/share.php?u='+ u +'&amp;t=' + t},
    {name: 'Myspace',
     img: urlroot+'myspace.gif',
     url: 'http://www.myspace.com/Modules/PostTo/Pages/?u='+ u +'&amp;t=' + t},
    {name: 'StumbleUpon', 
     img: urlroot+'StumbleUpon.jpg',
     url: 'http://www.stumbleupon.com/submit?url=' + u + '&amp;title=' + t},
    {name: 'Technorati',
     img: urlroot+'Technorati.jpg',
     url: 'http://technorati.com/faves/?add=' + u},
    {name: 'del.icio.us',
     img: urlroot+'del.jpg',
     url: 'http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=' + u + '&amp;title=' + t},
    {name: 'Twitter',
     img: urlroot+'twitter.gif',
     url: 'http://twitter.com/home?status=Reading%20about%20this:%20'+t+'%20-%20' + u}
  ];

  arguments.callee.getURL = function(which) {
    for (var i=0, ilen=sites.length; i<ilen; i++) {
      var site = sites[i];
      if (site.name == which) {
        return site.url;
      }
    }
  };

  var html = '<table  align="center" style="border: 1px solid #ccc;padding:2px;width:480px;"><tbody><tr><td rowspan="2" style="white-space:nowrap;"><strong>Share this page:&nbsp;</strong>';
  if (options.whatIsThisUrl) {
    html += '<br><div id="whatsthis" style="font-size:11px;"><a href="#" onclick="window.open\(\''+options.whatIsThisUrl+'\',\'sharer\',\'toolbar=0,status=0,width=700,height=900,resizable=yes,scrollbars=yes\'\); return false;">What\'s This?</a></div';
  }
  html 
  document.writeln(html);
};

