function toggle_postFormDisplay(divID, buttonDiv, formDiv, showQuoteOriginal, mBody) {
	if (divID) {
		var el = document.getElementById(divID);
		var elButtons = document.getElementById(buttonDiv);
		var elForm = document.getElementById(formDiv);
		if (elForm && elForm.doQuoteOriq) {
			if (!showQuoteOriginal && elForm.doQuoteOriq) {
					elForm.doQuoteOriq.style.display = 'block';
			} else {
				elForm.doQuoteOriq.style.display = 'none';
				elForm.body.value="";
			}
		}
		   if (el) {
			if (el.style.display == 'none' || el.style.display == '')
				{
					el.style.display = 'block';
					if (elForm && elForm.body) {
						elForm.body.value="";
					}
					if (elForm && elForm.tagList) {
						elForm.tagList.value="";
					}
					if (elButtons) {
						elButtons.style.display = 'none';
					}	
					el.style.display = 'block';
					if (showQuoteOriginal) {
						quoteOriginalFromID(formDiv, mBody);
					}
					if (elForm.doSpellCheck) {
						elForm.doSpellCheck.value="";
					}
				} else {
					el.style.display = 'none';
					if (elButtons) {
						elButtons.style.display = 'block';
					}
				}
			}
	}

}

function setFormElementStyle(style, formDiv) {
	if (formDiv) {
		var elForm = document.getElementById(formDiv);
		if (elForm) {
			styleTag(style, elForm.body);
		}
	}
}

function setHtmlLink(key, formDiv, eLabel, tPrompt) {
	if (formDiv) {
		var elForm = document.getElementById(formDiv);
		if (elForm) {
			promptTag2(key, elForm.body, eLabel, tPrompt);
		}
	}
}

function openEmoticonWinForDropdown(formID) {
    window.open("/dropdown-emoticons.html?formID="+formID, "emoticons", "menubar=no,location=no,personalbar=no,scrollbars=no,width=150,height=200");
}

function submitSpellcheckFromID(formID) {
if (formID) {
		var elForm = document.getElementById(formID);
		if (elForm) {
			 elForm.doSpellCheck.value = 'true';
 			 elForm.submit();
		}
	}
}

function submitPreviewFromID(formID) {
if (formID) {
		var elForm = document.getElementById("postForm-" + formID);
		if (elForm) {
			elForm.mode.value="preview";
			elForm.doPreview.value="Preview";
			elForm.submit();
		}
	}
}

function quoteOriginalFromID(formID, quotedStringArray) {
	var quotedString = "";	
	for (i=0; i< quotedStringArray.length; i++) {
		quotedString = quotedString + quotedStringArray[i] +"\n";
	}
	if (formID) {
		var elForm = document.getElementById(formID);
		if (elForm && elForm.body) {
			elForm.body.value=quotedString;
		}
	}
}