function getInfo(str, name) {	
	var html = '';
	var imgSrc = str;
	imgSrc = imgSrc.replace(/ /g, '');
	imgSrc = imgSrc.replace(/\./g, '-');
	imgSrc = imgSrc.replace(/\//g, '-');
	/*
	var replace = new Array(' ', '\.', '\/');
	var by = new Array('', '-', '-');
	for (var i=0; i<replace.length; i++) {
		imgSrc = imgSrc.replace(replace[i], by[i]);
	}
	*/
	if (name == 'tooltip') {
		html = '<h4>'+str+'</h4><img src="../images/hallenplan/'+imgSrc.toLowerCase()+'.gif" alt="'+str+'" />';
	} else if(name == 'special') {
		html = '<img src="../images/hallenplan/'+imgSrc.toLowerCase()+'.gif" alt="'+str+'" />';
	} else {
		html = '<h4>'+str+'</h4>';
	}
	return html;
} 

function simple_tooltip(target_items, name){
	$(target_items).each(function(i){
		$("body").append("<div class='"+name+"' id='"+name+i+"'>"+getInfo($(this).attr('alt'), name)+"</div>");
		var my_tooltip = $("#"+name+i);

		$(this).removeAttr("title").mouseover(function(){
				my_tooltip.css({opacity:0.95, display:"none"}).fadeIn(120);
		}).mousemove(function(kmouse){
				my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
		}).mouseout(function(){
				my_tooltip.fadeOut(120);
		});
	});
}
$(document).ready(function(){
	simple_tooltip("area.tooltip-spot", "tooltip");
	simple_tooltip("area.mapinfo-spot", "mapinfo");
	simple_tooltip("area.special-spot", "special");
	$("area").click(function(){ return false; });
});
