// JavaScript Document
function trim(str) 

    {       while (str.charAt(str.length - 1)==" ")   str = str.substring(0, str.length - 1);

            while (str.charAt(0)==" ")   str = str.substring(1, str.length);

            return str;

    }

   function isEmailAddr(email)

   {     var result = false

         var theStr = new String(email)

         var index = theStr.indexOf("@");

         if (index > 0)

         {     var pindex = theStr.indexOf(".",index);

               if ((pindex > index+1) && (theStr.length > pindex+1))	result = true;

         }

         return result;

    }



function validate(){

var a =document.quote.Name.value;

if (a.length==0)

{

	alert("Enter your Name");

	document.quote.Name.focus();

	return false;

}

var str1=document.quote.email.value;

if (trim(str1) == "")

	{    alert("Enter Valid Email ID");

         document.quote.email.focus();

		 return false;

	}

	else{

	    for (var i = 1; i < str1.length; i++)     

	    {    var ch = str1.substring(i, i + 1);   

             if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch < "0" || "9" < ch) && (ch != '_')&& (ch !='@')&& (ch != '.') && (ch != '-') )

	            {   alert("Some Special Character and Blank Space Not allowed");

			        document.quote.email.focus();

	                return false;

	            }

	       }



	      if (!isEmailAddr(str1)) 

		  {

		    alert("Please enter a complete email address in the form: yourname@yourdomain.com");

        	document.quote.email.focus();

			return false;

          }

		  if (str1.length < 3)

          {

		    alert("Please enter at least 3 characters in the \"email\" field.");

        	document.quote.email.focus();

			return false;

          }

       }
	   
var a =document.quote.phone.value;

if (a.length==0)

{

	alert("Enter your Phone Number");

	document.quote.phone.focus();

	return false;

}

}
