//function switchimmagine(file) {
//
//	$('fotoprincipale').innerHTML = "<img src='"+file+"'/>";
//
//}


var map;
var geocoder;
var nome = 'NBS';
var address = 'Via Larga 31, 20122 Milano, Milano (Lombardia), Italy';

function loadmappa() {
	if (address) {
		map = new GMap2(document.getElementById("mapgoogle"));
		map.setCenter(new GLatLng( 45.447161,9.155021), 2);
		map.addControl(new GSmallMapControl());
		//map.addControl(new GMapTypeControl());
		geocoder = new GClientGeocoder();
		geocoder.getLocations(address, addAddressToMap);
	}
}

function addAddressToMap(response) {
	map.clearOverlays();
	if (!response || response.Status.code != 200) {
		alert('no indirizzo')
	} else {
		place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1],
		place.Point.coordinates[0]);
		marker = new GMarker(point);
		map.setCenter(new GLatLng( place.Point.coordinates[1],place.Point.coordinates[0]), 16);
		map.addOverlay(marker);
		marker.openInfoWindowHtml('<div style="font-family:verdana; font-size:7.5pt;"><b>N.B.S.</b><br/>'+
		'Via Larga 31<br/>'+
		'Milano<br/>'+
		'</div>');
	}
}

function mostraFrecce() {

	new Effect.Opacity('frecce',
    { duration: 2.0, 
      transition: Effect.Transitions.linear, 
      from: 1.0, to: 0.5 });

	setTimeout("nascondiFrecce()",Math.random()*15000);
}
function nascondiFrecce() {

	Effect.Pulsate('frecce',
    { duration: 1.0});

	setTimeout("nascondiFrecce()",Math.random()*35000);
}