$(function(){
	if ('' != $('#searchtext').val())
    {
        $('#password').addClass('searchtext_active');
    }
    
//---------------------------------------------------------------------------------------------------------------------
    
    $('#searchtext').focus(function(){
        $(this).addClass('searchtext_active');
    });
    
    
//---------------------------------------------------------------------------------------------------------------------
    
    $('#searchtext').blur(function(){
        if ('' == $(this).val())
        {
            $(this).removeClass('searchtext_active');
        }
    });

    attachEditor();
});

function attachEditor() {
	$('.tinymce').tinymce(
	{
		// Location of TinyMCE script
		script_url : '/js/lib/tiny_mce/tiny_mce.js',

		// General options
		theme : 'advanced',
		plugins : '-example,table,advimage,advlink,inlinepopups,preview,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,advlist',

		// Theme options
		theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,fullscreen,preview,code',
		theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,image,cleanup,|,forecolor,backcolor,|,nonbreaking',
		theme_advanced_buttons3 : 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,|,cite,abbr,acronym',
		theme_advanced_toolbar_location : 'top',
		theme_advanced_toolbar_align : 'left',
		theme_advanced_statusbar_location : 'bottom',
		theme_advanced_resizing : true,

		// 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',
		
		relative_urls : false,
		remove_script_host : false
	});

	$('.tinymce_min').tinymce({
		// Location of TinyMCE script
		script_url : '/js/lib/tiny_mce/tiny_mce.js',

		// General options
		theme : 'advanced',
		// plugins : '-example,table,advimage,advlink,inlinepopups,preview,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,advlist',

		// Theme options
		theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,|,fullscreen,preview,code',
		theme_advanced_buttons2 : '',
		theme_advanced_buttons3 : '',
		theme_advanced_toolbar_location : 'top',
		theme_advanced_toolbar_align : 'center',
		theme_advanced_resizing : false,
		
		relative_urls : false,
		remove_script_host : false		
	});
}
