$(function()
{
  $('body.home div.flash').flash({
    src: '/flash/slide.swf',
    width: 915,
    height: 217
  });

  $('body.contatti div.flash').flash({
    src: '/flash/contact.swf',
    width: 915,
    height: 472
  });

  $('body.azienda div.flash').flash({
    src: '/flash/azienda.swf',
    width: 530,
    height: 300
  });

  $('body.prodotto div.data img.imgTn').bind('click',function(){$('body.prodotto div.data img.imgMedium').attr('src',$(this).attr('src').replace('_tn','_medium'));});

  if($('#dBody').attr('class')=='dove')
  {
    showMap();
    $("#dBody").bind('unload',GUnload);
  }
});

var map;

function showMap()
{
  if (GBrowserIsCompatible())
  {
    map = new GMap2(document.getElementById("map"));
    map.setUIToDefault();
    geocoder = new GClientGeocoder();
    geocoder.getLocations('Via Calcara, 36030 Monte Di Malo (VI)', addToMap);
  }
}

function addToMap(response)
{
  place = response.Placemark[0];
  point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
  map.setCenter(point, 13);
  marker = new GMarker(point);
  map.addOverlay(marker);
}
