function filterList() {
    $get("FilterForm").onsubmit({ preventDefault: function() { } });
    AddPoints();
    return true;
}
function addPoint(Latitude, Longitude, FullAddress, Name, Alias, Url, Profile, ProfilesUrl, index, LocationName) {
    var point = new GLatLng(Latitude, Longitude);
    
    var baseIcon = new GIcon(G_DEFAULT_ICON); baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png"; baseIcon.iconSize = new GSize(20, 34); baseIcon.shadowSize = new GSize(37, 34); baseIcon.iconAnchor = new GPoint(9, 34); baseIcon.infoWindowAnchor = new GPoint(9, 2);
    var letteredIcon = new GIcon(baseIcon);
    if (index === undefined || index === "" || index== null ) {
        letteredIcon.image = "http://www.google.com/mapfiles/marker.png";
        
    }
    else {
        var letter = String.fromCharCode("A".charCodeAt(0) + index);
        letteredIcon.image = "http://www.google.com/mapfiles/marker" + letter + ".png";
    }
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    
    if (Profile) {
        GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml("<strong>" + Name + "</strong><br />" + FullAddress + "<br />"
    + "<a href=\"http://" + Url + "\">Visit website</a>"
    + "&nbsp;&nbsp;&nbsp;<a href=\"" + ProfilesUrl + Alias + "/directions/" + LocationName + "\">Get directions</a>");
        });
    } else {
        GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml("<strong><a href=\"" + ProfilesUrl + Alias + "/" + LocationName + "\">" + Name + "</a></strong><br />" + FullAddress + "<br />"
    + "<a onClick=\"javascript: pageTracker._trackPageview('/track/referral/" + Alias + "');\" href=\"http://" + Url + "\">Visit website</a>"
    + "&nbsp;&nbsp;&nbsp;<a href=\"" + ProfilesUrl + Alias + "/directions/" + LocationName +"\">Get directions</a>");
        })
    }
    map.addOverlay(marker);

}
function goToPage(uniqId, pageId, rowsPerPage) {
    var i = 0;
    var rows = document.getElementById(uniqId + '_Table').getElementsByTagName('tr');
    for (i = 1; i < rows.length; i++) {
        rows[i].setAttribute("class", "hide");
    }
    for (i = (pageId - 1) * rowsPerPage +1; i < pageId * rowsPerPage +1 && i < rows.length; i++) {
        rows[i].setAttribute("class", "");
    }
    var pages = document.getElementById(uniqId + '_Paging').getElementsByTagName('a');
    for (i = 0; i < pages.length; i++) {
        pages[i].setAttribute("class", "");
    }
    document.getElementById(uniqId + '_page' + pageId).setAttribute("class", "quiet");
}

function showAddress(Latitude, Longitude, FullAddress, Name, Alias, Url, Profile, ProfilesUrl, LocationName) {
    var point = new GLatLng(Latitude, Longitude);
    var marker = new GMarker(point);
    map.setCenter(new GLatLng(Latitude, Longitude), 11);
    if (Profile) {
        var myHtml = "<strong>" + Name + "</strong><br />" + FullAddress + "<br />" + "<a onClick=\"javascript: pageTracker._trackPageview('/track/referral/" + Alias + "');\" href=\"http://" + Url + "\">Visit website</a>"
    + "&nbsp;&nbsp;&nbsp;<a href=\"" + ProfilesUrl + Alias + "/directions/" + LocationName + "\">Get directions</a>";
    } else {
    var myHtml = "<strong><a href=\"" + ProfilesUrl + Alias + "/" + LocationName + "\">" + Name + "</a></strong><br />" + FullAddress + "<br />" + "<a onClick=\"javascript: pageTracker._trackPageview('/track/referral/" + Alias + "');\" href=\"http://" + Url + "\">Visit website</a>"
    + "&nbsp;&nbsp;&nbsp;<a href=\"" + ProfilesUrl + Alias + "/directions/" + LocationName + "\">Get directions</a>";
    }
    map.openInfoWindowHtml(point, myHtml);
}
function showAddressByArgs(args) {
    var point = new GLatLng(this.getAttribute("Latitude"), this.getAttribute("Longitude"));
    var marker = new GMarker(point);
    var ProfilesUrl = this.getAttribute("ProfilesUrl");
    var i = 0;
    var locations = document.getElementById("location-names").getElementsByTagName("a");
    for (i = 0; i < locations.length; i++) {
        locations.item(i).setAttribute('class', '')
    }
    this.setAttribute('class', 'active');
    map.setCenter(new GLatLng(this.getAttribute("Latitude"), this.getAttribute("Longitude")), 11);
    var myHtml = "<strong>" + this.getAttribute("Name") + "</strong><br />" + this.getAttribute("FullAddress") + "<br />" + "<a onClick=\"javascript: pageTracker._trackPageview('/track/referral/" + this.getAttribute("Alias") + "');\" href=\"http://" + this.getAttribute("Url") + "\">Visit website</a>"
    + "&nbsp;&nbsp;&nbsp;<a href=\"" + ProfilesUrl + this.getAttribute("Alias") + "/directions\">Get directions</a>";
    map.openInfoWindowHtml(point, myHtml);
}
