function ValidateEmail( email )
{
	var atCharPresent = false;
	var dotPresent = false;

	for ( var Idx = 0; Idx < email.length; Idx++ )
	{
		if ( email.charAt ( Idx ) == '@' )
			atCharPresent = true;
		if ( email.charAt ( Idx ) == '.' )
			dotPresent = true;
	}

	if ( !atCharPresent || !dotPresent )
		return false;

	return true;
}

function validate()
{

	if (document.myform.txtName.value == "")
	{
			alert("Your Name cannot be blank");
			document.myform.txtName.focus();
			return false;
	}
	else
	{
			var valu4=eval('document.myform.txtName.value');
			var flag4;			
			if(valu4=="")
			{
				flag4=false;
			}
			instr=valu4.toString()
						
			for(var i=0;i<instr.length;i++)
			{
				var char1=instr.charAt(i)
				value=char1.charCodeAt()
				if(value=="32")
				{
					flag4=false;
				}
				else
				{
					flag4=true;
					break;
				}
			}
			if(flag4==false)
			{
				alert("Please enter a value for Your Name.");
				myform.txtName.focus();
				return(false);
			}
		
	}
   
	if (document.myform.txtName.value != "")
	{	

		str = document.myform.txtName.value;
		str = str.toLowerCase();
		if(str.indexOf("<" + "script") != -1 || str.indexOf("http://") != -1 )
		{
			alert("wrong format");
			document.myform.txtName.focus();
			return false;
		}
	}


	if (document.myform.txtEmail.value == "")
	{
		alert("Your Email cannot be blank");
		document.myform.txtEmail.focus();
		return false;
	}
	else 
	{
		if ( !ValidateEmail( document.myform.txtEmail.value ) )
		{
			alert( "Invalid Email " + document.myform.txtEmail.value );
			myform.txtEmail.focus();
			document.myform.txtEmail.value ="" ;
			return false;
		}
	}  			
	return true;
}