  var strSentence = "";
 
  function onfocussetnull(fieldid)
  {
   //this will check is the field already focused or not if not make the field null
   var i = strSentence.indexOf(fieldid);
   if(i < 0) 
   {
   document.getElementById(fieldid).value=""
   document.getElementById(fieldid).focus()
   //here apending each focused field name follwed by * 
   strSentence=strSentence+fieldid+"*"
   }
  }

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   // alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm( txt1 ){
	var emailID=txt1
	
	if ((emailID.value==null)||(emailID.value=="")){
		//alert("Please Enter your Email ID")
		emailID.focus()
		return;
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return;
	}
	return;
 }


function isCharacter(field) {
var re = /^[a-z]*$/;
if (!re.test(field.value))
 {
field.value=""
field.focus();
return;
}
return;
} 


function submitregister()
{
 if((document.ADDCOMPANY.MODERATOREMAIL.value==null)||(document.ADDCOMPANY.MODERATOREMAIL.value=="")) 
  {
   
  }
  else
  {
    ValidateForm(document.ADDCOMPANY.MODERATOREMAIL);
  }
  
   document.ADDCOMPANY.submit();
  
}


function submitlogin()
{
  if((document.SUBMITUSER.USERINFOID.value==null)||(document.SUBMITUSER.USERINFOID.value=="")) 
  {
   
  }
  else
   {
    ValidateForm(document.SUBMITUSER.USERINFOID); 
   }
  document.SUBMITUSER.submit();
}
