

var register = function(i,d,p) {
	Event.observe(i,'click',function(event) {
		
	});
	Event.observe(i,'mouseout',function(event) {
		this.setStyle({backgroundColor: '#e7bfb3'});
		$(d).firstDescendant().next().hide();
		$(d).removeClassName('wbg');
		$(d).setStyle({zIndex: '2'});
	});
	
	
	Event.observe(i,'mouseover',function(event) {
		// hover
		this.setStyle({backgroundColor: '#e69f97'});
		// change image
		$('image').writeAttribute({src:p});
		// show details on map
		$(d).firstDescendant().next().replace('<p>'+i+'</p>');
		$(d).addClassName('wbg');
		$(d).setStyle({zIndex: '100'});
		$(d).firstDescendant().next().show();
	});
}


var registerPlace = function(i,d,s) {
	Event.observe(i,'mouseout',function(event) {
		$(d).firstDescendant().next().hide();
		$(d).removeClassName('wbg');
		var a = $$(s);
		for (var index = 0; index < a.length; index++) {
			  a[index].setStyle({backgroundColor: '#e7bfb3'});
			                  
		}

	});
	Event.observe(i,'mouseover',function(event) {
		$(d).firstDescendant().next().replace('<p>'+i+'</p>');
		$(d).addClassName('wbg');
		$(d).firstDescendant().next().show();
		var a = $$(s);
		for (var index = 0; index < a.length; index++) {
			a[index].setStyle({backgroundColor: '#e69f97'});
		}
	});
}