function disableRightClick(e)
{
  var message = "Right click disabled";
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers)
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}

//form validation start
function form_validate(theform)
{
//global variables
var checkChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \t\r\n\f";
var checkNum = "0123456789-,. \t\r\n\f";
var checkAll = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-., \t\r\n\f";

//firstname
  if (theform.firstname.value == "")
  {
    alert ("Please enter your first name");
	theform.firstname.focus();
	return (false);
  }

  var checkStr = theform.firstname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkChar.length;  j++)
      if (ch == checkChar.charAt(j))
        break;
    if (j == checkChar.length)
    {
      allValid = false;
      break;
    }
  }

  if (!allValid)
  {
    alert("Please enter only characters for the name.");
    theform.firstname.focus();
    return (false);
  }

//lastname
  if (theform.lastname.value == "")
  {
    alert ("Please enter your last name");
	theform.lastname.focus();
	return (false);
  }

  var checkStr = theform.lastname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkChar.length;  j++)
      if (ch == checkChar.charAt(j))
        break;
    if (j == checkChar.length)
    {
      allValid = false;
      break;
    }
  }

  if (!allValid)
  {
    alert("Please enter only characters for your lastname.");
    theform.lastname.focus();
    return (false);
  }

//country
  if (theform.country.value == "choose")
  {
    alert ("Please select your country of origin");
	theform.country.focus();
	return (false);
  }

//comments
  if (theform.comments.value == "")
  {
    alert ("Please enter a comment");
	theform.comments.focus();
	return (false);
  }
  
  var checkStr = theform.comments.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkAll.length;  j++)
      if (ch == checkAll.charAt(j))
        break;
    if (j == checkAll.length)
    {
      allValid = false;
      break;
    }
  }
  
  if (!allValid)
  {
    alert("Please enter only characters or numbers in the comment box.");
    theform.comments.focus();
    return (false);
  }
  
  
    

//alert ("checks complete");  

}
//form validation ends

