//	alert("JS Included!!!");

function validation_form(){

	if(document.apply4feat_listing.username.value == ""){
			alert("Enter the User Name");
			document.apply4feat_listing.username.focus();
			return false;
	}
	if(!IsName(document.apply4feat_listing.username.value)){
			return false;
	}
	if(document.apply4feat_listing.prop_id.value == ""){
			alert("Enter the Property ID for Featured Listing");
			document.apply4feat_listing.prop_id.focus();
			return false;
	}
	else
	return true;
}


function validate_feat_build(){

	if(document.apply4feat_mem.username.value != ""){
		    if(!IsName(document.apply4feat_mem.username.value)){
				document.apply4feat_mem.username.focus();
				return false;
			}
	}
	if(document.apply4feat_mem.contact_name.value == ""){
			alert("Please enter contact-person name");
			document.apply4feat_mem.contact_name.focus();
			return false;
	}
	if(document.apply4feat_mem.phone.value == ""){
			alert("Please enter phone number");
			document.apply4feat_mem.phone.focus();
			return false;
	}
	if(document.apply4feat_mem.email.value == ""){
			alert("Please enter email");
			document.apply4feat_mem.email.focus();
			return false;
	}
	else
	return true;
}


function IsName(sText)
{
    var ValidChars = "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var IsName=true;
    var Char;

  for (i = 0; i < sText.length && IsName == true; i++)
    {
		Char = sText.charAt(i);
    if (ValidChars.indexOf(Char) == -1)
		{
			alert("Name Should Contain Only Alpha Numeric and (_) Values");
			IsName = false;
		}
    }
return IsName;
}

