    window.onload = function() {
        get('id_request').focus();
    }

    function do_search(template_name) {
        var req = new String(get('id_request').value);
        var loc = new String(get('id_location').value);
        req = req.replace(/ /g, '_');
        req = req.replace(/\//g, '');
        loc = loc.replace(/ /g, '_');
        loc = loc.replace(/\//g, '');
        if(req && loc) {
            document.location.href = '/'+ template_name +'/search/'+ req +'/'+ loc;
        } else if(req) {
            document.location.href = '/'+ template_name +'/search/'+ req;
        }
    }

    function do_map_search() {
        var req = new String(get('id_request').value);
        var loc = new String(get('id_location').value);
        req = req.replace(/ /g, '_');
        req = req.replace(/\//g, '');
        loc = loc.replace(/ /g, '_');
        loc = loc.replace(/\//g, '');
        fetchMarkers(req, loc, null);
    }

    function add_request(str) {
        get('id_request').value = str;
        get('id_request').focus();
        return false;
    }

    function add_location(str) {
        get('id_location').value = str;
        get('id_location').focus();
        return false;
    }
