function getvalue(field, str)
{
	if(field == 'name' && str == '')
	{
		document.frm_quote.name.value = 'Enter Your Name';
	}
	if(field == 'cmpny' && str == '')
	{
		document.frm_quote.cmpny.value = 'Company Name';
	}
	if(field == 'email' && str == '')
	{
		document.frm_quote.email.value = 'Enter your Email ID';
	}
	if(field == 'phn' && str == '')
	{
		document.frm_quote.phn.value = 'Enter Your Phone No';
	}
	if(field == 'histoty' && str == '') 
	{
		document.frm_quote.histoty.value = 'Type Brief Summary Here';
	}
	if(field == 'captchaImage_val' && str == '') 
	{
		document.frm_quote.captchaImage_val.value = 'Security Code';
	}
}



function getvalue1(field, str)
{
	if(field == 'name' && str == 'Enter Your Name')
	{
		document.frm_quote.name.value = '';
	}
	if(field == 'cmpny' && str == 'Company Name')
	{
		document.frm_quote.cmpny.value = '';
	}
	if(field == 'email' && str == 'Enter your Email ID')
	{
		document.frm_quote.email.value = '';
	}
	if(field == 'phn' && str == 'Enter Your Phone No')
	{
		document.frm_quote.phn.value = '';
	}
	if(field == 'histoty' && str == 'Type Brief Summary Here') 
	{
		document.frm_quote.histoty.value = '';
	}
	if(field == 'captchaImage_val' && str == 'Security Code') 
	{
		document.frm_quote.captchaImage_val.value = '';
	}
}




function validate_quote()

{ 

 var msg='';     



 if(document.frm_quote.name.value=='' || document.frm_quote.name.value=='Enter Your Name' )

	msg+="*Please Write Your Name"+"\r\n";

 else if(document.frm_quote.cmpny.value=='' || document.frm_quote.cmpny.value=='Company Name' )

	msg+="*Please Write Your Company Name"+"\r\n";	

 else if(document.frm_quote.email.value=='' || document.frm_quote.email.value=='Enter your Email ID')

	msg+="*Please Write Your Email"+"\r\n";	

 else if(!(echeck(document.frm_quote.email.value)))

	msg+="*Email Should be in Proper Format"+"\r\n";	
	
 else if(document.frm_quote.phn.value=='' || document.frm_quote.phn.value=='Enter Your Phone No' )

	msg+="*Please Write Your nter Your Phone No"+"\r\n";			

 else if(document.frm_quote.captchaImage_val.value=="" || document.frm_quote.captchaImage_val.value=="Security Code")

	msg+="*Please Fill Security Code"+"\r\n";	
	
 else if(document.frm_quote.captchaImage_val.value.toLowerCase() != document.frm_quote.captchaImage.value.toLowerCase())

	msg+="*Wrong Security Code"+"\r\n";	

 		

	if(msg!='')

	{	

		alert(msg);

		return false;

	}

	return true;

}

function echeck(str) {



		var at="@"

		var dot="."

		var lat=str.indexOf(at)

		var lstr=str.length

		var ldot=str.indexOf(dot)

		if (str.indexOf(at)==-1){		   

		   return false

		}



		if (str.indexOf(at)==-1 || 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.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		   

		    return false

		 }



		 if (str.indexOf(dot,(lat+2))==-1){		    

		    return false

		 }

		

		 if (str.indexOf(" ")!=-1){		    

		    return false

		 }



 		 return true					

}







function validate_enquery()

	{

		if(document.enquiry.com_name.value=="")

			{

				alert("Please enter Company Name");

				document.enquiry.com_name.focus();

				return false;

			}

		

		if(document.enquiry.con_name.value=="")

			{

				alert("Please enter Contact Name");

				document.enquiry.con_name.focus();

				return false;

			}

		

		if(document.enquiry.con_nmbr.value=="")

			{

				alert("Please enter Contact Number");

				document.enquiry.con_nmbr.focus();

				return false;

			}

			

			

			

		if(document.enquiry.email.value=="")

			{

				alert("Please enter your Email address");

				document.enquiry.email.focus();

				return false;

			}

	   		

	

	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

    str = document.enquiry.email.value;

     

	 if(!str.match(emailRegEx))

     {

        alert("Email Address should be in correct format");

      	document.enquiry.email.focus();

        return false;

     }	

		

	 if(document.enquiry.location.value=="")

			{

				alert("Please Enter Location");

				document.enquiry.location.focus();

				return false;

			}

	if(document.enquiry.requirement.value=="")

			{

				alert("Please senter Requirement");

				document.enquiry.requirement.focus();

				return false;

			}

				

		

			

		

return true;		

}





