var goodBrowser = 0;
if(navigator.userAgent.indexOf('MSIE 4') > -1) { goodBrowser = 1;};
if(navigator.userAgent.indexOf('MSIE 5') > -1) { goodBrowser = 1;};
if(navigator.userAgent.indexOf('MSIE 6') > -1) { goodBrowser = 1;};
if(navigator.userAgent.indexOf('MSIE 7') > -1) { goodBrowser = 1;};
if(navigator.userAgent.indexOf('Gecko') > -1)  { goodBrowser = 1;};
if(navigator.userAgent.indexOf('AppleWebKit') > -1) { goodBrowser = 0;};
document.writeln('<div id="notepadeditor" style="position:absolute;top:100px;left:200px; z-index:1000;" class="drag">');
document.writeln('<div id="toolbar">');
if(goodBrowser){
	document.writeln('	<select id="formatblock" onchange="Select(this.id);">');
	document.writeln('	<option value="<p>">Normal</option>');
	document.writeln('	<option value="<p>">Paragraph</option>');
	document.writeln('	<option value="<h1>">Heading 1</option>');
	document.writeln('	<option value="<h2>">Heading 2</option>');
	document.writeln('	<option value="<h3>">Heading 3</option>');
	document.writeln('	<option value="<h4>">Heading 4</option>');
	document.writeln('	<option value="<h5>">Heading 5</option>');
	document.writeln('	<option value="<h6>">Heading 6</option>');
	document.writeln('	<option value="<address>">Address</option>');
	document.writeln('	<option value="<pre>">Formatted</option>');
	document.writeln('	<option value="RemoveFormat">Remove Format</option>');
	document.writeln('	</select>');
	document.writeln('	<div id="buttons">');
	document.writeln('	<a href="#" onClick="formatText(\'bold\', \'\'); return false;" title="bold" id="toolbold">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'italic\', \'\'); return false;" title="italic" id="toolitalic" id="toolitalic">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'justifyleft\', \'\'); return false;" title="justifyleft" id="tooljustifyleft" id="tooljustifyleft">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'justifycenter\', \'\'); return false;" title="justifycenter" id="tooljustifycenter">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'justifyright\', \'\'); return false;" title="justifyright" id="tooljustifyright">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'insertorderedlist\', \'\'); return false;" title="insertorderedlist" id="toolinsertorderedlist">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'insertunorderedlist\', \'\'); return false;" title="insertunorderedlist" id="toolinsertunorderedlist">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'outdent\', \'\'); return false;" title="outdent" id="tooloutdent">&#160;</a>');
	document.writeln('	<a href="#" onClick="formatText(\'indent\', \'\'); return false;" title="indent" id="toolindent">&#160;</a>');
} else {
	document.writeln('	<div id="buttons">');
};
document.writeln('	<a href="#" onClick="notepadEditor(); return false;" title="save" id="toolsave" name="toolsave">&#160;</a>');
document.writeln('	<a href="#" onClick="cancelEdit(); return false;" title="Cancel" id="toolcancel" name="toolcancel">&#160;</a>');
document.writeln('	</div>');

		

document.writeln('	<br clear="all" />');
document.writeln('</div>');
if(goodBrowser){
	document.writeln('<iframe id="notepad"></iframe>');
} else {
	document.writeln('<textarea id="notepad"></textarea>');
};
document.writeln('<div id="customeditorextra"></div>');
document.writeln('	<br clear="all" />');
document.writeln('</div>');
document.close();
notepad = document.getElementById('notepad'); if(notepad.document && goodBrowser) { notepad.document.designMode= "On"; };
