<!--
// javascript to validate register.jsp form data
function profile_Validator(theForm)
{
  if (theForm.name.value != "")
  {
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.name.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }
  }

  
  if (theForm.location.selectedIndex < 0)
  {
    alert("Please select one of the \"Location\" options.");
    theForm.location.focus();
    return (false);
  }

  if (theForm.telno.value != "")
  {

  var checkOK = "0123456789-- \t\r\n\f";
  var checkStr = theForm.telno.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit, whitespace and \"-\" characters in the \"Telephone No.\" field.");
    theForm.telno.focus();
    return (false);
  }
  }

if (theForm.email.value != "")
  {
//    alert("Please enter a value for the \"Email\" field.");
//    theForm.email.focus();
//    return (false);
//  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@._-";
  var checkStr = theForm.email.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"@._-\" characters in the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  }

  return (true);
}

function setlocation(theLoc)  //select multiple
{	//  //
	//alert("loc val is -"+theLoc+".");
if (theLoc != '' && theLoc != '0')
	{	inForm = document.forms[0]; //document.forms[0] ;
		availatlength = inForm.location.length;

		//alert("form val is -"+inForm);

		locarray = theLoc.split(", ");
		// re = /,/;	//regular expression indicates search for comma
		//anyString.substring(0,str.search(re));// extract substr from 0 to search					// index(excluded)
		//alert("splitting done");
		for (var j=0; j < locarray.length; j++) 
		{	locval = locarray[j] ; // locarray[j].substring(0,locarray[j].search(re)); 
			//alert("loc code toset is -"+locval);
			for (i = 0; i < availatlength; i++) 
			{	if ( inForm.location.options[i].value == locval)
				{	inForm.location.options[i].selected=true;
					//alert("loc code SET is -"+locval);
					break;
				}
			}
		}
		//inForm.location.focus();
	}
}
//-->
 
