//--------------------------Contact form--------------------------
function validate_contact_info(form){	
	if(isEmpty(form.txtfname))
	{ 
		alert("Please enter your first name");
		form.txtfname.focus();
		return false; 
	}
	/*if(!isAlpha(form.txtfname))
	{ 
		alert("Please enter your valid first name");
		form.txtfname.focus();
		return false; 
	}
	if(form.txtfname.value==""){
		alert("Please enter your first name");
		form.txtfname.focus();
		return false;
	}

	if(isEmpty(form.txtaddr))
	{ 
		alert("Please enter your address");
		form.txtaddr.focus();
		return false; 
	}
*/
	if(form.city.value==""){
		alert("Please choose your city");
		form.city.focus();
		return false;
	}
	if(form.city.value=="Others")
	{
		if(isEmpty(form.other_city))
		{ 
			alert("Please enter your city");
			form.other_city.focus();
			return false; 
		}
	}
	if(form.state.value==""){
		alert("Please choose your state");
		form.state.focus();
		return false;
	}
	if(form.state.value=="Others")
	{
		if(isEmpty(form.other_state))
		{ 
			alert("Please enter your state");
			form.other_state.focus();
			return false; 
		}
	}
	/*
	if(isEmpty(form.txtphone))
	{ 
		alert("Please enter your phone number");
		form.txtphone.focus();
		return false; 
	}
	if(!isPhone(form.txtphone))
	{ 
		alert("Please enter your valid phone number");
		form.txtphone.focus();
		return false; 
	}*/
	
	if(form.txtemail.value==""){
		alert("Please enter your email id");
		form.txtemail.focus();
		return false;
		}else{
		if(!isValidEmail(form.txtemail)){alert(form.txtemail.value + " is not a valid Email ID");form.txtemail.focus();
		return false;}		

	}
}
//------------------------------------------------------------------------------

function blockNonNumbers(obj, e, allowDecimal, allowNegative)
	{
		var key;
		var isCtrl = false;
		var keychar;
		var reg;

		if(window.event) {
			key = e.keyCode;
			isCtrl = window.event.ctrlKey
		}
		else if(e.which) {
			key = e.which;
			isCtrl = e.ctrlKey;
		}

		if (isNaN(key)) return true;
		keychar = String.fromCharCode(key);

		// check for backspace or delete, or if Ctrl was pressed
		if (key == 8 || isCtrl)
		{
			return true;
		}

		reg = /\d/;
		var isFirstN = allowNegative ? keychar == '-' : false;
		//var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
		
		//return isFirstN || isFirstD || reg.test(keychar);
		return isFirstN || reg.test(keychar);
	}



//----------------------------------- Ask an Expert ----------------------------
function validate_info(form){	
	if(isEmpty(form.fname))
	{ 
		alert("Please enter your first name");
		form.fname.focus();
		return false; 
	}
	
	if(form.email.value==""){
		alert("Please enter your email id");
		form.email.focus();
		return false;
		}else{
		if(!isValidEmail(form.email)){alert(form.email.value + " is not a valid Email ID");form.email.focus();
		return false;}		

	}
	if(form.your_problem.value==""){
		alert("Please choose related to your problem");
		form.your_problem.focus();
		return false;
	}	
	
}