/*
   Copyright 2010 Hanov Solutions Inc. All Rights Reserved

   steve.hanov@gmail.com
 */
/*jslint browser: true, white: false */

 /** @constructor */
function Toolbar()
{
    this.div = document.createElement("div");
    this.div.style.width = "50px";
    this.div.style.height = "320px";
    this.div.style.border = "1px dotted #cccccc";
}

Toolbar.prototype = {

    addButton: function( src, clickfn )
    {
        var div = document.createElement("div");

        var img = document.createElement("img");

        img.src = src;
        img.div = div;
        div.appendChild(img);

        this.div.appendChild(div);

        $(div).mouseenter( function()
        {
            this.style.background = "#9fb3e7";
        });

        $(div).mouseleave( function()
        {
            this.style.background = "#ffffff";
        });

        if ( clickfn ) {
            $(div).click( clickfn );
        }
    }
};
