
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - reb-config.js - */
// http://facilities.choosehelp.com/portal_javascripts/reb-config.js?original=1


/* - ++resource++realestatebroker.js - */
// http://facilities.choosehelp.com/portal_javascripts/++resource++realestatebroker.js?original=1
function updateMap(event){if(!event)var event=window.event;var latitude=cssQuery("input#geolocation_latitude")[0];var longitude=cssQuery("input#geolocation_longitude")[0];if(latitude.value!="0.0"&&longitude.value!="0.0"){return false};var _4=mapsConfig;var _3=reb_country;var _1=_4.google;var street=cssQuery('input#title');var state=cssQuery('select#state');var address=street[0].value+", "+state[0].value+", "+_3;var location=cssQuery('div.locationString')[0];var map_node=cssQuery('div.googleMapPane')[0];var _2=function(){var place=_0.results[0];if(place){latitude.value=place.lat;longitude.value=place.lng;location.innerHTML=place.lat+", "+place.lng;var map=new GMap2(map_node);var center=new GLatLng(parseFloat(latitude.value),parseFloat(longitude.value));map.setCenter(center,_1.initialzoomlevel,G_HYBRID_MAP);map.addControl(new GLargeMapControl());if(_1.selectablemaptypes){map.addControl(new GMapTypeControl())}var m=new GMarker(center,{draggable:true});map.addOverlay(m);GEvent.addListener(m,"dragend",function(){var point=m.getPoint();latitude.value=point.lat();longitude.value=point.lng();l.innerHTML=point.lat()+", "+point.lng()});GEvent.addListener(map,"click",function(overlay,point){if(!overlay){m.setPoint(point);latitude.value=point.lat();longitude.value=point.lng();location.innerHTML=point.lat()+", "+point.lng()}})}};_0=new GlocalSearch();_0.setSearchCompleteCallback(null,_2);_0.execute(address)};function activateMapUpdater(){var tabs=cssQuery('li.formTab');if(tabs[0]==undefined){return false}var idx=tabs.length-1;var location_tab=tabs[idx];location_tab.onclick=updateMap}registerPloneFunction(activateMapUpdater);
