			function verifyInformation()
			{
				if ( document.news_properties.skip_verification.value == "1" )
					return true;
				
								
				if ( document.news_properties.code.value == "" )
				{
					alert("Please specify the code.");
					document.news_properties.code.focus();
					return false;
				}
				
				if ( document.news_properties.body.value == "" )
				{
					alert("Please specify the content.");
					document.news_properties.body.focus();
					return false;
				}
								
				
				return true;
			}
			
			function bold()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to bold.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[B]" + (text != null ? text : (sel != "" ? sel : "")) + "[/B]" );
			}
			
			function italic()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to italicize.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[I]" + (text != null ? text : (sel != "" ? sel : "")) + "[/I]");
			}
			
			function underline()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to underline.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[U]" + (text != null ? text : (sel != "" ? sel : "")) + "[/U]");
			}
			
			function header()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to make a header.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[HEAD]" + (text != null ? text : (sel != "" ? sel : "")) + "[/HEAD]" );
			}
			
			function subHeader()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to make a sub-header.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[SUB]" + (text != null ? text : (sel != "" ? sel : "")) + "[/SUB]" );
			}
			
			function list()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					while ( true )
					{
						text = window.prompt("Enter the text to be listed. To cancel adding list items click the cancel button.");
						
						if ( text == "" || text == null )
							return;
						
						insertAtCursor( document.news_properties.body, "[LIST]" + text + "[/LIST]\r");
					}
					
				}
				
				insertAtCursor( document.news_properties.body, "[LIST]" + (sel != "" ? sel : "") + "[/LIST]");
			}
			
			function leftAlign()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to left align.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[LEFT]" + (text != null ? text : (sel != "" ? sel : "")) + "[/LEFT]");
			}
			
			function centerAlign()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to center align.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[CENTER]" + (text != null ? text : (sel != "" ? sel : "")) + "[/CENTER]");
			}
			
			function rightAlign()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the text to right align.");
					
					if ( text == null || text == "" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[RIGHT]" + (text != null ? text : (sel != "" ? sel : "")) + "[/RIGHT]");
			}
			
			function image()
			{
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					text = window.prompt("Enter the address of the image.", "http://");
					
					if ( text == null || text == "" || text == "http://" )
						return;
				}
				
				insertAtCursor( document.news_properties.body, "[IMG]" + (text != null ? text : (sel != "" ? sel : "")) + "[/IMG]");
			}
			
			function url()
			{
				var display = null;
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				if ( sel == "" )
				{
					display = window.prompt("Enter the text to be displayed for the link (optional):");
					text = window.prompt("Please enter the URL of your link.", "http://");
					
					if ( text == null || text == "" || text == "http://" )
						return;
				}
				else
					insertAtCursor( document.news_properties.body, "[URL]" + sel + "[/URL]");
				
				if ( display != null && display != "" )
					insertAtCursor( document.news_properties.body, "[URL=" + text + "]" + display + "[/URL]");
				else if ( text != null )
					insertAtCursor( document.news_properties.body, "[URL]" + text + "[/URL]");
			}
			
			function email()
			{
				var display = null;
				var sel = getSelection( document.news_properties.body );
				var text = null;
				
				
				if ( sel == "" )
				{
					display = window.prompt("Enter the text to be displayed for the link (optional):");
					text = window.prompt("Please enter the email address for the link.");
					
					if ( text == null || text == "" )
						return;
				}
				else
					insertAtCursor( document.news_properties.body, "[EMAIL]" + sel + "[/EMAIL]");
					

				if ( display != null && display != "" )
					insertAtCursor( document.news_properties.body, "[EMAIL=" + text + "]" + display + "[/EMAIL]");
				else if ( text != null )
					insertAtCursor( document.news_properties.body, "[EMAIL]" + text + "[/EMAIL]");
			}
			
			function insertAtCursor( field, value )
			{
				// internet explorer
				if ( document.selection )
				{
					field.focus();
					sel = document.selection.createRange();
					sel.text = value;
			  	}
				// firefox and safari
				else if ( field.selectionStart || field.selectionStart == '0' )
				{
					var startPos = field.selectionStart;
					var endPos = field.selectionEnd;
					field.value = field.value.substring(0, startPos) + value + field.value.substring(endPos, field.value.length);
				}
				else
					field.value += value;
			}
			
			function getSelection( field )
			{
				var sel;
				
				// internet explorer
				if ( document.selection )
				{
					field.focus();
					object = document.selection.createRange();
					sel = object.text;
			  	}
				// firefox and safari
				else if ( field.selectionStart || field.selectionStart == '0' )
				{
					var startPos = field.selectionStart;
					var endPos = field.selectionEnd;
					sel = field.value.substring(startPos, endPos);
				}
				
				return sel;
			}
			
			function Open_Popup( url, width, height )
			{
				window.open( url, "_blank", "width=" + width + ", height=" + height + ", resizable=1, scrollbars=0, toolbar=0, status=0, location=0, menubar=0, titlebar=0" );
			}