var MessageMax  = "512000";
var Override    = "";
	
function emo_pop()
{
	
  window.open('index.php?act=legends&CODE=emoticons&s=ecb8c96413dfe2132546a77516a4d423','Legends','width=250,height=500,resizable=yes,scrollbars=yes'); 
     
}	

function CheckLength() {
	MessageLength  = document.REPLIER.Post.value.length;
	message  = "";
		if (MessageMax !=0) {
			message = "Post: The maximum allowed length is " + MessageMax + " characters.";
		} else {
			message = "";
		}
		alert(message + "So far, you have used " + MessageLength + " characters.");
}
	
	function ValidateForm(isMsg) {
		MessageLength  = document.REPLIER.Post.value.length;
		errors = "";
		if (isMsg == 1)
		{
			if (document.REPLIER.msg_title.value.length < 2)
			{
				errors = "You must enter a message title";
			}
		}
	
		if (MessageLength < 2) {
			 errors = "You must enter a message to post!";
		}

		if (MessageMax !=0) {
			if (MessageLength > MessageMax) {
				errors = "The maximum allowed length is " + MessageMax + " characters. Current Characters: " + MessageLength;
			}
		}
		
		if (errors != "" && Override == "") {
			alert(errors);
			return false;
		} else {
			//document.REPLIER.mysubmit.disabled = true;
			return true;
		}
	}
	
	// IBC Code stuff
	var text_enter_url      = "Enter the complete URL for the hyperlink";
	var text_enter_url_name = "Enter the title of the webpage";
	var text_enter_image    = "Enter the complete URL for the image";
	var text_enter_email    = "Enter the email address";
	var text_enter_flash    = "Enter the URL to the Flash movie.";
	var text_code           = "Usage: [CODE] Your Code Here.. [/CODE]";
	var text_quote          = "Usage: [QUOTE] Your Quote Here.. [/QUOTE]";
	var error_no_url        = "You must enter a URL";
	var error_no_title      = "You must enter a title";
	var error_no_email      = "You must enter an email address";
	var error_no_width      = "You must enter a width";
	var error_no_height     = "You must enter a height";
	var prompt_start        = "Enter the text to be formatted";
	
	var help_Myanmar           = "Change Myanmar Fonts";
	var help_English         = "Change English Fonts";	
	var help_bold           = "Insert Bold Text (alt + b)";
	var help_italic         = "Insert Italic Text (alt + i)";
	var help_under          = "Insert Underlined Text (alt + u)";
	var help_font           = "Insert Font Face tags";
	var help_size           = "Insert Font Size tags";
	var help_color          = "Insert Font Color tags";
	var help_close          = "Close all open tags";
	var help_url            = "Insert Hyperlink (alt+ h)";
	var help_img            = "Image (alt + g) [img]http://www.dom.com/img.gif[/img]";
	var help_email          = "Insert Email Address (alt + e)";
	var help_quote          = "Insert Quoted Text (alt + q)";
	var help_list           = "Create a list (alt + l)";
	var help_code           = "Insert Monotype Text (alt + p)";
	var help_click_close    = "Click button again to close";
	var list_prompt         = "Enter a list item. Click 'cancel' or leave blank to end the list";
	
	
function say(){
	document.REPLIER.body.value = document.REPLIER.body.value + ':' + event.srcElement.id + ':';
	document.REPLIER.body.focus();	
	}
	
	
function showFormMenu(menu) {
	if (menu.style.visibility == 'visible') hideFormMenu(menu);
	else if (menu.style.visibility == 'hidden') menu.style.visibility = 'visible';
	else 
	{
	menu.style.visibility = 'visible';
	menu.style.position = 'absolute';
	menu.style.left = (screen.width) ? (screen.width)/4 : 0;
	menu.style.top = (screen.height) ? (screen.height)/4 : 0;
	}
}

function hideFormMenu(menu) {
	menu.style.visibility = 'hidden';
}	

function showFormMenu(menu) {
	if (menu.style.visibility == 'visible') hideFormMenu(menu);
	else if (menu.style.visibility == 'hidden') menu.style.visibility = 'visible';
	else 
	{
	menu.style.visibility = 'visible';
	menu.style.position = 'absolute';
	menu.style.left = (screen.width) ? (screen.width)/4 : 0;
	menu.style.top = (screen.height) ? (screen.height)/4 : 0;
	}
}
