function OpenWindow ( url, width, height ) {
	var wtop  = ( screen.height/2 ) - ( height/2 );
	var wleft = ( screen.width/2  ) - ( width/2  ); 
	window.open( url, '', 'width=' + width + ',height=' + height + ',top=' + wtop + ',left=' + wleft );
}

function ReloadPage () {
	PreloaderShow();
	document.location.reload();
}

function CloseWindow() {
	window.close();
}

function oprint ( id ) {
	OpenWindow( '../tools/kprint/?id=' + id, 610, 620 ); 
}

function ViewFolder ( FolderId ) {
	document.location = CAT_LINK + FolderId;
}

function ViewImage( url ) {
	var width  = 500;
	var height = 500; 
	var wtop  = ( screen.height/2 ) - ( height/2 );
	var wleft = ( screen.width/2  ) - ( width/2  ); 
	iwind = window.open( url, '', 'width=' + width + ',height=' + height + ',top=' + wtop + ',left=' + wleft + ', toolbar=no,menubar=no,location=no,scrollbars=yes' );
	iwind.focus();
	iwind.document.write('<HTML><HEAD><TITLE>...<\/TITLE><\/HEAD><BODY leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><table width=100% height=100%><tr><td align="center" valign="middle"><img src="'+url+'"></td></tr></table><\/BODY><\/HTML>');
	iwind.document.close();

}
function opencat(id){
var img = id+'_img';
//alert(img);
if(document.getElementById(id).style.display=="block")
{
 document.getElementById(id).style.display="none";
 document.getElementById(img).src="/img/plus.gif";
}
else
	{
 	document.getElementById(id).style.display="block";
  	document.getElementById(img).src="/img/minus.gif";
	}

}

<!-- /TinyMCE -->

function myCustomSaveContent(element_id, html, body) {
    html = html.replace(/<!--([^`]*)-->/,'');
    return html;
}



    tinyMCE.init({
        // General options
        mode : 'textareas',
        editor_selector : 'mceEditor',
        theme : 'advanced',
        language : 'ru',
        plugins :
'table,advhr,advimage,advlink,media,searchreplace,contextmenu,paste,safari,ibrowser,filemanager,spellchecker',
        theme_advanced_buttons1_add : 'fontselect,fontsizeselect',
        theme_advanced_buttons2_add : 'forecolor,backcolor,spellchecker,ibrowser,filemanager',
        theme_advanced_buttons2_add_before:
'cut,copy,paste,pastetext,pasteword,separator,search,replace,separator',
        theme_advanced_buttons3_add_before : 'tablecontrols,separator',
        theme_advanced_buttons3_add : 'media,advhr',
        theme_advanced_toolbar_location : 'top',
        theme_advanced_toolbar_align : 'left',
        theme_advanced_statusbar_location : 'bottom',
        content_css : '/style.css',
        external_link_list_url : 'example_link_list.js',
        external_image_list_url : 'example_image_list.js',
        flash_external_list_url : 'example_flash_list.js',
        paste_use_dialog : true,
        save_callback : 'myCustomSaveContent',
        theme_advanced_resizing : true,
        theme_advanced_resize_horizontal : true,
        paste_auto_cleanup_on_paste : false,
        paste_convert_headers_to_strong : false,
        paste_strip_class_attributes : 'all',
        paste_remove_spans : false,
        paste_remove_styles : false,
        relative_urls: false,
        cleanup : true,
        spellchecker_languages : '+Русский=ru,English=en',
        spellchecker_word_separator_chars : '\\s!\"#$%&()*+,-./:;<=>?@[\]^_{|}',
        gecko_spellcheck : true,
        extended_valid_elements : 'noindex,nofollow'
    });

<!-- /TinyMCE -->
