// JavaScript Document

function emailverify(email)
	{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	str=email;
	if(!filter.test(str))
		{
		return false
		}
	else return true;
	}
	
	
//###################################################################################

function getConfirm()
	{
		return confirm('Do you really want to delete?');
			
	}

//###############################################################################	

function getVal(id)
	{
		return document.getElementById(id).value;
	}
	
	
	
	function form_validate()
	{
		
		if(getVal('name')=='')
			{
				alert('Please enter your Name');
				document.getElementById('name').focus();
				return false;
			}
			
			
		
		if(getVal('company')=='')
			{
				alert('Please enter your company name');
				document.getElementById('company').focus();
				return false;
			}
		
			
			
		if(getVal('email')=='')
			{
				alert('Please enter your Email');
				document.getElementById('email').focus();
				return false;
			}	
		
		
		if(!emailverify(getVal('email')))
			{
				alert('Please enter the valid Email Id');
				document.getElementById('email').focus();
				return false;
			}
			
			
		
				
		
		if(getVal('subject')=='null')
			{
				alert('Please select a subject');
				document.getElementById('subject').focus();
				return false;
			}
		
		
		if(getVal('message')=='')
			{
				alert('Please enter your message');
				document.getElementById('message').focus();
				return false;
			}
			
		
		
		
		
		
	}