	$().ready(function() {
		$('textarea.tinymce').tinymce({
			// Location of TinyMCE script
			script_url : '/etiny/tiny_mce.js',

			// General options
				plugins : "wordcount,safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras", 
				mode : "textareas", 
				theme : "advanced", 
			// Theme options 
				theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,bullist,numlist", 
				theme_advanced_buttons2 : "", 
				theme_advanced_buttons3 : "", 
				theme_advanced_toolbar_location : "top", 
				theme_advanced_toolbar_align : "center", 
				theme_advanced_statusbar_location : "none", 
				theme_advanced_resizing : false, 
				
				theme_advanced_resizing_use_cookie : false,

				theme_advanced_path : false,

				forced_root_block : false,
    				force_p_newlines : false,
    				remove_linebreaks : false,
    				force_br_newlines : true,
   				remove_trailing_nbsp : false,
    				verify_html : false,

				keep_styles : false,
				relative_urls : false,
				remove_script_host : false,

				apply_source_formatting : true,
				//theme_advanced_disable : "bold,italic",
				theme_advanced_more_colors : true,

				invalid_elements : "span,script",
				convert_newlines_to_brs : true,
				convert_fonts_to_spans : false,
				entity_encoding : "raw",



			// Example content CSS (should be your site CSS)
			content_css : "/etiny/themes/advanced/skins/default/content.css",


			// Replace values for the template plugin
			template_replace_values : {
				username : "Some User",
				staffid : "991234"
			},

    			setup : function(ed) {
        			// Display an alert onclick
        			ed.onClick.add(function(ed) {
					var content = ed.getContent();
					if( content == "Ââåäèòå çäåñü ñâîé êîììåíòàðèé" ) {
						ed.setContent(''); //ed.selection.setContent('<STRONG>Hello world!</STRONG>');
					}
        			});
        			ed.onDeactivate.add(function(ed) {
					var content = ed.getContent(); alert(content);
					if( content == "" ) {
						ed.setContent('Ââåäèòå çäåñü ñâîé êîììåíòàðèé'); 
					}
        			});
        			// Add a custom button
        			ed.addButton('mybutton', {
            				title : 'My button',
            				image : 'img/example.gif',
           				onclick : function() {
               				ed.selection.setContent('<STRONG>Hello world!</STRONG>');
					}
            			});
			}
		});
	});

