/****************************************
 * BADGED.NET WIDGET
 * PORTIONS COPYRIGHT (C) 2006-2008 BY CAVENDO CORPORATION
 * PROVIDED BY MYMEDIAROOM.COM
 ****************************************/
/*********************************************
 * DON'T BE A DOUCHE. DON'T PIRATE CODE.     *
 * WE'LL HUNT YOU DOWN IF YOU DO.            *
 *********************************************
 * IF YOU LIKE BADGED, MAKE A SMALL DONATION *
 * AND WE CAN REMOVE THE "POWERED BY" TAG    *
 ********************************************/

function Args () {
  var caller = this._findCaller();
  var qString = caller.src.replace(/^[^\?]+\??/,'');
  if ( qString ) {
     this._queryString = qString;
     this._parseArgs();
  }
}

Args.prototype._findCaller = function () {
  var scripts = document.getElementsByTagName('script');
  return scripts[ scripts.length - 1 ];
}

Args.prototype._parseArgs = function () {
   if ( ! this._queryString ) return false;
   var Pairs = this._queryString.split(/;/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal.length == 2 ) continue;
      if ( ! ( KeyVal[0] || KeyVal[1] ) ) continue;
      if ( KeyVal[0].match(/^_/) ) continue;
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      val = val.replace(/&/g, '&amp;');
      val = val.replace(/>/g, '&gt;');
      val = val.replace(/</g, '&lt;');
      this[key] = val;
   }
}

Args.prototype.getKeys = function () {
  var keys = new Object();
  for ( var attr in this ) {
    if ( attr.match(/^(_|getKeys)/) ) continue;
    keys[attr] = undefined;
  }
  return keys;
}

var args = new Args();

/*********************************************
 * DON'T BE A DOUCHE. DON'T PIRATE CODE.     *
 * WE'LL HUNT YOU DOWN IF YOU DO.            *
 *********************************************
 * IF YOU LIKE BADGED, MAKE A SMALL DONATION *
 * AND WE CAN REMOVE THE "POWERED BY" TAG    *
 ********************************************/

new Badged();

function Badged()
{
	u = args.u;
	t = args.t;
	
	if ( args.dg == 'y' )
  	  document.write('<a target="_blank" href="http://digg.com/submit?phase=2&url=' + u + '&title=' + t + '"><img title="Digg This Story" alt="Digg This Story" src="http://badged.net/ico/digg.gif" border="0"></a>&nbsp;');
    
    if ( args.sp == 'y' )
  	  document.write('<a target="_blank" href="http://www.sphere.com/search?q=sphereit:' + u + '"><img title="Sphere It" alt="Sphere It" src="http://badged.net/ico/sphere.gif" border="0"></a>&nbsp;');

    if ( args.tf == 'y' )
  	  document.write('<a target="_blank" href="http://www.technorati.com/faves?add=' + u + '"><img title="Technorati Favorites" alt="Technorati Favorites" src="http://badged.net/ico/technorati.gif" border="0"></a>&nbsp;');
  	  
    if ( args.tb == 'y' )
      document.write('<script src="http://embed.technorati.com/linkcount" type="text/javascript"></script> <a target="_blank" class="tr-linkcount" href="http://technorati.com/search/' + u + '">View blog reactions</a>&nbsp;');
  	  //document.write('<a href="http://www.technorati.com/blogs/' + u + '"><img src="http://badged.net/ico/technorati.gif" border="0"></a>&nbsp;');  	  
  	  
    if ( args.dl == 'y' )
  	  document.write('<a target="_blank" href="http://del.icio.us/post?url=' + u + '&title=' + t + '"><img title="Add to del.icio.us" alt="Add to del.icio.us" src="http://badged.net/ico/delicious.gif" border="0"></a>&nbsp;');  	  
  	  
    if ( args.fl == 'y' )
  	  document.write('<a target="_blank" href="http://furl.net/storeIt.jsp?u=' + u + '&t=' + t + '"><img title="Add to Furl" alt="Add to Furl" src="http://badged.net/ico/furl.gif" border="0"></a>&nbsp;');
  	  
    if ( args.nt == 'y' )
  	  document.write('<a target="_blank" href="http://www.netscape.com/submit/?U=' + u + '&T=' + t + '"><img title="Add to Netscape" alt="Add to Netscape" src="http://badged.net/ico/netscape.gif" border="0"></a>&nbsp;');  	  
  	  
    if ( args.ym == 'y' )
  	  document.write('<a target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=' + u + '&t=' + t + '"><img title="Add Yahoo Myweb" alt="Add Yahoo Myweb" src="http://badged.net/ico/yahoo_myweb.gif" border="0"></a>&nbsp;');  	  
  	  
    if ( args.gb == 'y' )
  	  document.write('<a target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&bkmk=' + u + '&title=' + t + '"><img title="Add Google Bookmarks" alt="Add Google Bookmarks" src="http://badged.net/ico/google_bmarks.gif" border="0"></a>&nbsp;');  	  
  	  
    if ( args.nv == 'y' )
  	  document.write('<a target="_blank" href="http://www.newsvine.com/_wine/save?u=' + u + '&h=' + t + '"><img title="Add to Newsvine" alt="Add to Newsvine" src="http://badged.net/ico/newsvine.gif" border="0"></a>&nbsp;');  	  

    if ( args.bl == 'y' )
  	  document.write('<a target="_blank" href="http://blinklist.com/index.php?Action=Blink/addblink.php?Url=' + u + '&Title=' + t + '"><img title="Add to Blinklist" alt="Add to Blinklist" src="http://badged.net/ico/blinklist.gif" border="0"></a>&nbsp;');  	  

    if ( args.rd == 'y' )
  	  document.write('<a target="_blank" href="http://reddit.com/submit?url=' + u + '&title=' + t + '"><img title="Add to Reddit" alt="Add to Reddit" src="http://badged.net/ico/reddit.gif" border="0"></a>&nbsp;');

    if ( args.bm == 'y' )
  	  document.write('<a target="_blank" href="http://blogmarks.net/my/new.php?mini=1&url=' + u + '&title=' + t + '"><img title="Add to Blogmarks" alt="Add to Blogmarks" src="http://badged.net/ico/blogmarks.gif" border="0"></a>&nbsp;');

    if ( args.mg == 'y' )
  	  document.write('<a target="_blank" href="http://ma.gnolia.com/bookmarklet/add?url=' + u + '&title=' + t + '"><img title="Add to Magnolia" alt="Add to Magnolia" src="http://badged.net/ico/magnolia.gif" border="0"></a>&nbsp;');

    if ( args.wl == 'y' )
  	  document.write('<a target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=' + u + '&title=' + t + '&top=1"><img title="Add to Windows Live" alt="Add to Windows Live" src="http://badged.net/ico/windows_live.gif" border="0"></a>&nbsp;');

    if ( args.tr == 'y' )
  	  document.write('<a target="_blank" href="http://tailrank.com/share/?link_href=' + u + '&title=' + t + '"><img title="Add to Tailrank" alt="Add to Tailrank" src="http://badged.net/ico/tailrank.gif" border="0"></a>&nbsp;');

    if ( args.yo == 'y' )
  	  document.write('<a target="_blank" href="http://youmob.com/mob.aspx?mob=' + u + '"><img title="Mob this Site (via YouMob)" alt="Mob this Site (via YouMob)" src="http://youmob.com/GetBeacon.axd?style=6&mob=' + u + '" border="0"></a>&nbsp;');  	  

    if ( args.ie == 'y' )
  	  document.write('<a target="_blank" href="javascript:window.external.AddFavorite(\'' + u + '\',\'' + t + '\');"><img title="Add to Favorites" alt="Add to Favorites" src="http://badged.net/ico/internetexplorer.gif" border="0"></a>&nbsp;');
  	  
	if ( args.em == 'y' )  	  
  	  document.write('<a OnClick="javascript:window.open(\'http://badged.net/email/?u=' + u + '&t=' + t + '\');return false"><img title="Email This" alt="Email This" src="http://badged.net/ico/email.gif" border="0"></a>&nbsp;');
  	  
/*********************************************
 * DON'T BE A DOUCHE. DON'T PIRATE CODE.     *
 * WE'LL HUNT YOU DOWN IF YOU DO.            *
 *********************************************
 * IF YOU LIKE BADGED, MAKE A SMALL DONATION *
 * AND WE CAN REMOVE THE "POWERED BY" TAG    *
 ********************************************/
	// FOOTER
	document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct="UA-189761-15";setTimeout("urchinTracker()",1000);</script>');
}