function Bookmark(){
       this.url = null;
       this.id = null;
       this.links = null;
    };
    
    Bookmark.prototype.init = function( url, id ){
        this.url = url;
        this.id = id;
        this.links = {
            "delicious": "http://del.icio.us/post?v=4&noui&jump=close&url=@URL@&title=@TITLE@",
		    "digg": "http://digg.com/remote-submit?phase=2&url=@URL@&title=@TITLE@",
		    "stumbleupon": "http://www.stumbleupon.com/submit?url=@URL@&title=@TITLE@"
        };
        this.addLinks();
    };
    
    Bookmark.prototype.addLinks = function(){
        var elem = document.getElementById( this.id );
        var list = document.createElement("ul");
        list.className = "bookmarks clear";
        elem.appendChild(list);
        for ( var key in this.links ){
            var el = document.createElement( "li" );
            var link = document.createElement( "a" );
            var text = document.createTextNode(key);
            link.href = this.getURL(this.links[key]);
            el.className = key;
            link.appendChild(text);
            el.appendChild(link);
            list.appendChild(el);
        };
    };
    
    Bookmark.prototype.getURL = function( url ){
        var s = this.url;
        var t = encodeURIComponent(document.title);
        url = url.replace( /@URL@/g, s );
        url = url.replace( /@TITLE@/g, t );
        return url;
    };
    

 
    


