// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function toggle_map(id,lat,lon,title,text) {
    //var map;
    
    map_div = "company_map_"+id;
    //$(map_div).morph({height:'200px'});
    
    if ($(map_div).getHeight() == 0) {
        $(map_div).morph('height: 200px');
        if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById(map_div));
            map.setCenter(new GLatLng(lat+0.01,lon),13);
            map.addOverlay(addInfoWindowToMarker(new GMarker(new GLatLng(lat,lon),{title : title}),text,{}));
            //map.setCenter(new GLatLng(lat,lon),13);
            map.addControl(new GSmallMapControl());
        }
    } 
    else {
        $(map_div).morph('height: 0px');
        $(map_div).descendants().each(function(item){item.remove()});
    }

}

function setActiveLi(object) {
	$$('ul.ajax-links a').each(function(item){item.removeClassName("active")});
	object.addClassName("active");
}