$(document).ready(function(){
 
//AUTO COLLAPSE'S TOGGLED ELEMENT
$("p.update_content_text").hide();
//$(".news_content_text").hide();
var pageUrl = "loader.php?o=2&a=6";
$(".live_details").load(pageUrl, function() {
initialize();
showAddress($(".live_details_map").attr("title"));
});


//CHANGES THE BUTTON FROM OPEN TO CLOSED AND VIS-VERSA
$(".update_content_title").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});
 
//SLIDES CONTAINER UP AND DOWN ON CLICK
$(".update_content_title").click(function(){
$(this).next(".update_content_text").slideToggle("normal");
});

//TOGGLE TITLE STYLE ON HOVER
$(".update_content_title a").hover(
function () {
$(this).addClass("update_date_hover");
}, 
function () {
$(this).removeClass("update_date_hover");
});

 
});

var map = null;
var geocoder = null;

function initialize() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("gmap"));
    geocoder = new GClientGeocoder();
  }
}

function showAddress(address) {
  if (geocoder) {
    geocoder.getLatLng(
      address,
      function(point) {
        if (!point) {
          alert(address + " not found");
        } else {
          map.setCenter(point, 15);
          map.setUIToDefault();
          var marker = new GMarker(point);
          map.addOverlay(marker);
          //marker.openInfoWindowHtml(address);
        }
      }
    );
  }
}


