﻿$(document).ready(function() {
	
	$("ul#menu li:first span").show();
	$("ul#menu li span a").css("color","#bbb").after('<img src="image/trenner.png" style="vertical-align:middle;margin-left:5px;" />');
	
	
	/* //Js-Navigation (keine durch PHP generierte)
	$("ul#menu li:first span").show();
	$("ul#menu li:first").css("backgroundColor","#e6e6e6").find("a").css("color","#444");
	$("ul#menu li span a").after('<img src="image/trenner.png" style="vertical-align:middle;margin-left:5px;" />');
	$("ul#menu li a").not("ul#menu li span a").click(function() {
		$("ul#menu li span").hide();
		$(this).parent().find("span").show();
		$("ul#menu li").css({"backgroundImage":"url(image/menu_li_bg.png)","backgroundColor":"#2e489c"}).find("a").css("color","#fff");
		$(this).parent("li").css({"backgroundImage":"none","backgroundColor":"#e6e6e6"}).find("a").css("color","#444");
	});
	$("ul#menu li span a").click(function() {
		$("ul#menu li span a").css({"color":"#333","textDecoration":"none"});
		$(this).css({"color":"#2e489c","textDecoration":"underline"});
	});
	$("#menu li:nth-child(1) a").not("#menu li span a").click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/praxis/p1.png"); 
	});
	$("#menu li:nth-child(2) a").not("#menu li span a").click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/praxis/p2.png");
	});
	$("#menu li:nth-child(3) a").not("#menu li span a").click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/praxis/p3.png");
	});
	$("#menu li:nth-child(4) a").not("#menu li span a").click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/praxis/p4.png");
	});
	
	$("#topmenu a").click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/top1.png");
		$("ul#menu li").css({"backgroundImage":"url(image/menu_li_bg.png)","backgroundColor":"#2e489c"}).find("a").css("color","#fff");
		$("ul#menu li span a").css("color","#bbb");
	});
	$("#topmenu a").next().click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/top2.png");
	}).next().click(function() {
		$("#bild img").hide();
		$("#bild img").fadeIn("normal").attr("src","image/platzhalter.png");
	});
	*/

	$("#sidebar .info-box:first").show();
	$("#sidebar div h4").click(function() {
		$("#sidebar .info-box:visible").slideUp();
		$(this).parent().next(".info-box").slideToggle("slow");
	});
	


	
});


/* Google Maps API */
function initmap() {
	var praxis1 = new google.maps.LatLng(51.43418,6.76262);
	var praxis2 = new google.maps.LatLng(51.44724,6.63294);
	var praxis3 = new google.maps.LatLng(51.37507,6.76056);
	var praxis4 = new google.maps.LatLng(51.42907,6.77846);
	var praxis5 = new google.maps.LatLng(51.38096,6.78537);
	var mittelpunkt = new google.maps.LatLng(51.4198139,6.7071099);	
	var myOptions = {
		zoom: 11,
		center: mittelpunkt,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	var map = new google.maps.Map(document.getElementById("map"), myOptions);
	var infowindow1 = new google.maps.InfoWindow({ 
		content: 
				'<div class="map-popup"><b><u>Hauptpraxis (Alte Post)</u></b><br />Poststr. 20-26 &bull; 47051 Duisburg<br />Telefon: 0203 - 28 67 60<br />Sprechstunden: 7:30 - 17:30 Uhr</div>',
	});
	var infowindow2 = new google.maps.InfoWindow({ 
		content: 
				'<div class="map-popup"><b><u>Praxis Moers</u></b><br />Uerdinger Strasse 41 &bull; 47441 Moers<br />Telefon: 0203 - 28 67 60<br />Sprechstunden: 7:30 - 17:30 Uhr</div>',
	});
	var infowindow3 = new google.maps.InfoWindow({ 
		content: 
				'<div class="map-popup"><b><u>Standort Sittardsberg (Im Gesundheitszentrum am Sittardsberg)</u></b><br />Altenbrucher Damm 15 &bull; 47249 Duisburg<br />Telefon: 0203 - 28 67 60<br />Sprechstunden: 7:30 - 17:30 Uhr</div>',
	});
	var infowindow4 = new google.maps.InfoWindow({ 
		content: 
				'<div class="map-popup"><b><u>Mammographie Screening</u></b><br />Neudorfer Strasse 45 &bull; 47057 Duisburg<br />Leistungsspektrum: Brustkrebsvorsorge<br />Termin oder Terminänderungen: 0211 - 59 70 7000<br />Weitere Infos: <a href="http://www.mammographiescreening-duisburg.de">www.mammographiescreening-duisburg.de</a></div>',
	});
	var infowindow5 = new google.maps.InfoWindow({ 
		content:
				'<div class="map-popup"><b><u>ZKDD - Zentrum für nicht-invasive Kardiovaskuläre Diagnostik Duisburg</u></b><br />Grossenbaumer Allee 250 &bull; 47249 Duisburg<br />Telefon: 0203 - 28 67 60<br />Leistungsspektrum: CT, MRT<br />*Nur Privatpatienten, Selbstzahler und Berufsgenossenschaftliche Patienten (Arbeitsunfall)<br />Weitere Infos: <a href="http://www.mammographiescreening-duisburg.de">www.mammographiescreening-duisburg.de</a></div>',
	});
	var marker1 = new google.maps.Marker({
		position: praxis1,
		map: map,
		icon: 'image/map/logomap_1.png',
		title: 'Hauptpraxis',
		zIndex: 999
	});
	var marker2 = new google.maps.Marker({
		position: praxis2,
		map: map,
		icon: 'image/map/logomap_2.png',
		title: 'Praxis Moers'
	});
	var marker3 = new google.maps.Marker({
		position: praxis3,
		map: map,
		icon: 'image/map/logomap_3.png',
		title: 'Standort Sittardsberg'
	});
	var marker4 = new google.maps.Marker({
		position: praxis4,
		map: map,
		icon: 'image/map/logomap_4.png',
		title: 'Mammographiescreening Duisburg'
	});
	var marker5 = new google.maps.Marker({
		position: praxis5,
		map: map,
		icon: 'image/map/logomap_5.png',
		title: 'ZKDD'
	});
	google.maps.event.addListener(marker1, 'click', function() {
	infowindow2.close(); infowindow3.close(); infowindow4.close(); infowindow5.close();
	infowindow1.open(map,marker1); });
	google.maps.event.addListener(marker2, 'click', function() {
	infowindow1.close(); infowindow3.close(); infowindow4.close(); infowindow5.close();
	infowindow2.open(map,marker2); });
	google.maps.event.addListener(marker3, 'click', function() {
	infowindow1.close(); infowindow2.close(); infowindow4.close(); infowindow5.close();
	infowindow3.open(map,marker3); });
	google.maps.event.addListener(marker4, 'click', function() {
	infowindow1.close(); infowindow2.close(); infowindow3.close(); infowindow5.close();
	infowindow4.open(map,marker4); });
	google.maps.event.addListener(marker5, 'click', function() {
	infowindow1.close(); infowindow2.close(); infowindow3.close(); infowindow4.close();
	infowindow5.open(map,marker5); });	
}	
