

function changeColor(){
	openNewWindow(320,360,"/colors-emotes.aspx?m=S","Colors",0,0,1,0,0)
}

function addEmoteChoice(){
	openNewWindow(320,360,"/colors-emotes.aspx?m=E","Colors",0,0,1,0,0)
}

function addBold() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter the text that you would like to Bold","Text")
	if (mStr){
		fObj.value = fObj.value + "[B]" + mStr + "[/B]"
	}
	fObj.focus()
}

function addItalic() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter the text that you would like to Italic","Text")
	if (mStr){
		fObj.value = fObj.value + "[I]" + mStr + "[/I]"
	alert(fObj.value)
	}
	fObj.focus()
}

function addUnderline() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter the text that you would like to Underline","Text")
	if (mStr){
		fObj.value = fObj.value + "[U]" + mStr + "[/U]"
	}
	fObj.focus()
}

function addColor() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter the text that you would like to be Colored","Text")
	if (mStr){
		fObj.value = fObj.value + "[C=" + $get("tColor").style.backgroundColor + "]" + mStr + "[/C#]"
	}
	fObj.focus()
}

function addHref() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter a URL for the Link","http://")
	if (mStr){
		sStr = prompt("Enter the text to display for the Link","Text")
		if (sStr){
			fObj.value = fObj.value + "[L=" + mStr + "]" + sStr + "[/L]"
		}
	}
	fObj.focus()
}

function addEmail() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter an e-mail address","nobody@nowhere.com")
	if (mStr){
		sStr = prompt("Enter the text to display for the e-mail address","Text")
		if (sStr){
			fObj.value = fObj.value + "[E=" + mStr + "]" + sStr + "[/E]"
		}
	}
	fObj.focus()
}

function addUrlImage() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter a URL for an Image Link","http://")
	if (mStr){
		var mWidth = prompt("Enter the percentage size to display the image. (do NOT include %)","100")
		var mAlign = prompt("Enter the alignment of the image - LEFT or RIGHT","LEFT")
		dimStr = ""
		if ((mStr != "http://")&&(mStr != "")){
			if ((mWidth != "0")&&(mWidth != null)){
				dimStr = " WIDTH=" + mWidth + "%" // + " HEIGHT=" + mWidth + "%"
			}
			else{
				dimStr = ""
			}
			if ((mAlign != "0")&&(mAlign != "null")){
				if (dimStr != ""){
					dimStr = dimStr + " ALIGN=" + mAlign
				}
				else{
					dimStr = " ALIGN=" + mAlign
				}
			}
			else{
				if (dimStr != ""){
					dimStr = dimStr + ""
				}
				else{
					dimStr = ""
				}
			}
			fObj.value = fObj.value + "[IMG" + dimStr + "]" + mStr + "[/IMG]"
		}
	}
	fObj.focus()
}

function addHilight() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter the text that you would like to Hi-light","Text")
	if (mStr){
		fObj.value = fObj.value + "[H]" + mStr + "[/H]"
	}
	fObj.focus()
}

function addQuote() {
    var fObj = $get("rMsg")
	var mStr = prompt("Enter the text that you would like to Quote","Text")
	if (mStr){
		fObj.value = fObj.value + "[Q]" + mStr + "[/Q]"
	}
	fObj.focus()
}

function addLine() {
    var fObj = $get("rMsg")
	fObj.value = fObj.value + "[HR]" //"\n[HR]\n"
	fObj.focus()
}

function addList() {
    var fObj = $get("rMsg")
	var refId = 1
	var tStr = ""
	
	while (refId !=2){
		var mStr = prompt("Enter the text that you would like to show as a List Item","Text")
		if (mStr){
			tStr = tStr + "[LI]" + mStr + "[/LI]"
		}
		else{
			refId = 2
		}
	}
	
	fObj.value = fObj.value + "[BULLET]" + tStr + "[/BULLET]"
	fObj.focus()
}

function addNoList() {
    var fObj = $get("rMsg")
	var refId = 1
	var tStr = ""
	
	while (refId !=2){
		var mStr = prompt("Enter the text that you would like to show as a List Item","Text")
		if (mStr){
			tStr = tStr + "[LI]" + mStr + "[/LI]"
		}
		else{
			refId = 2
		}
	}
	
	if (tStr != ""){
		fObj.value = fObj.value + "[NUM]" + tStr + "[/NUM]"
		fObj.focus()
	}
}

function addEmote(refNo) {
    var fObj = $get("rMsg")
	fObj.value = fObj.value + "[EM=" + refNo + "]"
}

function addLkImage() {
    var fObj = $get("rMsg")
	var tStr = ""
	var mStr = confirm("If the Image you want to link is an existing image on a website click OK?")
	if (mStr == false){
		mStr = confirm("Have you uploaded the Image you wish to use to the website?")
		if (mStr == true){
			var mStr = prompt("Enter the name of the image","Text")
			if (mStr){
				tStr = mStr + "[/LIMG]"
			}
			if (tStr != ""){
				var mStr = prompt("Enter the URL you wish the image to Link to","http://")
				if (mStr){
					var mWidth = prompt("Enter the percentage size to display the image. (do NOT include %)","100")
					var mAlign = prompt("Enter the alignment of the image - LEFT or RIGHT","LEFT")
					dimStr = ""
					if (mStr != ""){
						if ((mWidth != "0")&&(mWidth != null)){
							dimStr = " WIDTH=" + mWidth + "%" //+ " HEIGHT=" + mWidth + "%"
						}
						else{
							dimStr = ""
						}
						if ((mAlign != "0")&&(mAlign != "null")){
							if (dimStr != ""){
								dimStr = dimStr + " ALIGN=" + mAlign
							}
							else{
								dimStr = " ALIGN=" + mAlign
							}
						}
						else{
							if (dimStr != ""){
								dimStr = dimStr + ""
							}
							else{
								dimStr = ""
							}
						}
						tStr = "[LIMG=" + mStr + dimStr + "]" + tStr
					}
				}
				else{
					tStr = ""
				}
			}
		}
		else{
			alert("Please use the Upload button to upload the image to the website.")
		}
	}
	else{
		if (mStr == true){
			var mStr = prompt("Enter the URL of the existing image","Text")
			if (mStr){
				tStr = mStr + "[/XIMG]"
			}
			if (tStr != ""){
				var mStr = prompt("Enter the URL you wish the image to Link to","http://")
				if (mStr){
					var mWidth = prompt("Enter the percentage size to display the image. (do NOT include %)","100")
					var mAlign = prompt("Enter the alignment of the image - LEFT or RIGHT","LEFT")
					dimStr = ""
					if (mStr != ""){
						if ((mWidth != "0")&&(mWidth != "null")){
							dimStr = " WIDTH=" + mWidth + "%" //+ " HEIGHT=" + mWidth + "%"
						}
						else{
							dimStr = " "
						}
						if ((mAlign != "0")&&(mAlign != "null")){
							if (dimStr != ""){
								dimStr = dimStr + " ALIGN=" + mAlign
							}
							else{
								dimStr = " ALIGN=" + mAlign
							}
						}
						else{
							if (dimStr != ""){
								dimStr = dimStr + " "
							}
							else{
								dimStr = " "
							}
						}
						tStr = "[XIMG=" + mStr + dimStr + "]" + tStr
					}
				}
				else{
					tStr = ""
				}
			}
		}
	}
	if (tStr != ""){
		fObj.value = fObj.value + tStr
		fObj.focus()
	}
}

