$(document).ready(function(){
	$('#_fBudgetFrom_INQ').numeric({allow:"."});
	$('#_fBudgetTo_INQ').numeric({allow:"."});
	/*$('#_fBudgetTo_INQ').change(function(){
		var val = $(this).val();
		var Fval = $('#_fBudgetFrom_INQ').val();
		
		if( val !=  "" && val <= Fval && Fval != "" ) {
			$(this).val("");
			$(this)$('#_fBudgetTo_INQ').focus();
			alert("Please Enter Proper Budget - Range");
		}
	});
	$('#_fBudgetFrom_INQ').change(function(){
		var val = $(this).val();
		var Tval = $('#_fBudgetTo_INQ').val();

		if( val !=  "" && val >= Tval && Tval !="") {
			$(this).val("");
			$('#_fBudgetFrom_INQ').focus();
			alert("Please Enter Proper Budget - Range");
		}
		
	});*/
});
function validcheck(){
	if(!validcheck_changed()) {
		//$('.inqFormElement').trigger('focusout');
		return false;
	}
}
/*function nullinputelement(){
	$(".inqFormElement").each(function(element,index){
		var val = $(this).val().replace(/\s+/,"").toLowerCase();
		
		/*var rel_val = $(this).attr("rel") || "";
	
		rel_val = rel_val.replace("*","").replace(/\s+/,"");
		
		rel_val = rel_val.toLowerCase();*/
/*

		var div_val = $("#rel"+$(this).attr("id")).html() || "";
            
		div_val = div_val.replace("*","").replace(/\s+/g,"");
            
		div_val = div_val.toLowerCase();
		
		if(div_val.match(val) != null){
			$(this).val("");
		}
		
		
	});
}*/
function validcheck_changed()
{		
	with(document.Inquiry)
	{
		
		//nullinputelement();
		
		if(Trim(_vFirstName_INQ.value)=="")
		{
			alert("Please Enter First Name");
			_vFirstName_INQ.focus();
			return false;
		}
		if(Trim(_vLastName_INQ.value)=="")
		{
			alert("Please Enter Last Name");
			_vLastName_INQ.focus();
			return false;
		}
		
/*		if(Trim(_vIndustry_INQ.value)=="")
		{
			alert("Please Select Industry");
			_vIndustry_INQ.focus();
			return false;
		}
*/
		if(Trim(_vCompany_INQ.value)=="")
		{
			alert("Please Enter Company Name");
			_vCompany_INQ.focus();
			return false;
		}
		
		
		if(Trim(_vEmail_INQ.value)=="")
		{
			alert("Please Enter Email");
			_vEmail_INQ.focus();
			return false;
		}
		if (!isValidEmail(_vEmail_INQ.value))
		{	
			_vEmail_INQ.focus();
			return false;	
		}
		if(Trim(_vCity_INQ.value)=="")
		{
			alert("Please Enter City Name");
			_vCity_INQ.focus();
			return false;
		}
		if(_vCountry_INQ.selectedIndex ==0)
		{
			alert("Please Select Country Name From List");
			_vCountry_INQ.focus();
			return false;
		}
		if(Trim(_vPhone_INQ.value)=="")
		{
			alert("Please Enter Phone");
			_vPhone_INQ.focus();
			return false;
		}
		
		if(!(isPhoneNumber(Trim(_vPhone_INQ.value))))
		{
			alert("Please provide your valid Phone No.");
			_vPhone_INQ.focus();
			return false;
		}
		
		if($('.vServiceCheckbox:checked').length <= 0 ){
			alert("Please Select At Least One Service");
			return false;
		}
		if($('.vDevelopmentModelCheckbox:checked').length <= 0 ){
			alert("Please Select At Least One Work Model");
			return false;
		}
		
		if(Trim(_vDescription_INQ.value)=="")
		{
			alert("Please Enter Project Description");
			_vDescription_INQ.focus();
			return false;
		}
		/*
		if(!number(_vPhone_INQ.value,_vPhone_INQ.value.length))
		{
			alert("Please Enter Valid Phone Number");
			_vPhone_INQ.focus();
			return false;
		}
		*/
		if(Trim(recaptcha_response_field.value)=="")
		{
			alert("Please enter the verification code");
			recaptcha_response_field.focus();
			return false;	
		}
		/*
		if(Trim(_vCapt_INQ.value).length<5)
		{
			//alert("Please enter the excatly 5 letter verification code i.e. shown in image.");
			alert("Verification Code is not Valid ! Please Try Again");
			_vCapt_INQ.focus();
			return false;
		}*/
	}
	/*if(!CheckValidationText()){
		$('.inqFormElement').trigger('focusout');
	};*/
	return true;
}	

/*function CheckValidationText()
{ 
	var vText;
	if(document.Inquiry._vCapt_INQ)
		vText = Trim(document.Inquiry._vCapt_INQ.value);
	else
		vText = "";
	
	//alert("aaa"+vText+"aaa");
	var url = "checkcaptcha.html?paraValid="+vText;
	//alert(url);
	
	if (window.XMLHttpRequest)
  	{
  		http=new XMLHttpRequest()
  		http.open("GET",url,true)
	  	http.onreadystatechange=function (){
			if (http.readyState == 4) 
			{	
    	  		isWorking = false;
    			if (http.responseText.indexOf('invalid') == -1) 
				{
					var xmlDocument = http.responseXML;
					var existId = xmlDocument.getElementsByTagName('msg').item(0).firstChild.data;
					if(existId == "0"){
						alert("Verification Code is not Valid ! Please Try Again");
						document.Inquiry._vCapt_INQ.focus();
						return false;
					}
					else
					{
						document.Inquiry.submit();
					}	
						
				}
			}
		}
	  	http.send(null)
  	}
	// code for IE
	else if (window.ActiveXObject)
  	{
  		http=new ActiveXObject("Microsoft.XMLHTTP")
    	if (http)
    	{
    		http.open("GET",url,true)
    		http.onreadystatechange=function (){
				if (http.readyState == 4) 
				{	
    		  		isWorking = false;
    				if (http.responseText.indexOf('invalid') == -1) 
					{
						var xmlDocument = http.responseXML; 
						var existId  = xmlDocument.getElementsByTagName('msg').item(0).firstChild.data;
						if(existId == "0")
						{
							alert("Verification Code is not Valid ! Please Try Again");
							document.Inquiry._vCapt_INQ.focus();
							return false;
						}
						else
						{
							$(".empty").attr("disabled","disabled");
							document.Inquiry.submit();
						}	
						
					}
					
				}
			}	
    		http.send()
    	}
  	}
}*/

