(function($){$.fn.jCarouselLite=function(o){o=$.extend({container:null,btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var _p=0,b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css("overflow","hidden").css("float",o.vertical?"none":"left").children().css("overflow","hidden");ul.css("margin","0").css("padding","0").css("position","relative").css("list-style-type","none").css("z-index","1");c.css("overflow","hidden").css("position","relative").css("z-index","2").css("left","0px");var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css("width",f.width()).css("height",f.height());ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");
$(window).bind('load',function(){if(o.btnPrev)$(o.btnPrev).bind('click',function(){return go(curr-o.scroll,true)});if(o.btnNext)$(o.btnNext).bind('click',function(){return go(curr+o.scroll,true)})});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto){if(o.container){$(o.container).bind('mouseover',function(){_p=1}).bind('mouseout',function(){_p=0});setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);}function vis(){return li.slice(curr).slice(0, v)};function go(a,_o){if(_o!==true&&_p==1)return false;if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);


jQuery.fn.centerObj = function() {if(!this[0]){return this;}this.vCenter();this.css('left',(($(window).width()/2)-(this.width()/2)));return this;};
/** from jQuery Form Plugin */
$.fn.formToArray = function(semantic) {
	var a = [];
	if (this.length == 0) return a;

	var form = this[0];
	var els = semantic ? form.getElementsByTagName('*') : form.elements;
	if (!els) return a;
	for(var i=0, max=els.length; i < max; i++) {
		var el = els[i];
		var n = el.name;
		if (!n) continue;

		if (semantic && form.clk && el.type == "image") {
			// handle image inputs on the fly when semantic == true
			if(!el.disabled && form.clk == el)
				a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
			continue;
		}

		var v = $.fieldValue(el, true);
		if (v && v.constructor == Array) {
			for(var j=0, jmax=v.length; j < jmax; j++)
				a.push({name: n, value: v[j]});
		}
		else if (v !== null && typeof v != 'undefined')
			a.push({name: n, value: v});
	}

	if (!semantic && form.clk) {
		// input type=='image' are not found in elements array! handle them here
		var inputs = form.getElementsByTagName("input");
		for(var i=0, max=inputs.length; i < max; i++) {
			var input = inputs[i];
			var n = input.name;
			if(n && !input.disabled && input.type == "image" && form.clk == input)
				a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
		}
	}
	return a;
};
$.fn.fieldValue = function(successful) {
	for (var val=[], i=0, max=this.length; i < max; i++) {
		var el = this[i];
		var v = $.fieldValue(el, successful);
		if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
			continue;
		v.constructor == Array ? $.merge(val, v) : val.push(v);
	}
	return val;
};
$.fieldValue = function(el, successful) {
	var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
	if (typeof successful == 'undefined') successful = true;

	if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
		(t == 'checkbox' || t == 'radio') && !el.checked ||
		(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
		tag == 'select' && el.selectedIndex == -1))
			return null;

	if (tag == 'select') {
		var index = el.selectedIndex;
		if (index < 0) return null;
		var a = [], ops = el.options;
		var one = (t == 'select-one');
		var max = (one ? index+1 : ops.length);
		for(var i=(one ? index : 0); i < max; i++) {
			var op = ops[i];
			if (op.selected) {
				// extra pain for IE...
				var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
				if (one) return v;
				a.push(v);
			}
		}
		return a;
	}
	return el.value;
};
// ER: KAS SELLE VÕIB ÄRA KUSTUTADA?
function change_search_name(id) {
   var change_name = $('#s_name_'+id).val();
		$.get(BASE_ROOT + "responser.php", { cid:id, change_name:change_name },
			function(data){
				toggleElement('#change_name_'+id);
				$('#s_name_'+id).html(data);
		});
}
//~-------------------------

function CenterPopup(URL, width, height)
{
var features='toolbar=0,resizable=1,menubar=1,location=0,scrollbars=1,status=0,' +
'width=' + width + ', ' +
'height=' + height + ', ' +
'top=' + parseInt(100) + ', ' +
'left=' + parseInt((screen.width - width)/2) + '';

window.open(URL, '', features);
//popup.focus()
}

function searchSubmit(frm){
var hidFrm = document.forms['hidSearchForm']
if (frm.keyword.value==hidFrm.hidDefaultWord.value){
frm.keyword.value='';
}
return true;
}

function showOverlayLoading(){
// Overlay
if ($('#page_overlay_2').length==0)
	$('<div id="page_overlay_2"></div>').hide().css('height',$(document).height()).css('width',$(document).width()).appendTo('body');
if ($('#img_loading').length==0)
	$('<img id="img_loading" width="100" border="0" height="100" src="'+ BASE_ROOT +'images/loading.gif" />').hide().appendTo('body');

$('#page_overlay_2').show();
$('#img_loading').centerObj().show();
}

function hideOverlayLoading(){
$('#page_overlay_2,#img_loading').hide();
}


jQuery(document).ready(function() {
// });jQuery(document).ready(function() {
	/*
	if (window.console && window.console.firebug){
		$('#leftside').before('<div class="shadowbox" style="font-weight:bold;text-align:center"><div class="header">' + LANG.active_firebug_alert + '</div></div>');
	}*/
	if ($('#mainsearch').size()!=0) {
	// Init( 'cat', "images/select.gif", "images/select.gif","arrow6", "optionTextBox6", "optionDiv6", "cell6", "cellHover6", "cellSelected6" );
	 $('#cat').multiSelect({
		select_all_min: 3,
		select_all_txt: LANG.select_all,
		no_selection: LANG.all_areas,
		selected_text: " " + LANG.chosen
	   });
	   $('#county').multiSelect({
		select_all_min: 3,
		select_all_txt: LANG.select_all,
		no_selection: LANG.all_counties,
		selected_text: " " + LANG.chosen
	   });
	// Init( 'county', "images/select.gif", "images/select.gif","arrow6", "optionTextBox6", "optionDiv6", "cell6", "cellHover6", "cellSelected6" );
	}
	if ($('#slickbox').size()!=0) {
		$('#education').multiSelect({
		select_all_min: 10,
		select_all_txt: LANG.select_all,
		no_selection: LANG.required_education, // [lang.education]
		selected_text: " " + LANG.chosen
	   });
	   $('#position').multiSelect({
		select_all_min: 10,
		select_all_txt: LANG.select_all,
		no_selection: LANG.position, // [lang.position]
		selected_text: " " + LANG.chosen
	   });
	   $('#language').multiSelect({
		select_all_min: 10,
		select_all_txt: LANG.select_all,
		no_selection: LANG.language, // [lang.position]
		selected_text: " " + LANG.chosen
	   });
		//Init( 'education', "images/select.gif", "images/select.gif","arrow6", "optionTextBox5", "optionDiv5", "cell5", "cellHover5", "cellSelected5" );
		//Init( 'position', "images/select.gif", "images/select.gif","arrow6", "optionTextBox5", "optionDiv5", "cell5", "cellHover5", "cellSelected5" );
		// hides the slickbox as soon as the DOM is ready
		// (a little sooner than page load)
		$('#slickbox').hide();
			// shows the slickbox on clicking the noted link
		$('#slick-show').click(function() {
			$('#slickbox').show('slow');
			return false;
		});
		// hides the slickbox on clicking the noted link
		$('#slick-hide').click(function() {
			$('#slickbox').hide('fast');
			return false;
		});
		// toggles the slickbox on clicking the noted link
		$('#slick-toggle').click(function() {
			$('#slickbox').toggle(400);
			$('#moresearch').toggle('fast');
			$('#lesssearch').toggle('fast');
			return false;
		});
		$('#slick-toggle2').click(function() {
			$('#slickbox').toggle(400);
			$('#moresearch').toggle('fast');
			$('#lesssearch').toggle('fast');
			return false;
		});
	}
	
	if ($("#hottest_content").size()!=0 && $("#hottest_content li.hotoffer").size()>3)
	$("#hottest_content").jCarouselLite({
		// 		visible: 4, auto: 3,
		btnNext: "#hottest_inner img.next",
        btnPrev: "#hottest_inner img.prev",
		auto: 2000,
		scroll: 2,
		speed: 800,
		circular: true,
		visible: 3,
		container: '#hottest_inner'
	});
// });jQuery(document).ready(function() {
	if ($.getURLParam("mode")=="register") {
		  $('#active_box_intro').hide();
		  $('#bannerprice').hide();
		  $('#active_box_register').show();
	}
	$('#rghtFloatBnr').each(function(){
	if ($('#onlineForm,#EditonlineForm,#RestoreonlineForm,#coletter_viewer').size()>0) return false;
	var pos = {
      sTop : function() {
        return window.pageYOffset || document.documentElement && document.documentElement.scrollTop ||	document.body.scrollTop;
      }
    };
	$rghtb = $(this);
	var TOP_b = $rghtb.position().top;
	$rghtb.css({
          position: 'absolute',
          marginTop: '0',
          top: TOP_b
        });
	
	// delete $rghtb;
	$(window).scroll(function(){
		if (pos.sTop()>TOP_b)
			$rghtb.css('top',pos.sTop());
		else
			$rghtb.css('top',TOP_b);
	});
	
});
});

/**
	LOGGED-IN USER
*/
function changepass() {
   var oldpass = $('#oldpassword').val();
   var newpass = $('#newpassword').val();
   var newpass2 = $('#newpassword2').val();
	if (oldpass=='') { 
		$("#error_message").html(LANG.insert_old_pass); 
	}
	else if (newpass!=newpass2) { 
		$("#error_message").html(LANG.error_pass_mismatch); 
	}
	else if (newpass==oldpass) { 
		$("#error_message").html(LANG.passes_match); 
	}
	else if (newpass.length<6) {
		$("#error_message").html(LANG.min_pass_length);
	}
	else {
		$.post("/changepass.php", { oldpass:oldpass,newpass:newpass },
			function(data){
			
				toggleElement('#change_passwd');
				toggleElement('#profile');
		
				alert(data);
		});
	}
} //~ function changepass
function changelogin(){
		
		var email0 = $('#oldmail').val();
		var email1 = $('#newlogin').val();
		var email2 = $('#newlogin2').val();
		if(email1!=''){
			if((email1 == email2) && email1 != email0 ){//&& (email1!='' && email2!='') && email0!=email1
				//console.log('in 1');
				$.post("responser.php?mode=change_login",
					{email: email1},
					function(msg){
						updateURLHash('#change_login',function(){toggleElement('#profile');toggleElement('#change_login');changeShadowboxHeight('#profile');})
						//toggleElement('#login_change_box');
						//toggleElement('#profile');
						$('#profile_error').html(msg).show();
						$('#newlogin').val('');
						$('#newlogin2').val('');
					}
				);
			}else if(email1!=email2){
				$('#login_message').html(LANG.error_login_mismatch).show();
				//alert('[LANG.incorrect_sep_adress]');
				$('#newlogin').focus();
				return false;
			}else if(email0==email1){
				//alert('[LANG.incorrect_update]');
				$('#login_message').html(LANG.error_same_login).show();
				$('#newlogin').focus();
				return false;
			}
		}else{
		
			$('#login_message').html(LANG.mail_empty_fields).show();
			$('#newlogin').focus();
			return false;
		}
} //~ function changelogin
/*
$(document).ready(function() {
	if ($('#navmenu a.logout').size()!=0) $('#navmenu a.logout').click(function(){
		$.get(BASE_ROOT + "login.php", { logout:1 }),
		window.location = BASE_ROOT;
	});
});
*/
/**
	* ANONYMOUS functions
*/
function sendNewPassword(){
	if($('#username').val() == ''){
		alert(LANG.enter_email);
	}else{
		$('#remindpass').hide();
		$.post(BASE_ROOT+'responser.php?mode=send_new_password',
			{'email': $('#username').val()},
			function(data){
				alert(data.msg);
				$('#remindpass').show();
			},'json'
		)
	}
}
/*
$(document).ready(function() {
	if ($('#navmenu img.login').size()!=0)
	$('#navmenu img.login').click(function(){

		if ($('#login_box').html()==null) {
			// Overlay
			$('<div id="page_overlay"></div>').hide().click(function(){
				$('#login_box,#page_overlay,#img_loading').hide();
			}).appendTo('body');
			
			$('<div id="login_box"></div>').hide().appendTo('body');
			$('<form method="post" id="loginform" name="loginform" action="'+BASE_ROOT+'login.php" onsubmit="return false;"><div class="formErrors"></div><div style="margin-bottom:10px;">' + LANG.email_username + '<br />'+
				'<input name="username" id="username" type="text" class="textbox" /><br />' + LANG.password + '&nbsp;<span style="font-size:10px;cursor:pointer;cursor:hand;color:#EEEEEE;" onclick="sendNewPassword()">(' + LANG.forgot + '&nbsp;' + LANG.here  + ')</span>' + '<br /><input name="pass" type="password" class="textbox" /></div>'+
				'<input type="submit" class="submit" value="' + LANG.sign_in + '" style="font: 11px/18px Tahoma, sans-serif;width:93px;height: 25px;border: 1px solid #FFFFFF;background: #2D2D2D;color: #FFFFFF;font-weight:bold;float:left;margin-left:55px" /><input type="button" onclick="$(\'#login_box,#page_overlay,#img_loading\').hide();return false;" class="submit" value="' + LANG.cancel + '" style="font: 11px/18px Tahoma, sans-serif;width: 93px;height: 25px;border: 1px solid #FFFFFF;background: #2D2D2D;color: #FFFFFF;font-weight:bold;float:left;margin-left:6px;" /></form>').
				submit(function(){
					$('#login_box').hide();
					$("div.formErrors").hide();
					$('#img_loading').centerObj().show();
					//http://be.twixt.us/jquery/formSubmission.php
					$.post(this.getAttribute("action"), $(this).formToArray(), function(xml){
						/*	VASTUSE vorm
								<AjaxResponse error="&#9;Email address is a reqiured field.&#10;&#9;Password is a reqiured field.& 
								#10;&#9;Name is a reqiured field.&#10;&#9;Location is a reqiured field.&#10;" focus="txtAccountEmail" redirecturl="formSubmissionSuccess.php" />
						*/
					/*	$('#img_loading').hide();
						strError = LANG.sign_in_error;
						oFocus = null;
						$("AjaxResponse", xml).each(function() {
							strRedirect = this.getAttribute("redirecturl");
							strError = this.getAttribute("error");
							oFocus = this.getAttribute("focus");
						});
						if (!strError) {
							window.location = strRedirect;
						}else{
							$('#login_box').show();
							//alert("The following errors were encountered:\n" + strError);
							$("div.formErrors").html("<h3>" + LANG.c_error + "<\/h3><ul>" + strError.replace(/(\t)(.+)/g, "<li>$2<\/li>") + "<\/ul>").
								filter(":hidden").fadeIn("normal");
							if (oFocus) $("#" + oFocus).get(0).focus();
						}
					});
					return false;
				}).
				appendTo('#login_box');
			$('<img id="img_loading" width="100" border="0" height="100" src="'+ BASE_ROOT +'images/loading.gif" />').hide().appendTo('body');
		}
		$('#page_overlay').css('height',$(document).height()).css('width',$(document).width()).show();
		$('#login_box').centerObj().show();
		$("#username").get(0).focus();
	});
/*	
	// style form file input fields
	$("input[type=file]").filestyle({ 
	    image: "../images/file_submit.gif",
	    imageheight : 20,
	    imagewidth : 80,
	    width : 193,
	    text: 'browse'
	});
*/	
/*});*/

function processJson_company(data) { 
    // 'data' is the json object returned from the server 
	var res = $('#done_text').empty();
	if(data.error == 2){
	  res.append(data.message);
	}else{
	  $('#active_box_register').hide();
	  res.append(data.message);
	} // end of else
	hideOverlayLoading();
	$.scrollTo("#content");
	$('#done_text').hide().fadeIn("normal");
}


//anon && employer func
function processJson_newUser(data) { 
    // 'data' is the json object returned from the server 
	var res = $('#error').empty();
	hideOverlayLoading();
	if(data.error == 2){
	  res.append(data.message);
	}else{
	  toggleElement('#new_user');
	  res.append(data.message);
	} // end of else
	changeShadowboxHeight('#content div.shadowbox');
	$.scrollTo(res);
}
	

$(window).bind('load',function() {
// NEW EMPLOYER
// validate signup form on keyup and submit
if ($('#signupForm').size()!=0)
$("#signupForm").validate({
	rules: {
	company_name: "required",
	reg_code: {
		required: true,
		minlength: 8
	},
	phone: {
	required: true,
	minlength: 6
	},
	email: {
	required: true,
	email: true
	},
	useremail: {
	required: true,
	email: true
	},
	address: "required",
	password: {
	required: true,
	minlength: 6
	},
	confirm_password: {
	required: true,
	minlength: 5,
	equalTo: "#password"
	},
	agree: "required"
	},
	messages: {
	company_name: "<br />" + LANG.insert_company_name,
	reg_code: {
		required: "<br />" + LANG.insert_company_reg_code,
		minlength: "<br />" + LANG.short_reg_code
	},
	phone: {
	required: "<br />" + LANG.insert_phone_number,
	minlength: "<br />" + LANG.short_phone_number
	},
	address: "<br />" + LANG.insert_company_address,

	password: {
	required: "<br />" + LANG.insert_pass,
	minlength: "<br />" + LANG.min_pass_length_error
	},
	confirm_password: {
	required: "<br />" + LANG.insert_pass,
	minlength: "<br />" + LANG.min_pass_length_error,
	equalTo: "<br />" + LANG.pass_mismatch
	},
	email: "<br />" + LANG.insert_email,
	useremail: "<br />" + LANG.insert_email,
	agree: "<br />" + LANG.read_contract
	},
	submitHandler: function() {
		showOverlayLoading();
		$('#signupForm').ajaxSubmit({ 
		//target:        '#response',   // target element(s) to be updated with server response 
		url: BASE_ROOT + 'responser.php?mode=company_reg',        // override for form's 'action' attribute 
		type: 'post',        // 'get' or 'post', override for form's 'method' attribute 
		dataType: 'json',        // 'xml', 'script', or 'json' (expected server response type) 
		success: processJson_company // post-submit callback 
		//clearForm: true        // clear all form fields after successful submit 
		//resetForm: true        // reset the form after successful submit 
		});
	}
});

// validate signup form on keyup and submit
if ($('#signupUserForm').size()!=0){
	$('#signupUserForm').validate({
		rules: {
			firstname: "required",
			lastname: "required",
			email_username: {
				required: true,
				email: true
			},

			password: {
				required: true,
				minlength: 6
			},
			confirm_password: {
				required: true,
				minlength: 5,
				equalTo: "#password"
			},
			agree: "required",
			agree2: "required"
		},
		messages: {

			firstname: "<br />" + LANG.insert_firstname,
			lastname: "<br />" + LANG.insert_lastname,
			password: {
				required: "<br />" + LANG.insert_pass,
				minlength: "<br />" + LANG.min_pass_length_error
			},
			confirm_password: {
				required: "<br />" + LANG.insert_pass,
				minlength: "<br />" + LANG.min_pass_length_error,
				equalTo: "<br />" + LANG.pass_mismatch
			},
			email_username: "<br />" + LANG.insert_email,
			agree: "<br />" + LANG.read_contract,
			agree2: "<br />" + LANG.read_personal_data_conditions
		},
	submitHandler: function() {
			showOverlayLoading();
			$('#signupUserForm').ajaxSubmit({
			//target:        '#response',   // target element(s) to be updated with server response 
				url:        BASE_ROOT + 'responser.php?mode=reg_new_user',        // override for form's 'action' attribute 
			//type:      type        // 'get' or 'post', override for form's 'method' attribute 
				dataType:  'json',        // 'xml', 'script', or 'json' (expected server response type) 
				success:	processJson_newUser  // post-submit callback 
			//clearForm: true        // clear all form fields after successful submit 
			//resetForm: true        // reset the form after successful submit 
			});
	}
	});
}
}); //~ $(document).ready
function nospam(a, b) { locstr = "mai" + "lto:" + a + "@" + b; window.location = locstr; }

var URLHASH="";

function updateURLHash(_hash, _process_func){
//	if(URLHASH!=_hash)window.location.hash=_hash;
	//URLHASH=_hash;
	$.scrollTo($(_hash).parent());
	return typeof(_process_func)=='function'?_process_func():true;
}

function showAjaxLoading(){
	$('<div id="ajaxLoadingMsg">' + LANG.sending + '...</div>').centerObj().appendTo('body');
	$('body').css('cursor','wait');
}
function hideAjaxLoading(){
	$('body').css('cursor','auto');
	$('#ajaxLoadingMsg').remove();
}

// MCE editor initialization
var MCE_inited = false;

var EJMCE={
	initEditMode: function() {
		tinyMCE_GZ.init({
		    themes : "advanced",
		    plugins : "safari,inlinepopups,table,contextmenu,paste,advimage,fullscreen,advhr,preview,visualchars",
		    languages : "en",
		    disk_cache : true
		}, function() { 
			tinyMCE.init({
				mode : "textareas",
				editor_selector : "mceEditor",
				theme : "advanced",
				skin : "wp_theme", //o2k7 
				plugins : "safari,inlinepopups,table,contextmenu,paste,advimage,fullscreen,advhr,preview,visualchars",
				apply_source_formatting : "true",
				theme_advanced_toolbar_location : "top",
				theme_advanced_toolbar_align : "left",
				theme_advanced_buttons1 :		"preview,|,bold,italic,underline,strikethrough,charmap,|,"+
					"justifyleft,justifycenter,justifyright,justifyfull,"+
					"|,bullist,numlist,indent,outdent,|,formatselect,|,"+
			        	"link,unlink,anchor,hr",
				theme_advanced_buttons2 : 
					"tablecontrols,|,image,removeformat,code,pasteword,visualchars,visualaid,|,fullscreen",
					theme_advanced_buttons3 : "",
				remove_script_host : "true",
				document_base_url : BASE_ROOT,
				relative_urls : "true",
				fullscreen_new_window : "true",
				verify_html : "false",
				theme_advanced_blockformats : "p,h4,h3",
				paste_auto_cleanup_on_paste : true,
				content_css: BASE_ROOT2 + "javascripts/tiny_mce/adm_article_edit.css",
				theme_advanced_path_location : "bottom",
				valid_elements : "" +
					"+a[id|style|rel|rev|dir|lang|tabindex|accesskey|type|name|href|target=_blank|title|class]," + 
					"-strong/-b[class|style]," + 
					"-em/-i[class|style]," + 
					"-strike[class|style]," + 
					"-u[class|style]," + 
					"#p[id|style|dir|class|align]," + 
					"-ol[class|style]," + 
					"-ul[class|style]," + 
					"-li[class|style]," + 
					 "br," + 
					 "iframe[align<bottom?left?middle?right?top|class|frameborder|height|id"+
					 "|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style"  +"|title|width]," +
					 "img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align]," + 
					"-sub[style|class]," + 
					"-sup[style|class]," + 
					"-blockquote[dir|style]," + 
					"-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor]," + 
					"-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor]," + 
					 "tbody[id|class]," + 
					 "thead[id|class]," + 
					 "tfoot[id|class]," + 
					"-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope]," + 
					"-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope]," + 
					 "caption[id|lang|dir|class|style]," + 
					"-div[id|dir|class|align|style],"  +
					"object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width" +
					"|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,"+
					"-span[style|class|align]," + 
					"-pre[class|align|style]," + 
					 "address[class|align|style]," + 
					"-h1[id|style|dir|class|align]," + 
					"-h2[id|style|dir|class|align]," + 
					"-h3[id|style|dir|class|align]," + 
					"-h4[id|style|dir|class|align]," + 
					"-h5[id|style|dir|class|align]," + 
					"-h6[id|style|dir|class|align]," + 
					 "hr[class|style]," + 
					"-font[size|style|id|class|dir|color]," + 
					 "dd[id|class|title|style|dir|lang]," + 
					 "dl[id|class|title|style|dir|lang]," + 
					 "dt[id|class|title|style|dir|lang]",
				theme_advanced_resizing : true /* ,
				theme_advanced_buttons1_add_before : "preview,separator",
				theme_advanced_buttons1_add: "separator,cut,copy,paste,pastetext,pasteword,separator,search,replace",
				theme_advanced_buttons2_add : "separator,tablecontrols",
				theme_advanced_buttons3_add : "separator,fullscreen,nonbreaking,visualchars" */
			});
		});
		
		MCE_inited = true;
	}
}