//-------------------------------------------------------------------------------
//File Name		:	CommonJs.js
//-------------------------------------------------------------------------------

// Function to display error message and set focus to supplied object
 function AbortEntry(sMsg, Obj)
 {
	alert(sMsg);
	Obj.focus();
	return false;
 }
 
 //Function to Validate Email address entered by user in Obj
 function validate_email(Obj) 
  {
    if(Obj.value.length == 0) { 
      return AbortEntry("Please enter Email address",Obj); 
      }
    if(-1 == Obj.value.indexOf("@")) { 
       return AbortEntry("Your email must have a '@'",Obj); 
       }
    if(-1 != Obj.value.indexOf(",")) { 
       return AbortEntry("Your email must not have a ',' in it",Obj);
       }
    if(-1 != Obj.value.indexOf("#")) { 
       return AbortEntry("Your email must not have an '#' in it.",Obj); 
       }
    if(-1 != Obj.value.indexOf("!")) { 
       return AbortEntry("Your email must not have a '!' in it.",Obj); 
       }
    if(-1 != Obj.value.indexOf(" ")) { 
       return AbortEntry("Your email must not have a space in it.",Obj); 
       }
    if(Obj.value.length == (Obj.value.indexOf("@")+1) ) {
       return AbortEntry("Your email must have a domain name after the '@'.",Obj); 
       }
    if(-1 == Obj.value.indexOf(".")) { 
       return AbortEntry("Your email must have a '.'.",Obj); 
       }
    if(Obj.value.length == 0) { 
      return AbortEntry("Please enter your email.",Obj); 
      }
    return true;
  }




