function blank_field_email(str,value)

{

		if(document.getElementById(str).value == value)

		{

			document.getElementById(str).value = "";

		}	

}

function fill_field_email(str,value)

{

	if(document.getElementById(str).value == "")

	{

		document.getElementById(str).value = value;

	}	

}

function check_quote_form()

{

	if(Trim(document.frm.txt_name.value) == "" || document.frm.txt_name.value == "Full Name")

	{

		alert("Please Enter First Name!");

		document.frm.txt_name.focus();

		

		return false;

	}

	if(Trim(document.frm.txt_email.value) == "" || document.frm.txt_email.value == "Email")

	{

		alert("Please Enter Email!");

		document.frm.txt_email.focus();

		

		return false;

	}

	if(Trim(document.frm.txt_email.value) != "" && document.frm.txt_email.value != "Email")

	{

		if(!isEmail(document.frm.txt_email.value,1,0) || (document.frm.txt_email.value.length==0))

		{

			alert("Please enter valid Email!");

			document.frm.txt_email.select();

			document.frm.txt_email.focus();

			return false;

		}

	}

	if(Trim(document.frm.txt_phone.value) == "" || document.frm.txt_phone.value == "Phone")

	{

		alert("Please Enter Phone!");

		document.frm.txt_phone.focus();

		

		return false;

	}

	if(Trim(document.frm.txt_phone.value) != "" || Trim(document.frm.txt_phone.value) != "Phone")
	{
		
		if (chk_valid_phone(document.frm.txt_phone.value)==false)
		{
			alert("Please Enter a valid Phone!")
			document.frm.txt_phone.value=""
			document.frm.txt_phone.focus()
			return false
		}
	}
	
	if(Trim(document.frm.txt_Code.value) == "" || Trim(document.frm.txt_Code.value) ==  "Please Enter Image Code")

	{

		alert("Please Enter Image Code!");

		document.frm.txt_Code.focus();

		return false;

	}
	

	return true;



}


// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phone_number_delimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var valid_world_phone_chars = phone_number_delimiters + "+";
// Minimum no of digits in an international phone no.
var min_digits_in_phone_number = 10;

function is_integer(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function trim_innerr(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}
function strip_chars_in_bag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function chk_valid_phone(strPhone){
var bracket=3
strPhone=trim_innerr(strPhone)
if(strPhone.indexOf("+")>1) return false
if(strPhone.indexOf("-")!=-1)bracket=bracket+1
if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false
var brchr=strPhone.indexOf("(")
if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false
if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false
s=strip_chars_in_bag(strPhone,valid_world_phone_chars);
return (is_integer(s) && s.length >= min_digits_in_phone_number);
}





function verify()

 {

	

 		if(Trim(document.frmcontactus.txt_FirstName.value)=='')

		{

			alert("Please enter First Name!");

			document.frmcontactus.txt_FirstName.focus();

			return false;

		}

		if(!isAlphabetic(Trim(document.frmcontactus.txt_FirstName.value)))

		{

			 alert("Please enter only alphabetic value for First Name!");

			 document.frmcontactus.txt_FirstName.select();

			 document.frmcontactus.txt_FirstName.focus();

			 return false;

		 }	

		 

		if(Trim(document.frmcontactus.txt_LastName.value)=='')

		{

			alert("Please enter Last Name!");

			document.frmcontactus.txt_LastName.focus();

			return false;

		}

	

			 

		if(Trim(document.frmcontactus.txt_Country.value)=='')

		{

			alert("Please enter Country!");

			document.frmcontactus.txt_Country.focus();

			return false;

		}

		

		if(Trim(document.frmcontactus.txt_Email.value)=='')

		{

			alert("Please enter Email Address!");

			document.frmcontactus.txt_Email.focus();

			return false;

		}

		if(!isEmail(document.frmcontactus.txt_Email.value))

		{

			alert ("Please Enter Proper Email!");			

			document.frmcontactus.txt_Email.focus();

			return false;

		}

		

		/*if(Trim(document.frmcontactus.txt_Telephone.value) != '')

		{

			if(isNaN(document.frmcontactus.txt_Telephone.value) == true)

			{

				alert("Please enter valid Telephone!");

				document.frmcontactus.txt_Telephone.focus();

				return false;

			}

		}*/

		

		if(document.frmcontactus.txt_Code.value == "")

		{

			alert("Please Enter Image Code!");

			document.frmcontactus.txt_Code.focus();

			return false;

		}

	

	return true;

 }