function valid_Booking_Agent()
{
	if (emptyField(document.getElementById("txtFName")))
	{
		alert('Please enter First Name');
		return false;
	}
	
	if (emptyField(document.getElementById("txtEMail")))
	{
		alert('Please enter Email');
		return false;
	}

	if (!emailid_format(document.getElementById("txtEMail").value))
	{
		alert('Please enter Proper Email');
		document.getElementById("txtEMail").select();
		document.getElementById("txtEMail").focus();
		return false;
	}
	
	if (document.getElementById("ddlCountry").value == 0)
	{
		alert('Please select Country');
		document.getElementById("ddlCountry").focus();
		return false;
	}
	
	if (document.getElementById("ddlcity").value == 0)
	{
		if (emptyField(document.getElementById("txtOtherCity")))
		{
			alert('Please enter city Name');
			return false;
		}
	}
	
	if (! valid_city())
	{
		alert('City Name already exist in the List');
		document.getElementById("txtOtherCity").focus();
		document.getElementById("txtOtherCity").select();
		return false;
	}	

	if (emptyField(document.getElementById("txtUId")))
	{
		alert('Please enter User ID');
		return false;
	}
	
	if (emptyField(document.getElementById("txtPassword")))
	{
		alert('Please enter Password');
		return false;
	}
	else
	{
		if (!isAlphaNumericPassword(document.getElementById("txtPassword").value,4,16))	
		{
			alert('Password must contain atleast 1 char and 1 number [min 4 char / max 16 char]');
			document.getElementById("txtPassword").select();
			document.getElementById("txtPassword").focus();
			return false;
		}
	}
	
	if (emptyField(document.getElementById("txtconpass")))
	{
		alert('Please enter Confirm Password');
		return false;
	}
	//alert(document.getElementById("txtPassword").value);
	//alert(document.getElementById("txtconpass").value);
	if (document.getElementById("txtPassword").value != document.getElementById("txtconpass").value)
	{
		alert('Password and Confirm Password are Must Be Same');
		return false;
	}
	
	/*if (emptyField(document.getElementById("txtBizName")))
	{
		alert('Please enter Business Name');
		return false;
	}
	if (emptyField(document.getElementById("txtWebSite")))
	{
		alert('Please enter Website');
		return false;
	}
	if (emptyField(document.getElementById("txtIntro")))
	{
		alert('Please enter Introduction');
		return false;
	}*/
	/*if (emptyField(document.getElementById("txtpercentage")))
	{
		alert('Please enter Percentage');
		return false;
	}

	if (!isNum(document.getElementById("txtpercentage").value))
	{
		alert('Percentage Must Be Numeric');
		return false;
	}

			if (!isNum(document.getElementById("txtDeposite").value))
	//			{
	//				alert('Deposite Must Be Numeric');
	//				return false;
	//			}

	if (!isNum(document.getElementById("txtMinStay").value))
	{
		alert('Deposite Must Be Numeric');
		return false;
	}
	if (!isNum(document.getElementById("txtDiscount").value))
	{
		alert('Discount Must Be Numeric');
		return false;
	}
	if (!isNum(document.getElementById("txtStart").value))
	{
		alert('Range value Must Be Numeric');
		return false;
	}
	if (!isNum(document.getElementById("txtEnd").value))
	{
		alert('Range value Must Be Numeric');
		return false;
	}*/
	return true;
}

function valid_landlord()
{
	if (emptyField(document.getElementById("txtfirstname")))
	{
		alert('Please enter First Name');
		return false;
	}
	
	if (document.getElementById("ddlCountry").value == 0)
	{
		alert('Please select Country');
		document.getElementById("ddlCountry").focus();
		return false;
	}

	if (emptyField(document.getElementById("txtemail")))
	{
		alert('Please enter Email');
		document.getElementById("txtemail").select();
		return false;
	}
	
	if (document.getElementById("ddlcity").value == 0)
	{
		if (emptyField(document.getElementById("txtOtherCity")))
		{
			alert('Please enter city Name');
			return false;
		}
	}
	
	if (! valid_city())
	{
		alert('City Name already exist in the List');
		document.getElementById("txtOtherCity").focus();
		document.getElementById("txtOtherCity").select();
		return false;
	}

	if (!emailid_format(document.getElementById("txtemail").value))
	{
		alert('Please enter Proper Email');
		document.getElementById("txtemail").select();
		document.getElementById("txtemail").focus();
		return false;
	}
	if (emptyField(document.getElementById("txtuid")))
	{
		alert('Please enter User ID');
		return false;
	}
	if (emptyField(document.getElementById("txtpwd")))
	{
		alert('Please enter Password');
		return false;
	}
	else
	{
		if (!isAlphaNumericPassword(document.getElementById("txtpwd").value,4,16))	
		{
			alert('Password must contain atleast 1 char and 1 number [min 4 char / max 16 char]');
			document.getElementById("txtpwd").select();
			document.getElementById("txtpwd").focus();
			return false;
		}
	}
	
	if (emptyField(document.getElementById("txtconpass")))
	{
		alert('Please enter Confirm Password');
		return false;
	}
	//alert(document.getElementById("txtPassword").value);
	//alert(document.getElementById("txtconpass").value);
	if (document.getElementById("txtpwd").value != document.getElementById("txtconpass").value)
	{
		alert('Password and Confirm Password are Must Be Same');
		return false;
	}
	
	/*if (emptyField(document.getElementById("txtbusiness")))
	{
		alert('Please enter Business Name');
		return false;
	}
	if (emptyField(document.getElementById("txtWebSite")))
	{
		alert('Please enter Website');
		return false;
	}
	if (emptyField(document.getElementById("txtintro")))
	{
		alert('Please enter Introduction');
		return false;
	}*/
	/*if (emptyField(document.getElementById("txtpercentage")))
	{
		alert('Please enter Percentage');
		return false;
	}

	if (!isNum(document.getElementById("txtpercentage").value))
	{
		alert('Percentage Must Be Numeric');
		return false;
	}

			if (!isNum(document.getElementById("txtDeposite").value))
	//			{
	//				alert('Deposite Must Be Numeric');
	//				return false;
	//			}

	if (!isNum(document.getElementById("txtMinStay").value))
	{
		alert('Deposite Must Be Numeric');
		return false;
	}
	if (!isNum(document.getElementById("txtDiscount").value))
	{
		alert('Discount Must Be Numeric');
		return false;
	}
	if (!isNum(document.getElementById("txtStart").value))
	{
		alert('Range value Must Be Numeric');
		return false;
	}
	if (!isNum(document.getElementById("txtEnd").value))
	{
		alert('Range value Must Be Numeric');
		return false;
	}*/
	return true;
}

function check_city()
{
	if (document.getElementById("ddlcity").value == 0)
	{
		document.getElementById("txtOtherCity").disabled = false;
	}
	else
	{
		document.getElementById("txtOtherCity").value = "";
		document.getElementById("txtOtherCity").disabled = true;
	}
}

function valid_city()
{
	for (var i=0; i<document.getElementById("ddlcity").length; i++)
	{
		if (document.getElementById("ddlcity").options[i].text.toLowerCase() == document.getElementById("txtOtherCity").value.toLowerCase())
		{
			return false;
		}
	}
	return true;
}