var Social = {
  'title': {
    'hyves': 'Hyves',
    'twitter': 'Twitter',
    'digg': 'Digg',
    'stumbleupon': 'StumbleUpon',
    'delicious': 'Delicious',
    'facebook': 'Facebook',
    'friendfeed': 'FriendFeed',
    'buzz': 'Google Buzz',
    'linkedin': 'LinkedIn',
    'ohja': 'Ohja'
  },
  'icon': {
    'hyves': 'hyves_16.png',
    'twitter': 'twitter_16.png',
    'digg': 'digg_alt_16.png',
    'stumbleupon': 'stumbleupon_16.png',
    'delicious': 'delicious_16.png',
    'facebook': 'facebook_16.png',
    'friendfeed': 'friendfeed_16.png',
    'buzz': 'buzz-16.png',
    'linkedin': 'linkedin_16.png',
    'ohja': 'ohja_16.png'
  },
  'href': {
    'hyves': 'http://www.hyves.nl/hyvesconnect/smartbutton?title=#TITLE#&body=#MESSAGE#&category=12&rating=5&type=11',
    'twitter': 'http://twitter.com/home?status=#MESSAGE#',
    'digg': 'http://digg.com/submit?phase=2&url=#URL#&title=#TITLE#',
    'stumbleupon': 'http://www.stumbleupon.com/submit?url=#URL#&title=#TITLE#',
    'delicious': 'http://del.icio.us/post?url=#URL#&title=#TITLE#',
    'facebook': 'http://www.facebook.com/sharer.php?u=#URL#&t=#TITLE#',
    'friendfeed': 'http://www.friendfeed.com/share?title=#TITLE#&link=#URL#',
    'buzz': 'http://www.google.com/buzz/post?url=#URL#&imageurl=',
    'linkedin': 'http://www.linkedin.com/shareArticle?mini=true&url=#URL#&title=StudentsPlus&summary=#TITLE#&source=StudentsPlus',
    'ohja': 'http://ohja.nl/inbox?url=#URL#&title=#TITLE#'
  },

  'Add': function(network, imagedir) {
    var title = document.title;
    var url = document.location;
    var message = url + ' #bijles';
    
    eval('var icon = this.icon.'+network);
    eval('var href = this.href.'+network);
    eval('var label = this.title.'+network);

    href = href.replace('#TITLE#', title.toString().urlEncode()).replace('#URL#', url.toString().urlEncode()).replace('#MESSAGE#', message.toString().urlEncode());

    document.write('<span style="margin:2px"><a title="'+(network=='ohja'?'Toevoegen aan ':'Delen via ')+label+'" href="'+href+'" target=_BLANK onclick="this.blur()"><img src="'+imagedir+'/'+icon+'" border=0></a></span>');
  }

};

String.prototype.urlEncode = function () {
  return encodeURIComponent(this);
}
