var qlik;
var added = 0;
define( ["jquery","text!./styles.css","qlik"], function ( $, cssContent, qlik ) {
	'use strict';
$("<style>").html(cssContent).appendTo("head");
  return {	  paint: function ( $element, layout ) {
		  
					  //add your rendering code here
					  var html = '';	
					var Code;
					
				function myFunction() {
				  var btn = document.createElement("BUTTON");
				  btn.className = "mStyles";
				  var t = document.createTextNode("Title Button");
				  btn.appendChild(t);
				  document.getElementById("sheet-title").appendChild(btn);
			    }  
					
	   if(added == 0){
	        myFunction();
		  added++;
	   } 
				  $('.mStyles')
					.css('cursor', 'pointer')
				    .css('float','right')
				    .css('border','solid')
				    .css('height','100%')
				    .css('text-align','center')
					.click(
					  function(){
						
					   alert("I am added to the title!");
						
					  });
		   
				  }
			  
  };
 
 
} );