    function init() {
        // not rendered until display is visible
        //prepareSliders();

        // if its an input page
        if (document.form.locationText)
            document.form.locationText.focus();
    }

    addOnload(init);


    function showUserSelector() {
        var entityType = document.form.userEntityType.value;
        openWindow('/Search?event=display&mode=selector&popup=true&entityType='+entityType,700,600);
    }
    function removeUser() {
        document.form.author.value='';
    }
    function userSelected(username) {
        document.form.author.value=username;
    }

    function showGroupSelector() {
        var url = "/UserGroups?event=displayList&popup=true&mode=selector";
        openWindow(url);
    }
    function groupSelected(groupId, groupName) {
        document.form.group.value = groupId;    
        document.form.groupText.value = groupName;    
    }
    function removeGroup() {
        groupSelected('','');
    }

    function removeSearchText() {
        document.form.searchText.value = '';
    }

    function makeActive() {
        window.opener.document.form.activeContentText.value = 'Profile Changed';
    }

    // called in UserSearch Selector popup
    function itemSelected(id, name, href) {
        document.form.author.value = name;
    }

    function clearRatings() {
        var fields = document.getElementsByTagName("input");
        for (var j=0; j < fields.length; j++) {
            if (fields[j].type == 'radio')
                fields[j].checked = false;
        }
    }

    function goBackToSearch() {
        if (document.form.mode.value == 'mainView') {
            window.location = document.form.returnToUrl.value;
        } else {
            var url = "/Search?event=display";
            if (document.form.mode)
                url += "&mode=" + document.form.mode.value;
            if (document.form.popup)
                url += "&popup=" + document.form.popup.value;
            window.location = url;
        }
    }

    function selectResult(a) {
        if ((document.form.mode.value == 'selector') && window.opener.itemSelected) {
            var values = a.name.split(",");
            window.opener.itemSelected(values[0], decode(values[1]), a.href, this);
            return false;
        } else
            return true;
    }

    // for SimpleForm.html
    function doSearch() {
        if (!locationSelector.isValid())
            return false;
        document.getElementById("searchButton").onclick();
        return true;
    }


    function addCity() {
        var url = "/Locations?event=addCity&popup=true";
        openWindow(url, 500, 400);
    }

    function locationAdded(id, name) {
        window.location = window.location;
    }

/*
    var map;
    var mapOpen = false;

    function initMap() {
        var mapNode = document.getElementById("map");
        flipMap();
        if (mapNode) {
            map = new GMap(mapNode);
            centerPoint = new GPoint(0,10);
            map.centerAndZoom(centerPoint, 17);
            GEvent.addListener(map, "moveend", moveEnd);
            map.addControl(new GSmallMapControl());
            map.addControl(new GMapTypeControl());
            map.setMapType(G_HYBRID_TYPE);

        if (document.body.addEventListener)
            document.getElementById("map").addEventListener('DOMMouseScroll', function(oEvent) { zoomIn(oEvent, oEvent.detail * 40); }, false);
        else
            document.getElementById("map").onmousewheel = function() { zoomIn(event, -1 * event.wheelDelta); return false; }
        }
    }

    //addOnload(initMap);

    function flipMap() {
        var mapNode = document.getElementById("map");
        if (mapOpen)
            mapNode.style.display = "none";
        else
            mapNode.style.display = "";
        mapOpen = !mapOpen;
    }

    function zoomIn(oEvent, scr) {
        if (scr >= 120)
            zoomAdjustment = map.getZoomLevel() + 1;
        else
            zoomAdjustment = map.getZoomLevel() - 1;
        if (zoomAdjustment > 0 && zoomAdjustment < 17)
            map.zoomTo(zoomAdjustment);

        if (oEvent.preventDefault)
            oEvent.preventDefault();
    }

    function moveEnd() {
        centerPoint = map.getCenterLatLng();
    }

    function deinit() {
        GUnload();
    }

    window.unload = deinit;

*/
