function domakefck(name,toolbar,hoogte, basepath, customconfpath) {
	var oFCKeditor = new FCKeditor( name );
	oFCKeditor.BasePath = basepath;
	oFCKeditor.Config['CustomConfigurationsPath'] = customconfpath;
	oFCKeditor.ToolbarSet = toolbar;
	oFCKeditor.Height = hoogte ;
	oFCKeditor.EnableSafari = true ;
	oFCKeditor.ReplaceTextarea();
	FCKeditorAPI = null;
	__FCKeditorNS = null;
}
var FCKeditorLoaded = false;
function FCKeditor_OnComplete(editorInstance) {
	FCKeditorLoaded = true;
}
function switchEditors(ID) {
	if(!document.all){
		if(!FCKeditorLoaded) {
	    	setTimeout('switchEditors(\'' + ID + '\')', 500);
	    	return;
	  	}
	 	DoSwitchEditors(document.getElementById(ID));
	}
}
function DoSwitchEditors(oNode) {
	var i;
	for (i = 0; i < oNode.childNodes.length;i++) {
		childNode = oNode.childNodes.item(i);
		editor = FCKeditorAPI.GetInstance(childNode.name);
		if (editor && editor.EditorDocument && editor.EditMode == FCK_EDITMODE_WYSIWYG) {
			editor.SwitchEditMode();
			editor.SwitchEditMode();
		}
		DoSwitchEditors(childNode);
	}
}

/**
 * Met deze methode wordt getest of een javascript geladen is of niet, indien niet dan wordt hij geladen.
 * Deze methode kan oa gebruikt worden als je een js library wil gebruiken maar je wil hem niet in
 * standardheader.vm van ContentFrame stoppen omdat hij niet vaak gebruikt wordt.
 */
function ensureJSLoad(src){
	var scripts = document.getElementsByTagName("script");
	for(i=0; i<scripts.length; i++){
		if(scripts[i].src.match(src)){
			return;
		}
	}
	var head = document.getElementsByTagName("head")[0];
   	var script = document.createElement('script');
   	script.type = 'text/javascript';
   	script.src = src;
   	head.appendChild(script);
}

/**
 * Met deze methode wordt getest of een css geladen is of niet, indien niet dan wordt hij geladen.
 * Deze methode kan oa gebruikt worden als je een css bestand wil gebruiken maar je wil hem niet in
 * standardheader.vm van ContentFrame stoppen omdat hij niet vaak gebruikt wordt.
 */
function ensureCSSLoad(src){
	var links = document.getElementsByTagName("link");
	for(i=0; i<links.length; i++){
		if(links[i].href.match(src)){
			return;
		}
	}
	var head = document.getElementsByTagName("head")[0];
	var cssNode = document.createElement('link');
   	cssNode.type = 'text/css';
   	cssNode.rel = 'stylesheet';
   	cssNode.href = src;
   	cssNode.media = 'screen';
   	head.appendChild(cssNode);
}
