function go(select)
{
    if (select.selectedIndex != 0)
    {
        var value = select.options[select.selectedIndex].value;
        select.selectedIndex = 0;
        self.location = value;
    }
}

function init()
{

    // ensure browser supports Maps
    if (!GBrowserIsCompatible())
    {
        return;
    }

    // ensure container exists
    if (!document.getElementById("map"))
    {
        return;
    }

    // instantiate map
    var map = new GMap2(document.getElementById("map"));
                    
    // center map on campus
    map.setCenter(new GLatLng(42.375222, -71.1183), 14);

    // TODO
    GEvent.addListener(map, "click", function() { alert("GPS coming (back) soon!"); });
    GEvent.addListener(map, "drag", function() { alert("GPS coming (back) soon!"); });

}

function validate(f)
{
    if (f.name.value == "" || f.name.value == "Full Name")
    {
        alert("You must provide your full name.");
        return false;
    }
    else if (f.email.value == "" || f.email.value == "Harvard Email Address")
    {
        alert("You must provide your email address.");
        return false;
    }
    else if (f.address.value == "" || f.address.value == "Campus Mail Center Address")
    {
        alert("You must provide your campus mail center address.");
        return false;
    }
    else if (!f.quad.checked && !f.river.checked)
    {
        alert("You must check off the edition(s) you want.");
        return false;
    }
    return true;
}
