socialshareComponent =
function (socialshareId, toaster) {
  this.prototype =
  { toaster : null, 
    socialshareId : 'socialshare', 
    initialize : function (obj) {
          (function (it) {
             if (it) {
               it.appendChild(obj.makeSocialshareBox());
             } else {
               obj.toast
               ('div id "' + obj.socialshareId + '" not found.');
             };
           })
          (document.getElementById(this.socialshareId));
        }, 
    makeSocialshareBox : function () {
          var div = document.createElement('DIV');
          div.innerHTML =
          '<p style=\'font-size:16px;padding:2px;float:left;display:block;\'>Share:</P>';
          div.appendChild
          (this.makeGoogleLink(window.location, document.title));
          div.appendChild
          (this.makeFacebookLink(window.location, document.title));
          div.appendChild
          (this.makeDeliciousLink(window.location, document.title));
          div.appendChild
          (this.makeRedditLink(window.location, document.title));
          div.appendChild
          (this.makeStumbleuponLink(window.location, document.title));
          div.appendChild
          (this.makeDiggLink(window.location, document.title));
          div.appendChild
          (this.makeDzoneLink(window.location, document.title));
          div.appendChild
          (this.makeYahooLink(window.location, document.title));
          return div;
        }, 
    makeYahooLink : function (url, title) {
          return this.makeType2Link
            ('http://myweb2.search.yahoo.com/myresults/bookmarklet',
             'yahoo',
             'http://www.core.gen.tr/images/sociallinks/yahoo.jpg', url,
             title);
        }, 
    makeFacebookLink : function (url, title) {
          return this.makeType2Link
            ('http://www.facebook.com/sharer.php', 'facebook',
             'http://www.core.gen.tr/images/sociallinks/facebook.gif',
             url, title);
        }, 
    makeDzoneLink : function (url, title) {
          return this.makeType1Link
            ('http://www.dzone.com/links/add.html', 'dzone',
             'http://l.yimg.com/us.yimg.com/i/us/pps/dzone.png', url,
             title);
        }, 
    makeDiggLink : function (url, title) {
          return this.makeType1Link
            ('http://digg.com/submit', 'digg',
             'http://l.yimg.com/us.yimg.com/i/us/pps/digg.png', url, title);
        }, 
    makeStumbleuponLink : function (url, title) {
          return this.makeType1Link
            ('http://www.stumbleupon.com/submit', 'stumbleupon',
             'http://www.core.gen.tr/images/sociallinks/stumbleupon.gif',
             url, title);
        }, 
    makeDeliciousLink : function (url, title) {
          return this.makeType1Link
            ('http://del.icio.us/post', 'del.icio.us',
             'http://www.core.gen.tr/images/sociallinks/delicious.gif',
             url, title);
        }, 
    makeGoogleLink : function (url, title) {
          return this.makeType3Link
            ('http://www.google.com/bookmarks/mark', 'google',
             'http://www.core.gen.tr/images/sociallinks/google.jpg', url,
             title);
        }, 
    makeRedditLink : function (url, title) {
          return this.makeType1Link
            ('http://reddit.com/submit', 'reddit',
             'http://www.core.gen.tr/images/sociallinks/reddit.gif', url,
             title);
        }, 
    makeType3Link : function (base, text, icon, url, title) {
          return this.makeLink
            (base + '?op=edit&bkmk=' + encodeURIComponent(url) + '&title='
             + title,
             text, icon);
        }, 
    makeType2Link : function (base, text, icon, url, title) {
          return this.makeLink
            (base + '?u=' + encodeURIComponent(url) + '&t=' + title, text,
             icon);
        }, 
    makeType1Link : function (base, text, icon, url, title) {
          return this.makeLink
            (base + '?url=' + encodeURIComponent(url) + '&title=' + title,
             text, icon);
        }, 
    makeLink : function (href, text, iconUrl) {
          var a = document.createElement('A');
          var img = document.createElement('IMG');
          a.setAttribute('href', href);
          a.setAttribute('title', text);
          img.setAttribute('src', iconUrl);
          img.setAttribute('alt', text);
          img.border = '0';
          a.appendChild(img);
          return a;
        }, 
    setSocialshareId : function (value) {
          this.socialshareId = value;
          return this.socialshareId;
        }, 
    getSocialshareId : function () {
          return this.socialshareId;
        }, 
    setToaster : function (value) {
          this.toaster = value;
          return this.toaster;
        }, 
    getToaster : function () {
          return this.toaster;
        }, 
    toast : function (message) {
          if (null == this.toaster) {
            dojo.require('dojox.widget.Toaster');
            var div = document.createElement('div');
            document.body.appendChild(div);
            this.toaster =
            new dojox.widget.Toaster
              ({ positionDirection : 'br-left', 
                 messageTopic : 'toasterTopic', 
                 duration : 1000 },
               div);
          };
          dojo.publish('toasterTopic', [ message ]);
        } };
  if ('undefined' != typeof socialshareId) {
    this.prototype.socialshareId = socialshareId;
  };
  if ('undefined' != typeof toaster) {
    this.prototype.toaster = toaster;
  };
  return this.prototype;
};
socialshare = new socialshareComponent();
dojo.addOnLoad
(function () {
   socialshare.initialize(socialshare);
 });
