init#editfield#editor=function(#primarykey#){
	tinyMCE.init({
		mode : "textareas",
		theme : "advanced",
		plugins: 'paste, advimage',
		theme_advanced_buttons1:"image,medialib,layout_youtube,|,bold,italic,underline,strikethrough,|,forecolor,backcolor,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink",
		//theme_advanced_buttons2:"fontselect,fontsizeselect,|,justifyleft,justifycenter,justifyright,justifyfull,|,code",
		theme_advanced_buttons2:"noamp,layout_headline,layout_col2,layout_colside_right,|,code",
		editor_selector:'#editfield#editor_'+#primarykey#,
		extended_valid_elements : 'img[class|ampwidth|ampheight|src]',
		paste_preprocess:function(pl,o){paste_clean_image(o);},		
		height:300,
		content_css:'tiny_mce/editor.css?v='+hb(),
	    setup: function(ed) {
		    ed.addButton('medialib',{title:'media library',image:'tiny_mce/icons/image.gif',onclick:function(){ loadfs('Media Library','showmedialibrary');}});
		    ed.addButton('noamp',{title:'AMP exclusion zone',image:'tiny_mce/icons/noamp.gif',onclick:function(){ed.selection.setContent(mcetemplates.noamp(ed));}});
		    ed.addButton('layout_headline',{title:'headline',image:'tiny_mce/icons/headline.gif',onclick:function(){ed.selection.setContent(mcetemplates.headline(ed));}});
		    ed.addButton('layout_col2',{title:'2-column',image:'tiny_mce/icons/col2.gif',onclick:function(){ed.selection.setContent(mcetemplates.col2);}});
		    ed.addButton('layout_colside_right',{title:'side column (right)',image:'tiny_mce/icons/col-side-right.gif',onclick:function(){ed.selection.setContent(mcetemplates.colsideright);}});
		    ed.addButton('layout_qna',{title:'QnA',image:'tiny_mce/icons/qna.gif',onclick:function(){ed.selection.setContent(mcetemplates.qna);}});
		    ed.addButton('layout_youtube',{title:'youtube video',image:'tiny_mce/icons/youtube.gif',onclick:function(){var key=prompt('Enter YouTube Video Key');ed.selection.setContent(mcetemplates.youtube(key));}});
		},
		init_instance_callback:function(ed){ //declare null functions, eg:
			ed.getDoc().showqna=function(){}
		}				
	});		
}
