var errorColor = "#F9C8D8";

function addBold(NVForm) { theText = prompt('Please enter the BOLD text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[b]" + theText + "[/b] "; } opener.document.NVForm.mText.focus(); }
function addItal(NVForm) { theText = prompt('Please enter the ITALIC text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[i]" + theText + "[/i] "; } opener.document.NVForm.mText.focus(); }
function addUnder(NVForm) { theText = prompt('Please enter the UNDERLINED text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[u]" + theText + "[/u] "; } opener.document.NVForm.mText.focus(); }
function addStrike(NVForm) { theText = prompt('Please enter the STRIKED text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[strike]" + theText + "[/strike] "; } opener.document.NVForm.mText.focus(); }
function addHR(NVForm) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[hr]"; opener.document.NVForm.mText.focus(); }

function addFace(NVForm) { theFace = prompt('Please enter the new font FACE:',''); theText = prompt('Please enter the TEXT:',''); if((theFace != null) && (theFace != "")) { if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[face=" + theFace + "]" + theText + "[/face] "; } } opener.document.NVForm.mText.focus(); }
function addSize(NVForm) { theSize = prompt('Please enter the new font SIZE:',''); theText = prompt('Please enter the TEXT:',''); if((theSize != null) && (theSize != "")) { if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[size=" + theSize + "]" + theText + "[/size] "; } } opener.document.NVForm.mText.focus(); }
function addColor(NVForm) { theColor = prompt('Please enter the new font COLOR:',''); theText = prompt('Please enter the TEXT:',''); if((theColor != null) && (theColor != "")) { if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[color=" + theColor + "]" + theText + "[/color] "; } } opener.document.NVForm.mText.focus(); }

function addList(NVForm) { theList = "[list]\n"; theItem = "1"; while ((theItem != null) && (theItem != "")) { theItem = prompt('Enter a list item or hit "Cancel" to quit',''); if((theItem != "") && (theItem != null)) { theList = theList + "[-]" + theItem + "\n"; } } opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + theList + "[/list] "; opener.document.NVForm.mText.focus(); }
function addSub(NVForm) { theText = prompt('Please enter the SUBSCRIPT text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[sub]" + theText + "[/sub] "; } opener.document.NVForm.mText.focus(); }
function addSup(NVForm) { theText = prompt('Please enter the SUPERSCRIPT text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[sup]" + theText + "[/sup] "; } opener.document.NVForm.mText.focus(); }

function addLeft(NVForm) { theText = prompt('Please enter the text for LEFT ALIGNMENT:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[left]" + theText + "[/left] "; } opener.document.NVForm.mText.focus(); }
function addCenter(NVForm) { theText = prompt('Please enter the text for CENTER ALIGNMENT:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[center]" + theText + "[/center] "; } opener.document.NVForm.mText.focus(); }
function addRight(NVForm) { theText = prompt('Please enter the text for RIGHT ALIGNMENT:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[right]" + theText + "[/right] "; } opener.document.NVForm.mText.focus(); }

function addCode(NVForm) { theText = prompt('Please enter the CODE text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[code]" + theText + "[/code] "; } opener.document.NVForm.mText.focus(); }
function addQuote(NVForm) { theText = prompt('Please enter the QUOTE text:',''); if((theText != null) && (theText != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[quote]" + theText + "[/quote] "; } opener.document.NVForm.mText.focus(); }
function addImage(NVForm) { theURL = prompt('Please enter the URL for the image:','http://'); if((theURL != null) && (theURL != "") && (theURL != "http://")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[img=" + theURL + "] "; opener.document.NVForm.urlsClickable.checked=false; } opener.document.NVForm.mText.focus(); }

function addHTTPLink(NVForm) { theURL = prompt('Please enter the URL for the HTTP link:','http://'); theTitle = prompt('Please enter a TITLE for the HTTP link:',''); if((theURL != null) && (theURL != "") && (theURL != "http://")) { if((theTitle != null) && (theTitle != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[http=" + theURL + "]" + theTitle + "[/http] "; opener.document.NVForm.urlsClickable.checked=false; } } opener.document.NVForm.mText.focus(); }
function addFTPLink(NVForm) { theURL = prompt('Please enter the URL for the FTP link:','ftp://'); theTitle = prompt('Please enter a TITLE for the FTP link:',''); if((theURL != null) && (theURL != "") && (theURL != "http://")) { if((theTitle != null) && (theTitle != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[ftp=" + theURL + "]" + theTitle + "[/ftp] "; opener.document.NVForm.urlsClickable.checked=false; } } opener.document.NVForm.mText.focus(); }
function addEmail(NVForm) { theEmail = prompt('Please enter the EMAIL ADDRESS:','@'); theTitle = prompt('Please enter a TITLE for the email link:',''); if((theEmail != null) && (theEmail != "") && (theEmail != "@")) { if((theTitle != null) && (theTitle != "")) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + "[email=" + theEmail + "]" + theTitle + "[/email] "; } } opener.document.NVForm.mText.focus(); }

function validForm(NVForm) { document.NVForm.theSubmit.disabled = true; document.NVForm.theSubmit.value = "Processing..."; return true; }
function smilies(whichSmilie) { opener.document.NVForm.mText.value = opener.document.NVForm.mText.value + whichSmilie + " "; opener.document.NVForm.mText.focus(); }
function openTheWindow(theURL) { newWindow = window.open(theURL, 'newWin', 'toolbar=no,location=no,resizable=yes,scrollbars=yes,menubar=no,width=355,height=300'); }
function openMenuWindow(theURL) { newMenuWindow = window.open(theURL, 'newMenuWin', 'toolbar=no,location=no,resizable=yes,scrollbars=yes,menubar=no,width=355,height=300'); }

function validFormPost(NVForm) {
	if(document.cookie == "") { if(document.NVForm.handle.value == "") { alert("The Username field is required..."); document.NVForm.handle.style.background = errorColor; document.NVForm.handle.focus(); return false; } }
	if(document.NVForm.subject.value == "") { alert("The Subject field is required..."); document.NVForm.subject.style.background = errorColor; document.NVForm.subject.focus(); return false; }
	if(document.NVForm.mText.value == "") { alert("The Message field is required..."); document.NVForm.mText.style.background = errorColor; document.NVForm.mText.focus(); return false; }
	document.NVForm.theSubmit.disabled = true; document.NVForm.theSubmit.value = "Processing..."; return true;
}

function validFormPoll(NVForm) {
	if(document.cookie == "") { if(document.NVForm.handle.value == "") { alert("The Username field is required..."); document.NVForm.handle.style.background = errorColor; document.NVForm.handle.focus(); return false; } }
	if(document.NVForm.subject.value == "") { alert("The Subject field is required..."); document.NVForm.subject.style.background = errorColor; document.NVForm.subject.focus(); return false; }
	if(document.NVForm.mText.value == "") { alert("The Message field is required..."); document.NVForm.mText.style.background = errorColor; document.NVForm.mText.focus(); return false; }
	if(document.NVForm.description.value == "") { alert("The Poll Question field is required..."); document.NVForm.description.style.background = errorColor; document.NVForm.description.focus(); return false; }
	if(document.NVForm.Vote1.value == "") { alert("The Vote 1 field is required..."); document.NVForm.Vote1.style.background = errorColor; document.NVForm.Vote1.focus(); return false; }
	if(document.NVForm.Vote2.value == "") { alert("The Vote 2 field is required..."); document.NVForm.Vote2.style.background = errorColor; document.NVForm.Vote2.focus(); return false; }
	document.NVForm.theSubmit.disabled = true; document.NVForm.theSubmit.value = "Processing..."; return true;
}

function toggleMenu(inObject,inImage) {
	var plusImage = new Image; plusImage.src = "/public/menu-plus.gif";
	var minusImage = new Image; minusImage.src = "/public/menu-minus.gif";
	if(document[inImage].src == plusImage.src) { document[inImage].src = minusImage.src; }
	else { document[inImage].src = plusImage.src; }
	var togObject = document.getElementById(inObject);
	if(togObject.style.display == 'block') { togObject.style.display = 'none'; }
	else { togObject.style.display = 'block'; }
}

function checkLogin(NVForm) {
	document.NVForm.theSubmit.disabled = true;
	document.NVForm.theSubmit.value = "Chat Launched...";
	urlAppend = "room=" + document.NVForm.room.value;
	if(document.cookie == "") {
		if(document.NVForm.chatHandle.value == "") { alert("The Username field is required..."); document.NVForm.chatHandle.style.background = errorColor; document.NVForm.chatHandle.focus(); return false; }
		else { theURL = "chat.cgi?logIn=1&chatHandle=" + escape(document.NVForm.chatHandle.value) + "&" + urlAppend; }
	}
	else { theURL = "chat.cgi?logIn=1" + "&" + urlAppend; }
	chatWindow = window.open(theURL, 'chatWin', 'toolbar=no,location=no,resizable=yes,scrollbars=yes,menubar=no,top=10,left=50,width=600,height=550');
}