function kfm_for_tiny_mce(field_name, url, type, win){
  window.SetUrl=function(url,width,height,caption){
   win.document.forms[0].elements[field_name].value = url;
   if(caption){
    win.document.forms[0].elements["alt"].value=caption;
    win.document.forms[0].elements["title"].value=caption;
   }
  }
  window.open('http://www.tgl.tv/js/tinymce/jscripts/tiny_mce/plugins/kfm/index.php?mode=selector&type='+type,'kfm','modal,width=800,height=600');
  
//  /dev2.tgl.tv/app/webroot/js/tinymce/jscripts/tiny_mce/plugins/kfm
  
}

tinyMCE.init({
		// General options
		mode : "specific_textareas",
		editor_selector : "mceEditor",
		theme : "advanced",
		plugins : "safari,pagebreak,style,iespell,insertdatetime,preview,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,inlinepopups",


		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,cleanup,image,|,insertdate,inserttime,code,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "",
		theme_advanced_buttons4 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar : false,
//		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : false,
		file_browser_callback : "kfm_for_tiny_mce",
		
		
		// These lines do not add paragraph tags
		force_p_newlines : false,
		force_br_newlines : true,
		forced_root_block : '',


		// These lines alow you to put in an absolute image url
		remove_script_host : false,
    	convert_urls : false,
	
		// Example word content CSS (should be your site CSS) this one removes paragraph margins
		content_css : "css/word.css"

	});

