function clearZip(textbox){
    if (textbox.value == "Enter zip code"){
            textbox.value = "";
    }
}

function checkSearchCriteria(form){
    var zip = trim(form.zipCode.value);

    if (!string_charset_check(zip, CS_NUMERIC, "") || !check_exact_len(zip,5))
    {
        alert("Please enter a valid zipcode");
        return false;
    }
    //re-assigning the trimmed value
    form.zipCode.value = zip;
    return true;
}

function submitSearchResults(pageId,action){
    action = trim(action);
    if (action == 'next')
    {
        pageId = pageId+1;
    }
    else if (action == 'prev')
    {
        pageId = pageId-1;
    }
    document.addressForm.action = "/stores/search?pageId="+pageId;
    document.addressForm.submit();
}
