	
	$().ready(function() {
		$('textarea.tinymce').tinymce({
			script_url : '/js/vendors/tiny_mce/tiny_mce.js',

			//theme : "simple",
			theme : "advanced",
			plugins : "safari,pagebreak,emotions,xhtmlxtras",
			//theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,bullist,numlist,|,link,unlink,|,undo,cleanup,|,emotions,", 
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,bullist,numlist,|,undo,cleanup,|,emotions,", 
			theme_advanced_buttons2 : "", 
			theme_advanced_buttons3 : "",

			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : false,
			theme_advanced_path : false,
			
			forced_root_block : false,
			force_br_newlines : true,
			force_p_newlines : false,
			
			relative_urls : false,

			height : "240",

			content_css : "/css/forum.css"
		});
	});
	
	function forum_new_topic(topic_id, in_page) {
		in_page = true;
		if (in_page) {
			document.location.href = 'http://www.vacantalowcost.ro/forum/adauga/discutie/subiect_'+topic_id+'.html';
			return false;
		}
		document.location.hash = 'adauga_subiect';
		$('#topic_append').slideDown();
		
		return false;
	}
	
	function forum_add_topic(form) {
		document.getElementById('topic_id').value = PAGE_DATA.ident;
		form.action = 'http://www.vacantalowcost.ro/forum/adauga/discutie/subiect_' + PAGE_DATA.ident + '.html';
		return true;
	}
	
	function forum_cancel_topic() {
		document.location.hash = '#';
		$('#topic_append').slideUp();
		return false;
	}
	
	function forum_new_post(topic_id, in_page) {
		in_page = true;
		if (in_page) {
			document.location.href = 'http://www.vacantalowcost.ro/forum/adauga/postare/subiect_'+topic_id+'.html';
			return false;
		}
		document.location.hash = 'adauga_postare';
		$('#post_append').slideDown();
		return false;
	}
	
	function forum_add_post(form) {
		document.getElementById('post_topic_id').value = PAGE_DATA.ident;
		form.action = 'http://www.vacantalowcost.ro/forum/adauga/postare/subiect_' + PAGE_DATA.ident + '.html';
		return true;
	}
	
	function forum_cancel_post() {
		document.location.hash = '#';
		$('#post_append').slideUp();
		return false;
	}
	
	function forum_jump_to(url) {
		document.location.href = url;
		return false;
	}
	
