with(AP_FixedButtons=function(){}){
	prototype.buttons = [];
	
	prototype.addButton_Link = function(label, img, url){
		this.buttons[this.buttons.length] = {
			'img':		img,
			'label':	label,
			'attrs' : {
				'href': 	url,
				'target': 	''
			}
		};
	}
	
	prototype.addButton_Script = function(label, img, script){
		this.buttons[this.buttons.length] = {
			'img':		img,
			'label':	label,
			'attrs' : {
				'onclick': 	script
			}
		};
	}
	
	
	
	prototype.render = function(){
		if(this.buttons.length){
			jQuery('body').append("<div class='ap_fixed_buttons' id='ap_fixed_buttons'></div>");
			var div = jQuery('#ap_fixed_buttons');
			
			for(var i=0; i<this.buttons.length; i++){
				var attrs = "";
				for(attr in this.buttons[i].attrs){
					attrs+= attr + "=\"" + this.buttons[i].attrs[attr] + "\" ";		
				}
				
				div.append(
					"<a " + attrs + " ><div><div><div>" + this.buttons[i].label + "</div></div></div><img src='" + 
					this.buttons[i].img + "' alt='" + this.buttons[i].label + "' /></a>"
				);			
			}
		}
	}	
}

window.AP_FixedButtons = new AP_FixedButtons();

jQuery(function(){
	setTimeout(function(){
		window.AP_FixedButtons.render()
	}, 10);
});


