	function clickPublish(q){
		p=document.getElementById('publish');
		if(q.checked){
			p.style.visibility='visible';
			today=new Date();
			m=today.getMonth()+1;
			if(m<10)
				m='0'+m;
			d=today.getDate();
			if(d<10)
				d='0'+d;
			document.forms.articleForm.publish_date.value=d+"-"+m+"-"+today.getFullYear();
		}else{
			p.style.visibility='hidden';
			document.forms.articleForm.publish_date.value='00-00-0000';
		}
	}
	
	function clickArchive(q){
		p=document.getElementById('archive');
		if(q.checked){
			p.style.visibility='visible';
			today=new Date();
			m=today.getMonth()+1;
			if(m<10)
				m='0'+m;
			d=today.getDate();
			if(d<10)
				d='0'+d;
			document.forms.articleForm.archive_date.value=d+"-"+m+"-"+today.getFullYear();
		}else{
			p.style.visibility='hidden';
			document.forms.articleForm.archive_date.value='00-00-0000';
		}
	}

	function updateArticle(){
		document.forms['articleForm'].submit();
	}


	


	tinyMCE.init({
		editor_selector : "editor_body",
		mode : "textareas",
		theme : "advanced",
		plugins : "spellchecker,style,table,save,advhr,advimage,advlink,media,searchreplace,contextmenu,paste,filemanager",
		theme_advanced_buttons1_add : "print,forecolor,backcolor",
		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 : "spellchecker,media",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_styles : "Afbeelding links=leftimage;Afbeelding rechts=rightimage",
		
	    plugin_insertdate_dateFormat : "%d-%m-%Y",
	    plugin_insertdate_timeFormat : "%H:%M:%S",
		extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],p[lang]",
		theme_advanced_resize_horizontal : false,
		theme_advanced_resizing : true,
		apply_source_formatting : true,
		spellchecker_languages : "+Dutch=nl,English=en",
		filemanager_path : "/var/www/www.arbode.nl/html/documents",
		filemanager_rootpath : "/var/www/www.arbode.nl/html/documents"
	});
