(function(){var showing_full_ui=false;function resize_viewer(){var window_width=$(window).width()-$('#info-pane').width();var window_height=$(window).height()-135;$('#viewer').height(Math.max(400,window_height)).width(Math.max(700,window_width-2))
$('#info-pane').height(Math.max(400,window_height));}
var current_map=null;function newLocation(latlong,object){if(!showing_full_ui){$('#content').css({marginTop:'0'});$('#widepage .spacer').css({height:'3em'});$('#dashboard').hide();$('#starting-line').hide();$('#headerbar').append('<div id="headersearch">'+'<form class="near_form" onsubmit="return false;">'+'<div class="near"><label for="maps_near">Move somewhere else: </label><input class="text" type="text" name="maps_near" size="40" /><input class="button" type="submit" name="near_action" value="go" /></div>'+'<div class="result"></div>'+'</form>'+'</div>');var picker=new Fur.Control.PickLocation('#headersearch .near_form','#headersearch .near_form .text','#headersearch .near_form .result',newLocation);}else{$('#headersearch .near_form .text').val('');}
if(current_map){current_map.reset();current_map._dead=true;}
var map=new Fur.MapViewer({canvas:'viewer',no_maps:'#info-pane .no-maps',map_list_parent:'#info-pane .map-list',map_list:'#info-pane .map-list .list',cloud_view:'#info-pane .cloud-view',selection:'#info-pane .selection',selection_info:'#info-pane .selection .info',map_info:'#info-pane .map-info',type_ahead:'#info-pane .map-list .filter .text',dropdown:'#info-pane .map-list .filter .dropdown'});current_map=map;if(!showing_full_ui){$('#viewer_wrapper').show();showing_full_ui=true;}
resize_viewer();resize_viewer();if(null!=object){var latlonbox=object.Placemark[0].ExtendedData.LatLonBox;var bounds=new OpenLayers.Bounds(latlonbox.west,latlonbox.south,latlonbox.east,latlonbox.north);map.initWithBounds(bounds);}else{map.initWithLatLon(latlong);}}
var picker=new Fur.Control.PickLocation('#search .near_form','#search .near_form .text','#search .near_form .result',newLocation);$('#search .loki a').click(function(event){$('#search .loki_result').html('Hang in there, we\'re loadin\' loki...').css({backgroundColor:Fur.ColourPalette.Success,opacity:'1'}).animate({opacity:'0'},4000);var loki=LokiAPI();loki.onSuccess=function(location){var lonlat=new OpenLayers.LonLat(location.longitude,location.latitude);newLocation(lonlat,null);$('#search .loki_result').empty();};loki.onFailure=function(error){$('#search .loki_result').html('Bummer, something isn\'t letting us find your location.').css({backgroundColor:Fur.ColourPalette.Error,opacity:'1'});};loki.setKey('cartografur.com/');loki.requestLocation(true,loki.NO_STREET_ADDRESS_LOOKUP);});$('#graduates .names .name').each(function(){$(this).click(function(){picker.set_location($(this).text()).submit();});});$(window).resize(function(){resize_viewer();resize_viewer();});})();