var viewMode = 1; // WYSIWYG

function Init(){
	htmlEditor.document.designMode = 'On';
}

function getHTML() { // Assign the HTML code to a hidden form variable 
	var htmlCode = htmlEditor.document.body.innerHTML; 
	document.form1.inhoud.value = htmlCode;
}



function doBold(){ 
	htmlEditor.document.execCommand('bold', false, null); 
}

function doItalic(){ 
	htmlEditor.document.execCommand('italic', false, null); 
}

function doUnderline(){ 
	htmlEditor.document.execCommand('underline', false, null); 
}

function doLeft(){ 
	htmlEditor.document.execCommand('justifyleft', false, null); 
}

function doCenter(){ 
	htmlEditor.document.execCommand('justifycenter', false, null); 
}

function doRight(){ 
	htmlEditor.document.execCommand('justifyright', false, null); 
}

function doIndent(){ 
	htmlEditor.document.execCommand('indent', false, null); 
}

function doOutdent(){ 
	htmlEditor.document.execCommand('outdent', false, null); 
}

function doBulList(){ 
	htmlEditor.document.execCommand('insertunorderedlist', false, null); 
}

function doOrderList(){ 
	htmlEditor.document.execCommand('insertorderedlist', false, null); 
}

function doLink(){ 
	htmlEditor.document.execCommand('createlink'); 
}

function doImage(){ 
	var imgSrc = prompt('Geef de locatie van de afbeelding op', ''); 
	if(imgSrc != null) 
		htmlEditor.document.execCommand('insertimage', false, imgSrc); 
}

function doVacatures(){
	htmlEditor.document.body.innerHTML = htmlEditor.document.body.innerHTML + "{VACATURES}";
}

function doToggleView() { 
	if(viewMode == 1) { 
		var iHTML = htmlEditor.document.body.innerHTML; 
		htmlEditor.document.body.innerText = iHTML; 
		// Hide all controls 
		tblCtrls.style.display = 'none'; 
		//selFont.style.display = 'none'; 
		//selSize.style.display = 'none'; 
		//selHeading.style.display = 'none'; 
		htmlEditor.focus(); 
		viewMode = 2; // Code 
	} else { 
		var iText = htmlEditor.document.body.innerText; 
		htmlEditor.document.body.innerHTML = iText; 
		// Show all controls 
		tblCtrls.style.display = 'inline'; 
		//selFont.style.display = 'inline'; 
		//selSize.style.display = 'inline'; 
		//selHeading.style.display = 'inline'; 
		htmlEditor.focus(); 
		viewMode = 1; // WYSIWYG 
	} 
}

