


function testLocationInput(){
    var NoBlank = true;
    if (document.formLocationSearch.GeoRegion.value == "0" && NoBlank) {
        alert('Please Select a Region');
        document.formLocationSearch.GeoRegion.focus();
        NoBlank = false;
    }
    if (document.formLocationSearch.GeoAreaCity.value == "" && NoBlank) {
        alert('Please Select a Area/City');
        document.formLocationSearch.GeoAreaCity.focus();
        NoBlank = false;
    }
    if (document.formLocationSearch.GeoTownSuburb.value == "" && NoBlank) {
        alert('Please Select a Town');
        document.formLocationSearch.GeoTownSuburb.focus();
        NoBlank = false;
    }
    if (document.formLocationSearch.ListingSubCategory.value == "" && NoBlank) {
        alert('Please Select a Category');
        document.formLocationSearch.ListingSubCategory.focus();
        NoBlank = false;
    }
    return (NoBlank);
}

function testActivityInput(){
    var NoBlank = true;
    if (document.formActivitySearch.ListingSubCategory.value == "0" && NoBlank) {
        alert('Please Select an Activity');
        document.formActivitySearch.ListingSubCategory.focus();
        NoBlank = false;
    }
    return (NoBlank);
}

function testKeywordInput(){
    var NoBlank = true;
    if (((document.formKeywordSearch.Keyword.value == "")||(document.formKeywordSearch.Keyword.value == "Keyword")) && NoBlank) {
        alert('Please type a word');
        document.formKeywordSearch.Keyword.focus();
        NoBlank = false;
    }
    return (NoBlank);
}

function checkEmail(vInput){
    var NoBlank = true;
    CharCount = 1;
    strLength = vInput.length;
    while (((CharCount < strLength) && (vInput.charAt(CharCount) != "@")) && NoBlank) {
        CharCount++
    }
    if (((CharCount >= strLength) || (vInput.charAt(CharCount) != "@")) && NoBlank) {
        alert("Not a valid email address")
        NoBlank = false;
    }
    else {
        CharCount += 2;
    }
    while (((CharCount < strLength) && (vInput.charAt(CharCount) != ".")) && NoBlank) {
        CharCount++
    }
    if (((CharCount >= strLength - 1) || (vInput.charAt(CharCount) != ".")) && NoBlank) {
        alert("Not a valid email address")
        NoBlank = false;
    }
    return NoBlank
}


