(function($) {
"use strict";
 //Shortcodes
 tinymce.PluginManager.add( 'zillaShortcodes', function( editor, url ) {
	 editor.addCommand("zillaPopup", function ( a, params ){
		 var popup = params.identifier;
		 tb_show("Insert Zilla Shortcode", url + "/popup.php?popup=" + popup + "&width=" + 800);
	 });
	 
	 editor.addButton( 'zilla_button', {
		 type: 'splitbutton',
     icon: false,
		 title: 'Zilla Shortcodes',
		 onclick : function(e) {},
		 menu: [
			 {text: 'Columns',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Columns',identifier: 'columns'}) }},
			 {text: 'Intro video background',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Intro video background',identifier: 'intro_video'}) }},
			 {text: 'Fullscreen slider',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Fullscreen slider',identifier: 'fullscreen_slider'}) }},
			 {text: 'Fullscreen text slider',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Fullscreen text slider',identifier: 'fullscreen_text_slider'}) }},
			 {text: 'Fullscreen image slider',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Fullscreen image slider',identifier: 'fullscreen_image_slider'}) }},
			 {text: 'Accordion',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Accordion',identifier: 'accordion'}) }},
			 {text: 'Alerts',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Alerts',identifier: 'alert'}) }},
			 {text: 'News',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'News',identifier: 'news'}) }},
			 {text: 'Clients',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'clients',identifier: 'clients'}) }},
			 {text: 'Content Box',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Content Box',identifier: 'content_box'}) }},
			 {text: 'Image Box',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Image Box',identifier: 'image_box'}) }},
			 {text: 'Contact Details',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Contact Details',identifier: 'contact_details'}) }},
			 {text: 'Contact Form',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Contact Form',identifier: 'contact_form'}) }},
			 {text: 'Google Map',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Google Map',identifier: 'google_map'}) }},
			 {text: 'Skills',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Skills',identifier: 'diagrams'}) }},
			 {text: 'Divider',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Divider',identifier: 'divider'}) }},
			 {text: 'Button',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Button',identifier: 'button'}) }},
			 {text: 'Number Details',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Number Details',identifier: 'number_details'}) }},
			 {text: 'Portfolio',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Portfolio',identifier: 'portfolio'}) }},
			 {text: 'Portfolio gallery expand',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Portfolio gallery expand',identifier: 'portfolio_gallery'}) }},
			 {text: 'Tabs',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Tabs',identifier: 'tabs'}) }},
			 {text: 'Team',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Team',identifier: 'team'}) }},
			 {text: 'Testimonial',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Testimonial',identifier: 'testimonial'}) }},
			 {text: 'Service',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Service',identifier: 'service'}) }},
			 {text: 'Social Icons',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Social Icons',identifier: 'social_icon'}) }},
			 {text: 'Pricing Tables',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Pricing Tables',identifier: 'pricing_tables'}) }},
			 {text: 'Video',onclick:function(){ editor.execCommand("zillaPopup", false, {title: 'Video',identifier: 'video'}) }},

		 ]
	});
});

})(jQuery);