var body=0;
linkvar = 0;

function addlink() {
	var L=prompt('Type the complete address of the link',"http://");
	var N=prompt('type the name of the link as you want it to be shown on the page',"");
	if (L || N != "" || null) 
	{
		document.Form1.text.value=document.Form1.text.value + '<A TARGET="_blank" HREF="' + L + '">' + N + '</A>' + '\r'
	
	}
}



function getEditor() {
	document.writeln("<link rel=\"STYLESHEET\" type=\"text/css\" href=\"editorStyle.css\">")
	document.writeln("<div class=\"editor\">")
	document.writeln("<span id=\"caption\">&nbsp;mini HTML Editor&nbsp;</span>")
	document.writeln("<div id=\"editor\">")
	document.writeln("<div id=\"toolBar\" style=\"background-color: #EFEDDE;\"><img src=\"images/separetor.gif\" width=\"3\" height=\"22\" alt=\"\" border=\"0\" hspace=\"0\" vspace=\"1\"><img onMouseOver=\"this.src='images/boldOver.gif'\" onMouseLeave=\"this.src='images/bold.gif'\" src=\"images/bold.gif\" width=\"23\" height=\"22\" alt=\"Bold\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('bold')\"><img onMouseOver=\"this.src='images/italicOver.gif'\" onMouseLeave=\"this.src='images/italic.gif'\" src=\"images/italic.gif\" width=\"23\" height=\"22\" alt=\"Italic\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('italic')\"><img onMouseOver=\"this.src='images/unorderedListOver.gif'\" onMouseLeave=\"this.src='images/unorderedList.gif'\" src=\"images/unorderedList.gif\" width=\"23\" height=\"22\" alt=\"Bullets\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('insertUnorderedList')\"><img onMouseOver=\"this.src='images/orderedListOver.gif'\" onMouseLeave=\"this.src='images/orderedList.gif'\" src=\"images/orderedList.gif\" width=\"23\" height=\"22\" alt=\"Numbering\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('insertOrderedList')\"><img onMouseOver=\"this.src='images/linkOver.gif'\" onMouseLeave=\"this.src='images/link.gif'\" src=\"images/link.gif\" width=\"23\" height=\"22\" alt=\"Insert Hyperlink\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('createLink')\"><img onMouseOver=\"this.src='images/fontBigOver.gif'\" onMouseLeave=\"this.src='images/fontBig.gif'\" src=\"images/fontBig.gif\" width=\"23\" height=\"22\" alt=\"Font Big\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('fontSize', false, 3)\"><img onMouseOver=\"this.src='images/fontNormalOver.gif'\" onMouseLeave=\"this.src='images/fontNormal.gif'\" src=\"images/fontNormal.gif\" width=\"23\" height=\"22\" alt=\"Font Normal\" border=\"0\" hspace=\"0\" vspace=\"1\" onClick=\"document.execCommand('removeFormat')\"></div>")
	document.write("<div id=\"page\" contentEditable=\"true\"></div>")
	document.writeln("<br>")
	document.writeln("</div>")
	document.writeln("</div>")
}

function setSelectable(itemForm) {
	for (i=0; i< document.all.length; i++)
		document.all(i).unselectable = "on";
	page.unselectable = "off";
	for (i=0; i< itemForm.elements.length; i++)
		itemForm.elements(i).unselectable = "off";
}

function submitForm(itemForm)
{
	itemForm.elements("text").value = page.innerHTML;
}

function setEditorText(textStr)
{
	document.all("page").innerHTML = textStr;
}

