function check(obj) 
{
	if (obj.Name.value=='' || obj.Name.value==null)
		{ alert('You must fill in the "Name" field.'); return false}
	if (obj.Passwd.value=='' || obj.Passwd.value==null)
		{ alert('You must fill in the "Password" field.'); return false}
	if (obj.RPasswd.value=='' || obj.RPasswd.value==null || obj.RPasswd.value!=obj.Passwd.value )
		{ alert('The "Retype Password" field must be the same as the one in the "Password" field.'); return false}
	var obj1=obj.Country.selectedIndex;
	
	valid=validmail(obj.email.value);
	if (valid !='ok') 
		{
			Str = 'The e-mail address is not correct because: \nThe address '
			if (valid.charAt(5)==1) Str+='does not contain a "@"'
			if (valid.charAt(5)==2) Str+='starts with a "."'
			if (valid.charAt(5)==3) Str+='contains an invalid character ('+valid.charAt(6)+').'
			if (valid.charAt(5)==4) Str+='contains more than one "@"'
			if (valid.charAt(5)==5) Str+='contains a "." before the "@"'
			if (valid.charAt(5)==6) Str+='ends with an "." or a "@"'
			if (valid.charAt(5)==7) Str+='contains two consecutive "."'
			if (valid.charAt(5)==8) Str+='contains an illegal top level domain'
			if (valid.charAt(5)==9) Str+='contains an illegal top level domain'
				alert(Str)
			 return false
		}
	if (obj.Country[obj1].value == 'NOT')
		{ alert('You must fill in the Country field.'); return false}
	return true
}






function validmail(obj) {
 disallowed="()<>,;:\\\"[ ]#$*"
 Domains=new Array('com','org','net','edu','gov','mil','int')
 Domsa='defgilmnoqrcstuwz'
 Domsb='abdefghijmnorstuvwyz'
 Domsc='acfghiklmnorsuvxyz'
 Domsd='ejkmoz'
 Domse='cqeghst'
 Domsf='ijkmor'
 Domsg='abdefghilmnpqrtuwy'
 Domsh='kmnrtu'
 Domsi='delmnoqrst'
 Domsj='emop'
 Domsk='eghimnprwyz'
 Domsl='abcikrsntuvy'
 Domsm='acdghklmnopqrstvuwxyz'
 Domsn='acefgiloprtuz'
 Domso='m'
 Domsp='aefghklmnrtwy'
 Domsq='a'
 Domsr='eouw'
 Domss='abcdeghijklmnortuvyz'
 Domst='cdfghjkmnoprtvwz'
 Domsu='agknssyz'
 Domsv='aceginu'
 Domsw='fs'
 Domsx=''
 Domsy='eu'
 Domsz='amw'
 valid=true;
 if (obj.indexOf('@')==-1) return 'Error1';
 if (obj.indexOf('.')==0) return 'Error2';
 for (var i=0;i<15;i++) {
  if (obj.indexOf(disallowed.substring(i,i+1))!=-1)  return 'Error3'+disallowed.substring(i,i+1);
 }
 atpos=obj.indexOf('@')
 if (obj.charAt(atpos-1)=='.') return 'Error5'
 copy=obj.substring(atpos+1,obj.length);
 if (copy.indexOf('@')!=-1) valid='Error4';
 if (copy.indexOf(".")<1) valid='Error5';
 if (copy.lastIndexOf(".")+1==copy.length) return 'Error6';
 copy=obj;
 while (copy.indexOf('.')!=-1) {
  copy=copy.substring(copy.indexOf('.')+1,copy.length);
  if (copy.indexOf('.')==0) return 'Error7';
 }
 copy=obj.substring(obj.lastIndexOf('.')+1,obj.length).toLowerCase();
 if (copy.length>3 || copy.length<1) return 'Error8'
  else {
  k=-1;valid=false;
  while (Domains[++k]) {
   if (Domains[k]==copy) valid=true
  }
  if (copy.length==2) {
   comp=eval('Doms'+copy.charAt(0))
   k=-1
   while (comp.charAt(++k)) {
    if (copy.charAt(1)==comp.charAt(k)) valid=true
   }
  }
 }
 if (valid!=true) return 'Error9'
 return 'ok'
}