

Sugester = {}

Sugester.Engine = function(setup){
    var Engine = {
        version: '0.1',
        url: 'http://nxs.pl/sugester/',
        
        Interface: {
            btnBar: {
                gfx: 'gfx/sugester-navigate-start.gif',
                html: document.createElement('img'),
                add: function(){
                    var that = this;
                    document.body.appendChild(that.get())
                    that.get().id = 'sugesternavigatestart'
                    that.get().onload = function(){
                        that.get().style.position = 'absolute';
                       
						$(document).ready(function() {
					    $(that.get()).css("position", "absolute");
						});
						$(that.get()).css("top", $(window).scrollTop() + (($m.$document.WorkSpace('y') / 2) - that.get().offsetHeight / 2) + "px");
						$(window).scroll(function() {
						    $(that.get()).css("top", $(window).scrollTop() + (($m.$document.WorkSpace('y') / 2) - that.get().offsetHeight / 2) + "px");
						});
                        that.get().style.left = $m.$document.WorkSpace('x') - that.get().offsetWidth + 'px';
                        that.get().style.cursor = 'pointer';
                    }
                    
                    that.get().src = Engine.url + that.gfx;
                    that.get().onclick = that.action;
                },
                get: function(){
                    var that = this;
                    return that.html;
                },
                action: function(){
                    setup.action();
                }
            }
        }
    
    };
    
    Engine.Interface.btnBar.add();
    return Engine;
};