function submitForm() {
  return true;
}
var prompt_start        = 'Enter the text to be formatted';
var text_enter_url      = 'Enter the complete URL for the hyperlink';
var image_enter_url     = 'Enter the complete URL to the image';
var text_enter_url_name = 'Enter the title of the webpage';
var text_enter_email    = 'Enter the email address';
var error_no_url        = 'You must enter a URL';
var error_no_image      = 'You must enter a URL';
var error_no_title      = 'You must enter a title';
var error_no_subject    = 'You must enter a subject';
var error_no_comments   = 'You must enter your comments';
var help_bold           = 'Inserts Bold Text';
var help_italic         = 'Inserts Italic Text';
var help_under          = 'Inserts Underlined Text';
var help_url            = 'Inserts Hyperlink';
var help_email          = 'Inserts Email Address';
var help_quote          = 'Inserts Quoted Text';
var help_image          = 'Inserts an image';

	function helpmsg(msg)
  {
    msg=eval( "help_" + msg );
    write_html(msg,'help');
  }

  function do_tag(thetag) {
    inserttext = prompt(prompt_start + "\n[" + thetag + "]xxx[/" + thetag + "]","");
    if ( (inserttext != null) && (inserttext != "") ) {
      doInsert("[" + thetag + "]" + inserttext + "[/" + thetag + "] ","", false);
    }
  }
  function tag_url()
  {
    var FoundErrors = '';
    var enterURL   = prompt(text_enter_url, "http://");
    var enterTITLE = prompt(text_enter_url_name, "Name of Webpage");

    if (!enterURL) {
      FoundErrors += " " + error_no_url;
    }
    if (!enterTITLE) {
      FoundErrors += " " + error_no_title;
    }
    if (FoundErrors) {
      alert("Error!"+FoundErrors);
      return;
    }
    doInsert("[URL="+enterURL+"]"+enterTITLE+"[/URL]","", false);
  }
  function tag_email()
  {
    var emailAddress = prompt(text_enter_email, "");
    if (!emailAddress) {
      alert(error_no_email);
      return;
    }
    doInsert("[EMAIL]"+emailAddress+"[/EMAIL]","", false);
  }
  function tag_image()
  {
    var imageAddress = prompt(image_enter_url, "");
    if (!imageAddress) {
      alert(error_no_image);
      return;
    }
    doInsert("[IMG]"+imageAddress+"[/IMG]","", false);
  }
// Determine browser type and stuff.
// Borrowed from http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html

var myAgent   = navigator.userAgent.toLowerCase();
var myVersion = parseInt(navigator.appVersion);

var is_ie   = ((myAgent.indexOf("msie") != -1)  && (myAgent.indexOf("opera") == -1));
var is_nav  = ((myAgent.indexOf('mozilla')!=-1) && (myAgent.indexOf('spoofer')==-1)
                && (myAgent.indexOf('compatible') == -1) && (myAgent.indexOf('opera')==-1)
                && (myAgent.indexOf('webtv') ==-1)       && (myAgent.indexOf('hotjava')==-1));

var is_win   =  ((myAgent.indexOf("win")!=-1) || (myAgent.indexOf("16bit")!=-1));
var is_mac    = (myAgent.indexOf("mac")!=-1);
function doInsert(inputTag, closeTag, sng)
{
	var isClose = false;
	var obj_ta = document.getElementById('review');

	if ( (myVersion >= 4) && is_ie && is_win) // Ensure it works for IE4up / Win only
	{
		if(obj_ta.isTextEdit){ // this doesn't work for NS, but it works for IE 4+ and compatible browsers
			obj_ta.focus();
			var sel = document.selection;
			var rng = sel.createRange();
			rng.colapse;
			if((sel.type == "Text" || sel.type == "None") && rng != null){
				if(closeTag != "" && rng.text.length > 0)
					inputTag += rng.text + closeTag;
				else if(sng)
					isClose = true;
	
				rng.text = inputTag;
			}
		}
		else{
			if(sng)
				isClose = true;
			obj_ta.value += inputTag;
		}
	}
	else
	{
		if(sng)
			isClose = true;

		obj_ta.value += inputTag;
	}

	obj_ta.focus();
	return isClose;
}
  function validateForm()
  {

    var strcom = document.review.comments;
    var strsub = document.review.subject;
    if (isEmpty(strcom))
    {
      alert(error_no_comments);
      strcom.focus();
      return false;
    }
    else if (isEmpty(strsub))
    {
      alert(error_no_subject);
      strsub.focus();
      return false;
    }
    else
    {
      return true;
    }

  }
  function isEmpty(atf)
  {
    if ((atf.value.length==0) || (atf.value==null))
    {
      return true;
    }
    else
    {
      return false;
    }
  }