<!--
// WebCreator 2.1
// by Kevin Lynn Brown
// ©1998 All Rights Reserved
// Myers Internet Services
/******************** ENFORCE PROPER HTML ENCODING *********************/

function isoDateTime() {
	// ISO-8601 Date-time format
	// YYYY-MM-DDThh:mm:ssTZD
	// for PICS and 'datetime' attribute
	var now = new Date();
	var tz = now.getTimezoneOffset()/60+1;
	tz = tz.toString();
	if (tz.length < 2) {
		tz="0"+tz;
	}
	tz="-" + tz + ":00";
	yr=now.getYear();
	yr=(yr<99) ? yr+1900:yr;
	var mo = now.getMonth()+1;
	var hr = now.getHours();
	var date = now.getDate();
	var min = now.getMinutes();
	var sec = now.getSeconds();
	mo=(mo<10) ? "0"+mo:mo;
	hr=(hr<10) ? "0"+hr:hr;
	date=(date<10) ? "0"+date:date;
	min=(min<10) ? "0"+min:min;
	sec=(sec<10) ? "0"+sec:sec;
	iso8601=yr + "-" + mo + "-" + date + "T" + hr + ":" + min + ":" +  sec + tz;
	return iso8601;
}
function template(location) {
	if (location=="header") {		
		var doc=document.ed;
		var doc2=document.core;
		var meta="";
		var head="";
		var now = new Date();
		if (doc.HTML.value.substring(0,14)=="<!DOCTYPE HTML") {
			startOver("form","HTML");
		}
		robotC=doc2.noRobots.options[doc2.noRobots.selectedIndex].value;
		meta+=(doc2.content.checked) ? "    <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html\; charset=ISO-8859-1\">\n":"";
		meta+=(doc2.refresh.checked) ? "    <META HTTP-EQUIV=\"REFRESH\" CONTENT=\"seconds\; URL=file.htm\">\n":"";
		meta+=(doc2.nocache.checked) ? "    <META HTTP-EQUIV=\"no-cache\">\n":""; 
		meta+=(doc2.expires.checked) ? "    <META HTTP-EQUIV=\"expires\" CONTENT=\""+now.toGMTString()+"\">\n":""; 
		meta+=(doc2.robots.checked) ? "    <META NAME=\"ROBOTS\" CONTENT=\""+robotC+"\">\n":""; 
		meta+=(doc2.keywords.checked) ? "    <META NAME=\"keywords\" CONTENT=\"\">\n":"";
		meta+=(doc2.descript.checked) ? "    <META NAME=\"description\" CONTENT=\"\">\n":"";
		meta+=(doc2.author.checked) ? "    <META NAME=\"author\" CONTENT=\"\">\n":"";
		meta+=(doc2.copyr.checked) ? "    <META NAME=\"copyright\" CONTENT=\"\">\n":"";
		meta+="    \n";
		meta+=(doc2.pics.checked) ? "    <META http-equiv=\"PICS-Label\" content='(PICS-1.1 \"http\://www.rsac.org/ratingsv01.html\""
			+" l gen true comment \"RSACi North America Server\" for \"http://www.CHANGETHIS.com/YOURPAGE.htm\""
			+" on \""+isoDateTime()+"\" r (n 0 s 0 v 0 l 0))'>\n":"";
		head=""
			+"";
		head+=(meta!="") ? meta:"";
		head+=""
			+""
			+"";
		doc.HTML.value+=head;
	}
}
function checkHeader() {
	if (document.ed.HTML.value.substring(0,14)!="<!DOCTYPE HTML") {
		document.ed.HTML.value="";
		template("header");
	}
}
/************************ UTILITIES *************************/
// Pastes 'text' into 'field', supports artificial cursor []
// Cursor inspired by Carl Adler's http://image-ination.com/HTMLit/
// I never figured out how his worked. Mine does a few more things:
function paste(text,formName,fieldName) {
	checkHeader();
	page=document[formName][fieldName].value;
	var a=0;
	var b=0;
	var x=0; 
	var y=0; 
	var z=0; 
	a = text.indexOf(">");
	b = text.lastIndexOf("<");
	x = page.indexOf("["); 
	y = page.indexOf("]"); 
	z = page.indexOf("</BODY>")-4;
	// Surround
	if (x != -1 && y!= -1 && x > y) {
		split1 = page.substring(0,y);
		split3 = page.substring(y+1,x);
		split5 = page.substring(x+1,page.length); 
		split2 = text.substring(0,a+1);
		split4 = text.substring(b,text.length);
		// Comment tag handler
		if (text.substring(0,4)=="<!--") {
			split2 = text.substring(0,b+5);
			split4 = text.substring(a-3,text.length);
		}
		else {
			split2 = text.substring(0,a+1);
			split4 = text.substring(b,text.length);
		}
		// Disallow surround with single tags
		if (text.substring(0,1)==" ") {
			alert("You can't surround with that tag!");
			document[formName][fieldName].value=split1+split3+split5;
			text="";
			document.core.id.value="";
		}
		else {
			document[formName][fieldName].value=split1+split2+split3+split4+split5;
			text="";
			document.core.id.value="";
		}
	}
	else {
		// Disallow cerebral 404; ] cursor
		if (x== -1 && y!= -1) {
			alert("I'm afraid I can't do that!");
			split1 = page.substring(0,y);
			split2 = page.substring(y+1,page.length); 
			document[formName][fieldName].value=split1 + split2;
			text="";
			document.core.id.value="";
		}
		else {
			// Insert
			if (x != -1 && y== -1) {
				split1 = page.substring(0,x);
				split2 = page.substring(x+1,page.length); 
			}
			// Replace
			if (x != -1 && y!= -1 && x < y) {
				split1 = page.substring(0,x);
				split2 = page.substring(y+1,page.length); 
			}
			// No cursor?  Paste before </BODY>
			if (x== -1 && y== -1) {
				split1 = page.substring(0,z);
				split2 = page.substring(z,page.length); 
			}
			document[formName][fieldName].value=split1+text+split2;
			text="";
			document.core.id.value="";
		}
	}
}	
function pasteAttrib(text,formName,fieldName) {
	checkHeader();
	page=document[formName][fieldName].value;
	var a=0;
	var b=0;
	var x=0; 
	var y=0; 
	var z=0; 
	a = text.indexOf(">");
	b = text.lastIndexOf("<");
	x = page.indexOf("["); 
	y = page.indexOf("]"); 
	z = page.indexOf("</BODY>")-4;
	// Surround
	if (x != -1 && y!= -1 && x > y) {
		split1 = page.substring(0,y);
		split3 = page.substring(y+1,x);
		split5 = page.substring(x+1,page.length); 
		// Disallow surround with single tags
		if (text.substring(0,1)==" ") {
			alert("You can't surround with that!");
			document[formName][fieldName].value=split1+split3+split5;
		}
	} 
	else {
		// Disallow cerebral 404; ] cursor
		if (x== -1 && y!= -1) {
			alert("I'm afraid I can't do that!");
			split1 = page.substring(0,y);
			split2 = page.substring(y+1,page.length); 
			document[formName][fieldName].value=split1 + split2;
		}
		else { 
			// Force attributes just inside a tag; <TAG ATTRIB="">			
			if (x==-1 && y==-1) {
				split1 = page.substring(0,z);
				split2 = page.substring(z+1,page.length); 
			}
			else {
				if (x!=-1 && y==-1) {
					split1 = page.substring(0,x);
					split2 = page.substring(x+1,page.length); 
				}
				else {
					if (x != -1 && y!= -1 && x < y) {
						split1 = page.substring(0,x);
						split2 = page.substring(y+1,page.length); 
					}
				}
			}
			if (text.substring(0,1)==" " && text.substring(0,2)!=" \n" && page.substring(x+1,x+2)!=">") {
				alert("I'm afraid I can't do that!\nTry placing a single 'cursor'\njust inside an opening tag.\nLike this:\n\n\<TAG [\>\</TAG\>");
				document[formName][fieldName].value=split1 + split2;
			}
			else {
				if (text.substring(0,1)==" " && text.substring(0,2)!=" \n" && page.substring(x+1,x+2)==">") {
					document[formName][fieldName].value=split1 + text + split2;
				}
			}
		}
	}
}	
function coreAttrib() {
	var doc2=document.core;
	var id=doc2.id.value;
	var classname=doc2.classname.value;
	var style=doc2.style.value;
	var title=doc2.title.value;
	var coreID=(id!="") ? " ID=\""+id+"\"":""; 
	var coreClass=(classname!="") ? " CLASS=\""+classname+"\"":""; 
	var coreStyle=(style!="") ? " STYLE=\""+style+"\"":""; 
	var coreTitle=(title!="") ? " TITLE=\""+title+"\"":""; 
	return coreClass+coreID+coreStyle+coreTitle;;
}
function insertCore(formName,fieldName) {
	coreText=coreAttrib();
	pasteAttrib(coreText,formName,fieldName);
	document.core.id.value="";
}
function startOver(formName,fieldName) {
	document[formName][fieldName].value="";
}
function clearFind() {
	document.ed.findStr.value='Erase/Replace:';
        document.ed.replStr.value='Replace with:';
	document.ed.replButton.value='Replace All';
}
function clearScreen() {
        document.ed.html.value='';
}
function setState(form,checkbox) {
	document[form][checkbox].value=(document[form][checkbox].value!="on") ? "on":"off";
}
function helpWin(url) {
	if (window.hWin&&window.hWin.closed==false) {
		hWin.document.location.href=url;
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.hWin.focus();
		}
	}
	else {
		hWin=window.open(url,"help","menubar=no,status=yes,scrollbars=yes,width=518,height=290");
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			hWin.focus();
		}
	}
}
function testWin() {
	var doc=parent.document.ed.HTML.value;
	if (window.tWin&&window.tWin.closed==false) {
		tWin.document.open();
		if (doc=="") {
			tWin.document.write("<HTML><H1>Nothing to preview!</H1></HTML>");
		}
		else {
			tWin.document.write(doc);
		}
		tWin.document.close();
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.tWin.focus();
		}
	}
	else {
		tWin=window.open("","testpage","menubar=yes,statusbar=yes,scrollbars=yes,width=618,height=280");
		tWin.document.open();
		if (doc=="") {
			tWin.document.write("<HTML><H1>Nothing to preview!</H1></HTML>");
		}
		else {
			tWin.document.write(doc);
		}
		tWin.document.close();
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			tWin.focus();
		}
	}
}
function validWin() {
//    NAME="level"
//    VALUE="Wilbur" = W3C 3.2
//    VALUE="2" = IETF 2.0
//    VALUE="3" = IETF 3.0
//    VALUE="AdvaSoft" = AdvaSoft
//    VALUE="IE3.0" = IE 3.0
//    VALUE="Mozilla" = Mozilla
//    VALUE="SQ" = SoftQuad
//    VALUE="XML" = XML
//    VALUE="4frameset" = W3C 4.0 Frameset (Draft)
//    VALUE="4strict" = W3C 4.0 Strict (Draft)
//    VALUE="4transitional" = W3C 4.0 Transitional (Draft)
	if (window.vWin&&window.vWin.closed==false) {
		var doc=parent.document.ed.HTML;
		vWin.document.open();
		vWin.document.write("<HTML><FORM NAME=\"qc\" ACTION=\"http\://valsvc.webtechs.com/valsvc\-bin/html\-check.pl\" METHOD=\"POST\">"

		+"<INPUT TYPE=\"HIDDEN\" NAME=\"input\" VALUE=\"1\">" // Display the lines of my HTML document
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"ampersand\" VALUE=\"1\">" // Treat URL ampersands
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"weblint\" VALUE=\"1\">" // Run my HTML document through http://www.cre.canon.co.uk/~neilb/weblint/
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"render\" VALUE=\"1\">" // Render my HTML document as a browser would
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"esis\" VALUE=\"1\">" // Display the parser output
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"weight\" VALUE=\"1\">" // Calculate my document's weight
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"rmscript\" VALUE=\"1\">" // Remove script code from my document
		
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"level\" VALUE=\"4transitional\">"
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"HTML\" VALUE=\"\"></FORM></HTML>");
		vWin.document.qc.HTML.value=doc.value;
		vWin.document.close();
		vWin.document.qc.submit();
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.vWin.focus();
		}
	}
	else {
		vWin=window.open("","validate","menubar=yes,status=yes,scrollbars=yes,width=600,height=370");
		var doc=parent.document.ed.HTML;
		vWin.document.open();
		vWin.document.write("<HTML><FORM NAME=\"qc\" ACTION=\"http\://valsvc.webtechs.com/valsvc\-bin/html\-check.pl\" METHOD=\"POST\">"

		+"<INPUT TYPE=\"HIDDEN\" NAME=\"input\" VALUE=\"1\">" // Display the lines of my HTML document
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"ampersand\" VALUE=\"1\">" // Treat URL ampersands
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"weblint\" VALUE=\"1\">" // Run my HTML document through http://www.cre.canon.co.uk/~neilb/weblint/
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"render\" VALUE=\"1\">" // Render my HTML document as a browser would
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"esis\" VALUE=\"1\">" // Display the parser output
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"weight\" VALUE=\"1\">" // Calculate my document's weight
//		+"<INPUT TYPE=\"HIDDEN\" NAME=\"rmscript\" VALUE=\"1\">" // Remove script code from my document
		
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"level\" VALUE=\"4transitional\">"
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"HTML\" VALUE=\"\"></FORM></HTML>");
		vWin.document.qc.HTML.value=doc.value;
		vWin.document.close();
		vWin.document.qc.submit();
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			vWin.focus();
		}
	}
}
function formWin() {
	if (window.fWin&&window.fWin.closed==false) {
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.fWin.focus();
		}
	}
	else {
		fWin=window.open("FormMaker.html","formMaker","menubar=no,status=yes,scrollbars=no,width=628,height=340");
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			fWin.focus();
		}
	}
}
function styleWin() {
	if (window.sWin&&window.sWin.closed==false) {
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			sWin.viewer.focus();
		}
	}
	else {
		sWin=window.open("CSSEdit2.html","cssEdit","menubar=no,status=yes,scrollbars=yes,width=618,height=400");
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			sWin.focus();
		}
	}
}
function cssHelp() {
	if (window.cssHelper&&window.cssHelper.closed==false) {
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.cssHelper.focus();
		}
	}
	else {
		cssHelper=window.open("help/css.html","helper","scrollbars=yes,width=608,height=290");
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			cssHelper.focus();
		}
	}
}
function linkWin() {
	if (window.lWin&&window.lWin.closed==false) {
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.lWin.focus();
		}
	}
	else {
		lWin=window.open("link.html","linker","menubar=no,status=no,scrollbars=no,width=400,height=180");
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			lWin.focus();
		}
	}
}
function preview(url,name,menu,stat,wide,high) {
	if (window.viewer&&window.viewer.closed==false) {
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			window.viewer.focus();
		}
	}
	else {
		viewer=window.open(url,name,"menubar="+menu+",status="+stat+",scrollbars=yes,width="+wide+",height="+high);
		if (navigator.userAgent.indexOf("MSIE 3")==-1) {
			viewer.focus();
		}
	}
	if (name=="testpage") {
		var doc=parent.document.ed.HTML.value;
			viewer.document.open();
		if (doc=="") {
			viewer.document.write("<HTML><H1>Nothing to preview!</H1></HTML>");
		}
		else {
			viewer.document.write(doc);
		}
		viewer.document.close();
		viewer.focus();
	}
	else if (name=="validate") {
		var doc=parent.document.ed.HTML;
		viewer.document.open();
		viewer.document.write("<HTML><FORM NAME=\"qc\" ACTION=\"http\://valsvc.webtechs.com/valsvc\-bin/html\-check.pl\">"
		+"<INPUT TYPE=\"HIDDEN\" NAME=\"HTML\" VALUE=\"\"></FORM></HTML>");
		viewer.document.qc.HTML.value=doc.value;
		viewer.document.close();
		viewer.document.qc.submit();
	}
}
function increment(form,button) {
	value=document[form][button].value;
	if (value.substring(0,1)==" ") {
		n=1;
	}
	else {
		// 2-10
		if (value.substring(1,2)==" ") {
			n=parseInt(value.substring(0,1))+1;
		}
		// 11-100
		if (value.substring(2,3)==" ") {
			n=parseInt(value.substring(0,2))+1;
		}   
		// 101-999
		if (value.substring(3,4)==" ") {
			n=parseInt(value.substring(0,3))+1;
		}   
	}
	document[form][button].value=n+" "+button;
}

/************************ HTML MARKUP *************************/
// Three custom insert functions
function acroAbbr(tag,formName,fieldName) {
	var text="";
	var attrib=coreAttrib();
	acro=prompt("Enter the abbreviated form. Cancel to skip","");
	full=prompt("Enter the full text of the abbreviation. \(required\)","");
	cite=prompt("Enter the URL where the full text explanation is found. Cancel to skip","");
	if (full!=null) {
		text=(tag=="ABBR") ? "<ABBR":"<ACRONYM";
		if (full!=null&&cite!=null) {
			attrib=" TITLE=\"" + full + "\" CITE=\"" + cite + "\"" + attrib;
			text+=attrib;
		}
		else { 
			attrib=(full!=null) ? " TITLE=\"" + full + "\"" + attrib:attrib;
			attrib=(cite!=null) ? " CITE=\"" + cite + "\"" + attrib:attrib;
			text+=attrib;
		}
		text+=">";
		text+=(acro!=null) ? acro:"";
		text+=(tag=="ABBR") ? "</ABBR>":"</ACRONYM>";
		paste(text,formName,fieldName);
	}
}
function insDel(tag,formName,fieldName) {
	checkHeader();
	var text="";
	var attrib=coreAttrib();
	cite=prompt("Enter the URL where info on this change is found. \(Cancel to skip\)","");
	datetime=isoDateTime();
	text+="<" + tag;
	text+=(cite!=null&&cite!="") ? " CITE=\"" + cite + "\"":"";
	text+=(cite!=null&&cite=="") ? " CITE=\"\"":"";
	text+=(datetime!="") ? " DATETIME=\"" + datetime + "\"":"";
	text+=(attrib!="") ? attrib:"";
	text+="></" + tag + ">";
	paste(text,formName,fieldName);
}
function insBaseLink(text,formName,fieldName) {
	checkHeader();
	var page=document[formName][fieldName].value;
	var x=page.indexOf('<TITLE>');
	if (x==-1) {
		x=page.indexOf("<HEAD>")+6; 
		tagStrt="    ";
		tagEnd="";
	}
	else {
		tagStrt="";
		tagEnd="\n    ";
	}
	var split1=page.substring(0,x);
	var split2=page.substring(x,page.length); 
	page=split1+tagStrt+text+tagEnd+split2;
	document[formName][fieldName].value=page;
}
// Generic HTML tag generators
function html1(tag,formName,fieldName) {
	var text="";
	checkHeader();
	var attrib=coreAttrib();
	text=(attrib!="") ? "<"+tag+attrib+">":"<"+tag+">";
	text=(tag=="P"||tag=="BR"||tag=="HR") ? " \n  " + text + " \n    ":text;
	paste(text,formName,fieldName);
}
function html2(tag,formName,fieldName) {
	var text="";
	var tStart=tag.substring(0,1);
	checkHeader();
	var attrib=coreAttrib();
	text=(attrib!="") ? "<"+tag+attrib+"></"+tag+">":"<"+tag+"></"+tag+">";
	text=(tStart=="H"||tStart=="A"||tag=="DIV"||tag=="BLOCKQUOTE"||tag=="PRE") ? "\n  " + text + "\n    ":text;
	paste(text,formName,fieldName);
}
function html(box,formName,fieldName) {
	var sMkup=document.ed.structMkup.options[document.ed.structMkup.selectedIndex].value;
	var vMkup=document.ed.visualMkup.options[document.ed.visualMkup.selectedIndex].value;
	tag=(box=="structMkup") ? sMkup:vMkup;
	checkHeader();
	if (tag=="ADDRESS"||tag=="CODE"||tag=="CITE"||tag=="DFN"||tag=="EM"||tag=="KBD"||
		tag=="SAMP"||tag=="STRONG"||tag=="SUB"||tag=="SUP"||tag=="VAR"||tag=="B"||tag=="BIG"||
		tag=="I"||tag=="PRE"||tag=="SMALL"||tag=="TT") {
		html2(tag,formName,fieldName);
	}
	if (tag=="ABBR"||tag=="ACRONYM") {
		acroAbbr(tag,formName,fieldName);
	}
	if (tag=="INS"||tag=="DEL") {
		insDel(tag,formName,fieldName);
	}
}
function anchor(formName,fieldName) {
	checkHeader();
	var text="";
	url=prompt("Enter the URL. Cancel for email link or named anchor.","");
	if (url!=null) {
		desc=prompt("Enter the text users will see.","");
		text=(desc!=null) ? "<A HREF=\"" + url + "\">" + desc + "</A>":
			"<A HREF=\"" + url + "\"></A>";
		paste(text,formName,fieldName);
	}
	else {
		if (confirm("Is this an e-mail hyperlink?\n(Cancel to create a named anchor)")) {
			url=prompt("Enter the email address ONLY.","name@domain.com");
			if (url!=null && url!="") {
				a=url.indexOf("@");
				b=url.indexOf(".");
				while (url!=null&&a==-1&&b==-1) {
					alert("You have entered an invalid email address!");
					url2=prompt("Enter the email address ONLY.","name@domain.com");
					a=url2.indexOf("@");
					b=url2.indexOf(".");
					url=url2;
				}
				text="<A HREF=\"mailto:" + url + "\">"+url+"</A>";
				paste(text,formName,fieldName);
			}
		}
		else {
			url=prompt("In-document anchor?  Enter the name.","");
			if (url!=null) {
				text="<A NAME=\"" + url + "\"></A>";
				paste(text,formName,fieldName);
			}
		}
	}
}
function base(formName,fieldName) {
	var text="";
	bUrl=prompt("Enter the base URL. \(required\)","");
	text=(bUrl!=null) ? "<BASE HREF=\"" + bUrl + "\">":"";
	if (text!="") {
		insBaseLink(text,formName,fieldName);
	}
}
function bdo(formName,fieldName) {
	var text="";
	var dir="";
	checkHeader();
	dir=prompt("Enter the text direction [RTL or LTR]. \(required\)","");
	text=(dir!=null) ? "<BDO LANG=\"\" DIR=\"" + dir + "\"></BDO>":"";
	if (text!="") {
		a=dir.indexOf("RTL");
		b=dir.indexOf("LTR");
		c=dir.indexOf("rtl");
		d=dir.indexOf("ltr");
		while (text!=""&&a==-1&&b==-1&&c==-1&&d==-1) {
			alert("You have entered an \ninvalid text direction!");
			direct=prompt("Enter the text direction [RTL or LTR]. \(required\)","");
			a=direct.indexOf("RTL");
			b=direct.indexOf("LTR");
			c=direct.indexOf("rtl");
			d=direct.indexOf("ltr");
			dir=direct;
			text=(dir!=null) ? "<BDO LANG=\"\" DIR=\"" + dir + "\"></BDO>":"";
		}
		paste(text,formName,fieldName);
		alert("The two-letter language codes\ncan be found in the BDO help file.");
	}
}
function comment(formName,fieldName) {
	checkHeader();
	var text="";
	text="<!--  -->";
	paste(text,formName,fieldName);
}
function character(code,formName,fieldName) {
	checkHeader();
	var text="";
	text="\&" + code + "\;";
	paste(text,formName,fieldName);
}
function img(formName,fieldName) {
	checkHeader();
	var attrib=coreAttrib();
	url=prompt("Enter the URL of the image.","");
	desc=prompt("Enter the alternate text users will see.","");
	if (url!=null) {
		text=(desc!=null) ? "<IMG SRC=\"" + url + "\" ALT=\"" + desc + "\"":
			"<IMG SRC=\"" + url + "\"";
		text+=(attrib!="") ? attrib + ">":">";
		paste(text,formName,fieldName);
	}
}
function object(formName,fieldName) {
	checkHeader();
	var attrib=coreAttrib();
	var doc=document.obj;
	var data=doc.data.value;
	var dType=doc.dType.options[doc.dType.selectedIndex].value;
	var standby=doc.standby.value;
	var classid=doc.classid.value;
	var codebase=doc.codebase.value;
	var cType=doc.cType.options[doc.cType.selectedIndex].value;
	var oHeight=doc.oHeight.value;
	var oWidth=doc.oWidth.value;
	var text="";
	if (data==""&&dType==""&&standby==""&&classid==""&&
		codebase==""&&cType==""&&oHeight==""&&oWidth=="") {
		text="";
	}
	else {
		text="<OBJECT";
		text+=(classid!="") ? " CLASSID=\"" + classid + "\"":"";
		text+=(codebase!="") ? " CODEBASE=\"" + codebase + "\"":"";
		text+=(cType!="") ? " CLASSTYPE=\"" + cType + "\"":"";
		text+=(data!="") ? " DATA=\""+data+"\"":"";
		text+=(dType!="") ? " DATATYPE=\"" + dType + "\"":"";
		text+=(standby!="") ? " STANDBY=\"" + standby + "\"":"";
		text+=(oHeight!="") ? " HEIGHT=\"" + oHeight + "\"":"";
		text+=(oWidth!="") ? " WIDTH=\"" + oWidth + "\"":"";
		text+=(attrib!="") ? attrib:"";
		text+="></OBJECT> ";
	}
	paste(text,formName,fieldName);
}
function param(formName,fieldName) {
	var text="";
	var attrib=coreAttrib();
	var page=document[formName][fieldName].value
	var oO = page.indexOf("<OBJECT");
	var oC = page.indexOf("</OBJECT>");
	var ins = page.indexOf("[");
	var rep = page.indexOf("]");
	// id, name, value, valuetype, type        
	if (oC == -1) {
		alert("A parameter can only be used\nwithin an OBJECT tag.");
	}
	else {
		if (ins == -1) {
			alert("I can't tell where you want this.\nPlease use the insert cursor [ .\nBe sure to place between OBJECT tags.");
		}
		else {
			var pName=prompt("Enter the parameter name. \(required\)","");
			var pValue=prompt("Enter the parameter value. \(required\)","");
			if (pName!=null&&pValue!=null) {
				attrib=coreAttrib();
				text=" \n    <PARAM";
				attrib=" NAME=\""+pName+"\" VALUE=\""+pValue+"\"" + attrib;
				text+=attrib + ">";
				if ((ins != -1 || rep != -1) && oC != -1) {
					if (!(oO > ins || oC < ins)) {
					}
					else {
						if (oC != -1 && (oO > ins || oC < ins)) {
							if (confirm("Are you sure that's where you want to put it?")) {
							}
							else {
								text="";
							}
						}
					}
				}
				paste(text,formName,fieldName);
			}
		}
	}
}
function include(formName,fieldName) {
	var ssi=document.ed.ssi.options[document.ed.ssi.selectedIndex].value;
	var path=document.ed.ssipath.value;
	var text=" [an error occurred while processing this directive] ";
	paste(text,formName,fieldName);
}
/******************** LIST GENERATORS *********************/
function uList(formName,fieldName) {
	checkHeader();
	var text="";
	Li=prompt("Enter your first list item.","");
	if (Li!=null && Li!="") {
		text=" \n   <UL>\n     <LI>" + Li + "\n";
		paste(text,formName,fieldName);
		while (Li!=null && Li!="") {
			Li=prompt("Enter another list item. No entry or Cancel ends the list.","");
			text=(Li!=null && Li!="") ? "     <LI>" + Li + "\n":
				"   </UL>\n";
			paste(text,formName,fieldName);
		}
	}
}
function oList(formName,fieldName) {
	checkHeader();
	var text="";
	Li=prompt("Enter your first list item.","");
	if (Li!=null && Li!="") {
		text=" \n   <OL>\n     <LI>" + Li + "\n";
		paste(text,formName,fieldName);
		while (Li!=null && Li!="") {
			Li=prompt("Enter another list item. No entry or Cancel ends the list.","");
			text=(Li!=null && Li!="") ? "     <LI>" + Li + "\n":
				"   </OL>\n";
			paste(text,formName,fieldName);
		}
	}
}
function dList(formName,fieldName) {
	checkHeader();
	var text="";
	Dt=prompt("Enter a definition term. No entry/Cancel exits.","");
	if (Dt!=null && Dt!="") {
		text=" \n   <DL>\n     <DT>" + Dt + "\n";
		paste(text,formName,fieldName);
		Dd=prompt("Enter the definition for this term. No entry/Cancel exits.","");
		text=(Dd!=null && Dd!="") ?
			"       <DD>" + Dd + "\n":"   </DL>\n";
		paste(text,formName,fieldName);	
		while (Dt!=null && Dt!="") {
			Dt=prompt("Enter a definition term. No entry/Cancel exits.","");
			if (Dt!=null && Dt!="") {
				text="     <DT>" + Dt + "\n";
				paste(text,formName,fieldName);
				Dd=prompt("Enter the definition for this term. No entry/Cancel exits.","");
				text=(Dd!=null && Dd!="") ?
					"       <DD>" + Dd + "\n":"   </DL>\n";
				paste(text,formName,fieldName);
			}
			else {
				text="   </DL>\n";
				paste(text,formName,fieldName);
			}
		}
	}
}
/*********************** TABLE WIZARD ************************/
var newtable="";
function clearwizard() {
	var doc=document.tableWiz;
	var i=6;
	for (i=6;i<20;i++)
	doc.elements[i].value="";
	doc.columns.value=" Columns";
	doc.rows.value=" Rows";
	newtable="";
setTimeout("moretexta()",100);
 }
function moretexta()
{
  document.tableWiz.storage.value="Remember: Press Reset TWICE to reset tool";
  setTimeout("moretextb()",5000);
}
function moretextb()
{
  document.tableWiz.storage.value="Select any Options- Then press \'Columns\'";
} 

function makecolumn(button) {
	doc=document.tableWiz;
	if (newtable.substring(6,10)=="<TR>") {
		alert("Sorry! \nYou must select the total \nnumber of columns first!"
		+" \nYou cannot go back and forth.\nPlease restart!");
		startOver("tableWiz","storage");
	}
	else {
		cellwd=(doc.cellwd.checked) ? " WIDTH=\"\"":"";
		cellht=(doc.cellht.checked) ? " HEIGHT=\"\"":"";
		bgclr=(doc.cellrgb.checked) ? " BGCOLOR=\"\"":"";
		rspan=(doc.rowspan.checked) ? " ROWSPAN=\"\"":"";
		cspan=(doc.colspan.checked) ? " COLSPAN=\"\"":"";
		txtalign=(doc.align.checked) ? " ALIGN=\"\"":"";
		txtvalign=(doc.valign.checked) ? " VALIGN=\"\"":"";
		style=(doc.classname.checked) ? " CLASS=\"table\"":"";
		newtable+="        <TD"+bgclr+rspan+cspan+txtalign+txtvalign+cellwd+cellht+style+"></TD>\n";
		message=setTimeout("doc.storage.value='Column created: press again or press Rows'",100);
		increment("tableWiz","columns");
	}
}
function makerow(button) {
	doc=document.tableWiz;
	if (newtable=="") {
		alert("You must select the total number of columns first!");
		clear=setTimeout("clearwizard()",1);
	}
	else {
		if (newtable.substring(8,11)=="<TD") {
			message=setTimeout("doc.storage.value='Row created: press again or Create Table'",100);
			newtable="      <TR>\n" + newtable + "      </TR>\n";
			tableblock=newtable;
		}
		else {
			newtable+=tableblock;
		}
		increment("tableWiz","rows");
	}
}
function createTable(field) {
	doc=document.tableWiz;
	checkHeader(field);
	if (newtable=="") {
		alert("You must select the total number of columns first!");
	}
	else {
		if (newtable.substring(8,12)=="<TD>") {
			alert("You must select a number of rows first!");
		}
		else {
			var caption=(doc.caption.checked) ? "      <CAPTION></CAPTION>":"";
			bd=(doc.border.value!="") ? " BORDER=\"" + doc.border.value + "\"":"";
			wd=(doc.tablew.value!="") ? " WIDTH=\"" + doc.tablew.value + "\"":"";
			ht=(doc.tableh.value!="") ? " HEIGHT=\"" + doc.tableh.value + "\"":"";
			cp=(doc.cellpad.value!="") ? " CELLPADDING=\"" + doc.cellpad.value + "\"":"";
			cs=(doc.cellspace.value!="") ? " CELLSPACING=\"" + doc.cellspace.value + "\"":"";
			bg=(doc.tablergb.value!="") ? " BGCOLOR=\"" + doc.tablergb.value + "\"":"";
			table="    <TABLE"+bd+cp+cs+wd+ht+bg+">\n"+caption+newtable+"    </TABLE>\n";
			paste(table,"ed","HTML")
			doc.storage.value="Customize Your Table, Then PREVIEW";
			clear=setTimeout("doc.storage.value='Scroll Down for more features';",5000);

		}
	}
}
// -->