// Creates a new plugin class and a custom listbox
tinymce.create('tinymce.plugins.ExamplePlugin', {
    createControl: function(n, cm)
	{
        switch (n)
		{
            case 'admin_profile':
                var mlb = cm.createListBox('admin_profile', {
                     title : 'Admin Tags',
                     onselect : function(v) {
                         if(v != "")
	                         tinyMCE.activeEditor.selection.setContent(v);
                     }
                });

                // Add some values to the list box
                mlb.add('First name', '[firstname]');
                mlb.add('Last name', '[lastname]');
                mlb.add('Address', '[address]');
				mlb.add('City', '[city]');
				mlb.add('State', '[state]');
				mlb.add('Telephone', '[phone]');
				mlb.add('Email', '[email]');
				mlb.add('Site Name', '[sitename]');
				mlb.add('Website URL', '[siteurl]');
				mlb.add('Guestbook URL', '[guesturl]');
				//mlb.add('Affiliate ID', '[affiliate]');
				//mlb.add('Ideal Help Desk URL', '[helpdesk]');
				mlb.add('Copyright', '[copyright]');
				mlb.add('Signature', '[signature]');
                // Return the new listbox instance
                return mlb;
			case 'customer_profile':
                var mlb = cm.createListBox('customer_profile', {
                     title : 'Customer Tags',
                     onselect : function(v) {
                         if(v != "")
	                         tinyMCE.activeEditor.selection.setContent(v);
                     }
                });

                // Add some values to the list box
                mlb.add('First name', '[customer_first_name]');
                mlb.add('Last name', '[customer_last_name]');
                mlb.add('Address', '[customer_address]');
				mlb.add('City', '[customer_city]');
				mlb.add('State', '[customer_state]');
				mlb.add('Country', '[customer_country]');
				mlb.add('Phone', '[customer_telephone]');
				mlb.add('URL', '[customer_url]');
				mlb.add('Email', '[customer_email]');
                // Return the new listbox instance
                return mlb;
        }
        return null;
    }
});

// Register plugin with a short name
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);

function html_edit(selector)
{
$(selector).tinymce(
{
	// Location of TinyMCE script
	script_url : 'jscripts/tiny_mce/tiny_mce.js',
	// General options
	mode : "textareas",
	theme : "advanced",
	plugins : "example,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
	// Theme options
	theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,hr,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,emotions,|,sub,sup,|,link,unlink,anchor,image,cleanup,code",
	theme_advanced_buttons2 : "admin_profile,customer_profile,|,fontselect,fontsizeselect",
	theme_advanced_buttons3 : "",
	theme_advanced_buttons4 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_resizing : true,
	// Example content CSS (should be your site CSS)
	content_css : "css/admin.css",
	// Drop lists for link/image/media/template dialogs
	template_external_list_url : "lists/template_list.js",
	external_link_list_url : "lists/link_list.js",
	external_image_list_url : "lists/image_list.js",
	media_external_list_url : "lists/media_list.js",
});
}

