//function to hide scalebar and controls, and show them again
function switchMapControls(switchon) {
	if (switchon) {
		// Add map type control  
		map.addTypeControl();  

		// Add map zoom (long) control  
		map.addZoomLong();  

		// Add the Pan Control  
		map.addPanControl();  
	} else {
		// remove map type control  
		map.removeTypeControl();  

		// remove map zoom (long) control  
		map.removeZoomLong();  

		// remove the Pan Control  
		map.removePanControl();  
	}
	
}

function getImageByType(type) {
	myImage = new YImage();
	   
	myImage.size = new YSize(12,20);
	myImage.offset = new YCoordPoint(-3,0);
	myImage.offsetSmartWindow = new YCoordPoint(0,0);
	if (type == "gig") {
		 myImage.src = 'images/map/mm_20_red.png';
	} else if (type = "festival") {
		 myImage.src = 'images/map/mm_20_blue.png';
	}
}


function onSmartWinEvent(e) {
	var currentLabel = locations[e.thisObj.id].location;
	var infoText = locations[e.thisObj.id].was +" "+ locations[e.thisObj.id].info +"<br>"+
		locations[e.thisObj.id].location +"<br>"+ locations[e.thisObj.id].adresse +"<br>"+
		locations[e.thisObj.id].datum +", "+ locations[e.thisObj.id].uhrzeit;

	//markers[e.thisObj.id].openSmartWindow("<span class='infotext'>" +
		//"<a href=\"#\" onclick=\"javascript:alert('"+ infoText +"')\">"+ currentLabel +"</a></span>");

  markers[e.thisObj.id].openSmartWindow("<span class=\'map_info\'><b>"+ locations[e.thisObj.id].datum +"</b><br>"+ locations[i].location +"</span>");
}