$('body').append("<div id='main_controls_external' style='position:fixed; color:white; top:0px; left:0px; width:auto; height:20px; background:blue; z-index:100;'>\
	<span class='button_main'>Wiki</span>\
	<span class='button_main'>IMDB</span>\
	<span class='button_main'>EpGuides</span>\
</div>");

$('#main_controls_external .button_main').each(function() {

	$(this).click(function() {
		var data = {
			to: $(this).text().toLowerCase()
		};
		console.log('send data', data);
		window.webkit.messageHandlers.mainMessageHandler.postMessage(data);
	});
});