function check()
 {
 	if (!document.add_something.FName.value) 
	{
		alert("Please Enter First Name ");
		document.add_something.FName.focus();
		return false;
	 }

	if (!document.add_something.LName.value) 
	{
		alert("Please Enter Last Name ");
		document.add_something.LName.focus();
		return false;
	 }

  	if (!document.add_something.Company.value) 
  	{
		alert("Please Enter Company ");
		document.add_something.Company.focus();
		return false;
	 }
  	if (!document.add_something.Phone.value)
  	 {
		alert("Please Enter Phone Number ");
		document.add_something.Phone.focus();
		return false;
	 }
	if (!document.add_something.Email.value)
  	 {
		alert("Please select Email Address ");
		document.add_something.Email.focus();
		return false;
	  }
	
	if (!echeck(document.add_something.Email.value))
  	 { 
  		validity = false; alert('Please enter valid email id!'); 
		document.add_something.Email.focus();
   		return false;
  	 }
	
	if (!document.add_something.Title.value)
	 {
		alert("This Field Cannot Be Blank");
		document.add_something.Title.focus();
		return false;
	  }
	if (!document.add_something.Description.value) 
	 {
		alert("Please Enter Description ");
		document.add_something.Description.focus();
		return false;
	 }
	if (!document.add_something.todays_date.value) 
	 {
		alert("Please Enter Start Date");
		document.add_something.todays_date.focus();
		return false;
	 }
	
	if (!document.add_something.todays_date1.value) 
	 {
		alert("Please Enter End Date");
		document.add_something.todays_date1.focus();
		return false;
	 }
	
	if(document.add_something.todays_date1.value < document.add_something.todays_date.value)
	 {
		alert("End Date is Less Than Start date, Please Check");
		document.add_something.todays_date1.focus();
		return false;
	 }
		

}
function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		//trace(lat)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }
			
		 if (str.indexOf(" ")!=-1){
		    return false
		 }
		if(lstr==ldot+1)
	    return false
 		 return true					
	}
	
	
