// JavaScript Document

function validateForm(thisform){
		with(thisform){
			if(txtEventName.value.length < 3){
				alert("Please Enter the Correct Event Name");
				txtEventName.focus();
				return false;
			}
			if(txtEventDate.value.length < 6){
				alert("Please Enter the Correct Event Date");
				txtEventDate.focus();
				return false;	
			}
			if(txtEventLocation.value.length==0){
				alert("Please Enter the Correct Event Location");
				txtEventLocation.focus();
				return false;
			}
			if(txtEventFees.value.length==0){
				alert("Please Enter the Event Fees");
				txtEventFees.focus();
				return false;
			}
			if(parseInt(txtEventFees.value)==0){
				alert("Fees must be greater then zero");
				txtEventFees.focus();
				return false;
			}
			if(txtEventAddress.value.length==0){
				alert("Please Enter the Event Address");
				txtEventAddress.focus();
				return false;
			}
			if(txtEventResponseTemplate.value.length==0){
				alert("Please Enter the Event Response Template");
				txtEventResponseTemplate.focus();
				return false;
			}
			if(txtEventManagerName.value.length==0){
				alert("Please Enter the Event Manager's Name");
				txtEventManagerName.focus();
				return false;
			}
			if(!isValidEmail(txtEventManagerEmail.value))
			{
				txtEventManagerEmail.focus();
				return false;
			}
			if(txtEventManagerMobile.value.length==0){
				alert("Please Enter the Event Manager's Contact Number");
				txtEventManagerMobile.focus();
				return false;
			}
			return true;
		}
}
function isValidEmail(strEmail){
  	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  //strEmail = document.forms[0].email.value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      alert('Please Enter the Valid Email Address');
      return false;
    } 
    return true; 
}

 function numeric(e)
 {  
  if (window.event) {
      code=event.keyCode;
     }
  else {
      code= e.which;
     }
	 
	 
  if(code==8 || code==9 || code==0){return true;}
       
  if (((code<48)  ||(code>57)) && (code != 9)&& (code != 13))
  {  
   return false;
  } 
 } 
 
function checknumeric(ctl)
{  
	var val=new String(ctl.value);
	if ((event.keyCode == 46) && val.indexOf(".") !=-1)  
	{
		event.keyCode="";
		return false;			   
	}   
	if (((event.keyCode<48)  ||(event.keyCode>57)) && (event.keyCode != 9)&& (event.keyCode != 13) && (event.keyCode != 46) && (event.keyCode != 8))
	{		
		event.keyCode="";
		return false;
	}	
}
