/*
	jquery.map.js by Stefan Bleilevens
	last edit: 4th Nov, 2009
	copyright by Euroweb Internet GmbH
*/

var datails_neversdorf = '<strong>Tiefbau Davids GmbH</strong>, <small>Neversdorf</small><br />Schiebrookstra&szlig;e 2<br />23816 Neversdorf<br />Telefon: +49 (0) 45 52 - 99 76 0<br />Telefax: +49 (0) 45 52 - 99 76 10';
var details_medelby = '<strong>Tiefbau Davids GmbH</strong>, <small>Medelby</small><br />Gr&uuml;ner Weg 9<br />24994 Medelby<br />Telefon: +49 (0) 46 05 - 18 00 0<br />Telefax: +49 (0) 46 05 - 18 00 20';
var timeout;
jQuery(document).ready(function(){
	jQuery(".mappoint").mouseover(function(){
		viewDetails(jQuery(this).attr("id"));
	});
	
	jQuery(".mappoint").mouseout(function(){
		timeout = window.setTimeout(function(){hideDetails();}, 1000);
	});
	
	jQuery("#mapdetails").mouseover(function(){
		window.clearTimeout(timeout);
	});
	jQuery("#mapdetails").mouseout(function(){
		window.clearTimeout(timeout);
		hideDetails();
	});
});

function viewDetails(id) {
	if(id != ""){
		if(id == "neversdorf"){
			document.getElementById("mapdetails").innerHTML = datails_neversdorf;
			jQuery("#mapdetails")
				.css("marginTop","12px")
				.css("marginLeft","71px");
		}
		if(id == "medelby"){
			document.getElementById("mapdetails").innerHTML = details_medelby;
			jQuery("#mapdetails")
				.css("marginTop","-80px")
				.css("marginLeft","10px");
		}
		jQuery("#mapdetails").fadeIn(600);
	}
}

function hideDetails(){
	jQuery("#mapdetails").fadeOut(500);
}
