function initRTE(){
	tinyMCE.init({
		// General options
		mode : "exact",
		elements : "content",
		height : "500px",
		width: "900px",
		language : "sl",



		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,advhr,advimage,advlink,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
		//plugins : "advimage,advlink,media,contextmenu",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull|,insertdate,inserttime,preview",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,ibrowser,cleanup,help,code,|,ibrowser",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "formatselect,fontselect,fontsizeselect,|,forecolor,backcolor",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : false,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",
		file_browser_callback : "ajaxfilemanager",
		paste_use_dialog : false,
		theme_advanced_resizing : true,
		theme_advanced_resize_horizontal : false,
		apply_source_formatting : true,
		force_br_newlines : true,
		force_p_newlines : true,	
		relative_urls : false
	
	}); 

}
function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../ajaxfilemanager/ajaxfilemanager.php?editor=tinymce";
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
            tinyMCE.activeEditor.windowManager.open({
                url: "../ajaxfilemanager/ajaxfilemanager.php?editor=tinymce",
                width: 782,
                height: 440,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });
            
/*            return false;			
			var fileBrowserWindow = new Array();
			fileBrowserWindow["file"] = ajaxfilemanagerurl;
			fileBrowserWindow["title"] = "Ajax File Manager";
			fileBrowserWindow["width"] = "782";
			fileBrowserWindow["height"] = "440";
			fileBrowserWindow["close_previous"] = "no";
			tinyMCE.openWindow(fileBrowserWindow, {
			  window : win,
			  input : field_name,
			  resizable : "yes",
			  inline : "yes",
			  editor_id : tinyMCE.getWindowArg("editor_id")
			});
			
			return false;*/
		}


function showQuestion(quest, href){
	if (confirm(quest)){
	document.location.href = href;	
	}
}

var prevOpen = '';
function showDiv(divId){
	if (prevOpen != '')
		hideDiv(prevOpen);
	if (document.getElementById(divId) != null){
		document.getElementById(divId).style.display = 'block';
		prevOpen = divId;
	}
}

function closeRemains(){
	if (prevOpen != '')
		hideDiv(prevOpen);
	prevOpen = '';
	
}

function hideDiv(divId){
	document.getElementById(divId).style.display = 'none';
	prevOpen = '';
}

function openSB(module, id){
	Mediabox.open('connectors/loadContent.php?module='+module+'&id='+id, '', '700 500');
}

