liveEdit = false;
aktuell = 27;
aktuellOne = 27;
lastHandledHash = window.location.hash;

$(document).ready(function(e) {
	var editMode = $(".LE_HEAD").text();
	if( !editMode) {
	document.getElementById('dgmozart').onmouseover = function()
	{
		document.getElementById('toolTipMozartContainer').style.height = '100px';
		document.getElementById('toolTipMozartContainer').style.opacity = '1';
		fadeFaceAreaOut();	
	};	
	document.getElementById('dgmozart').onmouseout = function()
		{
			document.getElementById('toolTipMozartContainer').style.height= '0px';
			document.getElementById('toolTipMozartContainer').style.opacity = '0';
			fadeFaceAreaIn();
		};
	document.getElementById('dgzierow').onmouseover = function()
	{
			document.getElementById('toolTipZierowContainer').style.height = '100px';
			document.getElementById('toolTipZierowContainer').style.opacity = '1';	
	};
	document.getElementById('dgzierow').onmouseout = function()
	{
			document.getElementById('toolTipZierowContainer').style.height= '0px';
			document.getElementById('toolTipZierowContainer').style.opacity = '0';
	};
	document.getElementById('dglueb').onmouseover = function()
	{
			document.getElementById('toolTipLuebContainer').style.height = '100px';
			document.getElementById('toolTipLuebContainer').style.opacity = '1';
	};
	document.getElementById('dglueb').onmouseout = function()
	{
			document.getElementById('toolTipLuebContainer').style.height= '0px';
			document.getElementById('toolTipLuebContainer').style.opacity = '0';
	};
	}


	document.getElementById('dglueb').onclick = function() {
		loadContent('dgluebsche',2);
	};
	
	document.getElementById('dgzierow').onclick = function() {
		loadContent('dgzierow',2);
	};
	
	document.getElementById('dgmozart').onclick = function() {
		loadContent('dgmozart',2);
	};
	
	
	document.getElementById('nav_schularten').onclick = function() {
		loadContent('nav_schularten',2);
	};
	
	document.getElementById('nav_aktuelles').onclick = function() {
		loadContent(27,2);
	};
	
	document.getElementById('nav_standorte').onclick = function() {
		loadContent('nav_standorte',2);
	};
	
	document.getElementById('nav_plaene').onclick = function() {
		loadContent('nav_plaene',2);
	};
	
	document.getElementById('nav_kontakt').onclick = function() {
		loadContent('nav_kontakt',2);
	};
	
	document.getElementById('nav_wohnheim').onclick = function() {
		loadContent('nav_wohnheim',2);
	};
	
	document.getElementById('nav_ueber').onclick = function() {
		loadContent('nav_ueber',2);
	};
	
	
	$("a").each(function(index, element) {
        if( ($(this).attr("href") == "dgluebsche") || ($(this).attr("href") == "dgmozart") || ($(this).attr("href") == "dgzierow") ||
				($(this).attr("href") == "news") || ($(this).attr("href") == "schularten") || ($(this).attr("href") == "standorte") ||
				($(this).attr("href") == "plaene") || ($(this).attr("href") == "kontakt") || ($(this).attr("href") == "wohnheim")  || ($(this).attr("href") == "ueber_uns") ) {
			$(this).removeAttr("href");
		}
    });
	
	$("#NewsTip").click(function(e) {
		var br = 0;
		$(this).children().children().filter("a").each(function(index, element) {
			br++;
        });
		
		if(br > 0) {
			return;
		}
		
		if(! liveEdit) {
			if(aktuell == 27) {
		       	smoothScrollTo("section2"); 
			} else {
				loadContent(27,2,null);
			}
		}
    });
	
	
	if( $.trim($("#NewsTipContent").text()) != "") {
		var delay = 1000;
		var duration = 3000;
		if(liveEdit) { delay = 0; duration = 0;}
		$(".LE_HEAD").each(function(index, element) {
            delay = 1;
			duration = 1;
        });
		$("#NewsTip").css("display","block")
			.css("opacity",0)
			.css("top","500px")
			.css("left","100px");
		
		window.setTimeout( function() { 
				$("#NewsTip").animate( { opacity:1 , left:"20px" } , duration , 'swing');
			} 
			
			, delay);
		/*
		window.setTimeout( function() { 
			if(liveEdit) {return;}
				$("#NewsTip").animate( { opacity:0.7 } , duration/2 , 'swing' , function () {
					$("#NewsTip").unbind("mouseover");
					$("#NewsTip").mouseover(function(e) {
						if(liveEdit) {return;}
                        $("#NewsTip").animate( { opacity:1 } , 200);
                    });
					
					$("#NewsTip").unbind("mouseout");	
					$("#NewsTip").mouseout(function(e) {
						if(liveEdit) {return;}
                        $("#NewsTip").animate( { opacity:0.7 } , 200);
                    });
					
					} );

			} 
			, delay*1.5);
			*/
			
	}
	
	$(window).resize(function(e) {
		if(window.innerWidth < 400) {
			$("#NewsTip").css("display","none");					
		} else if(window.innerWidth < 560) {
			$("#NewsTip").css("top","170px");
		}
		else {
			$("#NewsTip").css("top","500px");
			$("#NewsTip").css("display","block");
		} 
    });
	
	if(window.innerWidth < 400) {
		$("#NewsTip").css("display","none");					
	} else if(window.innerWidth < 560) {
		$("#NewsTip").css("top","170px");
	} else {
		$("#NewsTip").css("top","500px");
		$("#NewsTip").css("display","block");
	} 
	


	var loca = window.location.href;
	if( loca.substr(loca.length - 9) == "ueber_uns") {
		map_initialize();
	}
	
	if ( getUrlVars()["site"] ) {
		aktuell = getUrlVars()["site"];
		
		var bereich = 2
		
		if( (aktuell == "dglueb") || (aktuell == "dgluebsche") || (aktuell == "dgmozart") || (aktuell == "dgzierow") )
			bereich = 2;
		
		if(getUrlVars()["section"])
			bereich = getUrlVars()["section"];
			
		if( (aktuell == 'dgluebsche') || (aktuell == 'dglueb') || (aktuell == 'dgmozart' ) || (aktuell == 'dgzierow') ||
			(aktuell == 'news') || (aktuell == 'nav_news') || (aktuell == 'nav_schularten') || (aktuell == 'nav_standorte') ||
			(aktuell == 'plaene') || (aktuell == 'nav_plaene') || (aktuell == 'nav_kontakt') || (aktuell == 'nav_wohnheim') ) {
				
			window.setTimeout( function () { smoothScrollTo("section2") } , 500);
		}
			
			
		adjustPaddingInSectionTwo(aktuell,bereich);
		initMainSites();
		initSecondSites();
	}
	
	adjLocation("dgluebsche","!dgluebsche");
	adjLocation("dgmozart","!dgmozart");
	adjLocation("dgzierow","!dgzierow");
	adjLocation("news","!27");
	adjLocation("schularten","!nav_schularten");
	adjLocation("standorte","!nav_standorte");
	adjLocation("plaene","!nav_plaene");
	adjLocation("kontakt","!nav_kontakt");
	adjLocation("ueber_uns","!nav_ueber");
	adjLocation("wohnheim","!nav_wohnheim");
	
		
	if( window.location.hash) {
		var hash = window.location.hash.substr(2);
		var hindex = hash.indexOf("|");
		if (hindex > 0) {
			loadContent(hash.substr(0, hindex) , 2 , null, 1);
		} else {
			if(window.location.hash.substr(0,2) == "#|") {
				loadContent(hash.substr( 0, hash.indexOf(";")) , 3 , hash.substr( hash.indexOf(";")+1), 1);
			} else {
				loadContent(hash , 2 , null,1);
			}
		}
	}	
	
	$(window).bind( 'hashchange', function(e) {
	
		if( lastHandledHash == window.location.hash ) { 
			return;
		}
		if( window.location.hash) {
			
			var hash = window.location.hash.substr(2);
			var hindex = hash.indexOf("|");
			if (hindex > 0) {
				if(aktuellOne != hash.substr(0, hindex)) {
					loadContent(hash.substr(0, hindex) , 2 , null, 1);
				} else {
					  var hash = window.location.hash.substr(2);
					  var hindex = hash.indexOf("|");
					  if (hindex > 0) { 
						  var secondPart = hash.substr(hindex+1);
						  var secondContent = secondPart.substr(0, secondPart.indexOf(";"));
						  var secondHeading = secondPart.substr(secondPart.indexOf(";")+1);
						  if(aktuellShow != secondContent) {
							  window.setTimeout( function () {
								  loadContent(secondContent , 3 , secondHeading,1);
							  } ,"200");	  
							  aktuellShow = secondContent;
						  }
					  }
				}
			} else {

				var nIndex = lastHandledHash.indexOf("|");
				var vgl = "";
				if(nIndex > 0) {
					vgl = lastHandledHash.substr(2 , lastHandledHash.indexOf("|")-2);
				} else {
					vgl = lastHandledHash.substr(2);
				}
				
				if(hash == vgl) {
					lastHandledHash = hash;
					aktuellShow = hash;
					$("#lineLevel2")
						.text("")
						.animate({ opacity:0,marginTop:'0px' } , 1000,'linear', function () {  $("#lineLevel2").css("display","none");  });
					$("#section3")
						.css("overflow","hidden")
						.css('height', $("#section3").height() )
						.css("min-height","0px")
						.animate({ marginTop: '0px',height:'0px'} , 1000, 'linear', function() { $("#section3").text(""); } );
				} else {
					/*
					if(window.location.hash.substr(1,1) == '|') {
						loadContent(window.location.hash.substr(2).substr(0, window.location.hash.substr(2).indexOf(";") ) , 3 , 
						window.location.hash.substr(2).substr(window.location.hash.substr(2).indexOf(";")+1 )
						,1);
					} else {*/
					if( window.location.hash.substr(0,2) == "#|") {
							loadContent( hash.substr(0, hash.indexOf(";")) , 3 , hash.substr(hash.indexOf(";")+1),1);
					} else {
							
							loadContent(hash , 2 , null,1);
					}
					/*}*/
				}
			}
		}
	});


	if( $.trim($("#NewsTipContent").text()) == "") {
		$("#NewsTip").fadeOut(0);
		$("#NewsTip").remove();
		$("#NewsTip").css("display","none");
	}
	
	if(navigator.appName == "Microsoft Internet Explorer") {
		var msieIndex =navigator.appVersion.indexOf("MSIE",0);
		var pnt = navigator.appVersion.indexOf(".",msieIndex);
		a = navigator.appVersion.substr( msieIndex  +5 ,pnt-msieIndex-5);
		if( a < 9) {
			$(".dg").css("width","196px").css("height","140px")
			.css("margin-left","266px").css("margin-right","-266px")
			.mouseover(function(a) {
				$(this).css("margin-left","266px").css("margin-right","-266px");
				$(this).parent().children().filter(".toolTipContainer").fadeIn(200);
            }).mouseout(function(a) {
				$(this).css("margin-left","266px").css("margin-right","-266px");
				$(this).parent().children().filter(".toolTipContainer").fadeOut(200);
            });
		
			
			$(".toolTipDg").css("padding-left","10px");
			
			$("#dglueb").css("background-image","url('gfx/layout/buildings/s_dglueb.png')").css("top","50px");
			$("#dgmozart").css("background-image","url('gfx/layout/buildings/s_dgmozart.png')").css("top","35px");
			$("#dgzierow").css("background-image","url('gfx/layout/buildings/s_dgzierow.png')").css("top","15px");
			
			$(".toolTipContainer").fadeOut(0);
			$("#footer-kante").css("margin-bottom","-16px");
			$("#copyright").css("width","170px");

			window.onresize = function (e) {
				if(document.body.offsetWidth < 850) {
					$(".lineElement").css("padding-left","8px").css("padding-right","8px").css("margin-left","8px").css("margin-right","8px");
					$("#FaceArea").css("font-size","40px").css("margin-left","-390px");
					$("#downText").css("font-size","14px").css("letter-spacing","2px");
					$("#infoStudent").css("line-height","normal").css("min-height","40px");
					$("#schiffchen").css("margin-top","-70px");
				} else {
					$("#FaceArea").css("font-size","48px").css("margin-left","-420px");
					$("#downText").css("font-size","15px").css("letter-spacing","3px");
					$(".lineElement").css("padding-left","15px").css("padding-right","15px").css("margin-left","15px").css("margin-right","15px");
				}
			}
			
			window.onresize();
			
			alert("Sie verwenden den Internet Explorer Version "+a+".\nDieser ist nicht aktuell und stellt diese Website wahrscheinlich nicht ordnungsgemäß dar. Bitte aktualisieren Sie ihren Browser mindestens auf Version 9.");
		}
	} else if (navigator.appName == "Opera") {
		if( navigator.appVersion.substr(0, navigator.appVersion.indexOf(".")) < 9) {
			alert("Ihr Browser ist nicht aktuell und stellt diese Website evt. nicht ordnungsgemäß dar. Bitte aktualisieren Sie ihren Browser.");
		}		
	} else if ( (navigator.appName == "Netscape") && (navigator.appCodeName == "Mozilla")) {
		if( navigator.appVersion.substr(0, navigator.appVersion.indexOf(".")) < 5) {
			alert("Ihr Browser ist nicht aktuell und stellt diese Website evt. nicht ordnungsgemäß dar. Bitte aktualisieren Sie ihren Browser.");
		}
	}
	

});

function fadeFaceAreaIn()
{
	document.getElementById('FaceArea').style.opacity = 1;
}

function fadeFaceAreaOut()
{
	if (window.innerWidth < 1420) {
		document.getElementById('FaceArea').style.opacity = 0.15;
	}
}


function initSecondSites(second) {
	if(!second) {
		$("#b_k_a").css("background-position","right 10px");
	}
		$("#b_k_a").click(function(e) {
			
			if( $("#kaddr").css("display") == 'block') {
				return;
			}

			$("#kform").animate( { opacity:0 , marginLeft:"500px" } , 1000 ,'swing' , function () { 
				$(this).css("display","none");
					$("#kaddr").css("left","0px")
					.css("margin-right","0px")
					.css("display","block")
					.css("opacity",0)
					.animate( { opacity:1 } , 1000 , 'swing');
				 } );
				
			$("#b_k_f").css("background-position","250px 10px");
			$("#b_k_a").css("background-position","right 10px");
			
			$("#kfresponse").css("opacity",0)
				.css("display","none")
				.css("background-image","none");

        });
	
	$("#b_k_f").click(function(e) {
		
		if( $("#kform").css("display") == 'block') {
				return;
		}
		
        $("#kform").css("opacity",0)
			.css("display","block")
			.css("margin-left","0px")
			.animate( { "opacity":1 } , 1000);
		
		$("#b_k_a").css("background-position","250px 10px");
		$("#b_k_f").css("background-position","right 10px");
		
		$("#kaddr").css("position","relative")
			.animate( { opacity:0 } ,500)
			.animate( { left:"-500px", marginRight:"-510px" } , 1000 , 'swing' , function () {
				$(this).css("display","none");
			});
			
		$("#kfresponse").css("opacity",0)
			.css("display","none")
			.css("background-image","none");
    });
	
	$(".b_k").unbind("mouseover")
			.unbind("mouseout");
	$(".b_k").mouseover( function (e) {

	});
	$(".b_k").mouseout( function (e) {

	});
	
	
	$("#kfsubmit").unbind("click");
	$("#kfsubmit").click( function(e) {
	 
	 	$("#kform")
		.css("opacity",1)
		.css("left","0px")
		.css("margin-right","0px")
		.animate( { opacity:0 } ,500, 'swing' , function () {
			$(this).css("display","none");
			
			$("#kfresponse")
				.css("display","block")
				.css("background-image","url('gfx/layout/loading.gif')")
				.css("background-position","center")
				.css("background-repeat","no-repeat")
				.css("opacity",0)
				.animate( { opacity:1 } , 1000);
		
			$("#kfresponse").load("sites/_kontakt_send.inc.php", 
			{ msg:$("#msg").val() , name:$("#name").val() , mail:$("#m").val() , ha:$("#ha").val() , hb:$("#hb").val() ,hc:$("#hc").val() , hd:$("#hd").val() } ,function() {
				$(this).css("background-image","none");
				initSecondSites(1);
			});
		});
	});
	
	$("#kfsb").click(function(e) {
		
		$("#kform")
		.css("opacity",0)
		.css("left","0px")
		.css("margin-right","0px");
		
		$("#kfresponse").animate( { opacity:0 } , 500 , function () {
			$(this).css("display","none")
			.html("&nbsp;");
			$("#kform").css("display","block")
			.animate( { opacity:1 } , 1000 );
		});

    });
	
	$("#fpl_login").unbind("click");
	$("#fpl_login").click(function(e) {
		$("#section3").load("sites/secret_plans.inc.php",{ 	action:'login',
															username:$("#fpl_username").val(),
															pwd:$("#fpl_pwd").val()
															} , function () { initSecondSites(); } );
    });

	$("#fpl_reg").unbind("click");
	$("#fpl_reg").click(function(e) {
		$("#section3").load("sites/secret_plans.inc.php",{ 	action:'reg',
															username:$("#fplr_username").val(),
															pwd:$("#fplr_pwd").val(),
															pwd_2:$("#fplr_pwd_2").val(),
															mail:$("#email").val(),
															klasse:$("#klasse").val(),
															vname:$("#fplr_vname").val(),
															nname:$("#fplr_nname").val(),
															dglueb:document.fpl_reg.dglueb.checked,
															dgmozart:document.fpl_reg.dgmozart.checked,
															dgzierow:document.fpl_reg.dgzierow.checked
															} , function () { initSecondSites(); } );
    });
	
}

function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
	
	var loc = new String ( window.location.href);
	var len = loc.length;
	
	if(!vars["site"]) {
		if( loc.substr(len-10) == 'dgluebsche')
			vars["site"] = 'dgluebsche';
		if( loc.substr(len-6) == 'dglueb')
			vars["site"] = 'dglueb';
		if( loc.substr(len-8) == 'dgmozart')
			vars["site"] = 'dgmozart';
		if( loc.substr(len-8) == 'dgzierow' )
			vars["site"] = 'dgzierow';
		if( loc.substr(len-4) == 'news' )
			vars["site"] = 'nav_news';
		if( loc.substr(len-10) == 'schularten' )
			vars["site"] = 'nav_schularten';
		if( loc.substr(len-9) == 'standorte' )
			vars["site"] = 'nav_standorte';
		if( loc.substr(len-6) == 'plaene' )
			vars["site"] = 'nav_plaene';
		if( loc.substr(len-7) == 'kontakt' )
			vars["site"] = 'nav_kontakt';
		if( loc.substr(len-8) == 'wohnheim' )
			vars["site"] = 'nav_wohnheim';
	}
	
	
    return vars;
}


function adjustPaddingInSectionTwo(inhalt,bereich) {
	if( (bereich == 2) && ((inhalt == "dgluebsche") || (inhalt == "dgmozart") || (inhalt == "dgzierow") 
		|| (inhalt != "nav_standorte") && (inhalt != "nav_plaene") && (inhalt != "nav_wohnheim") && (inhalt != "nav_schularten") && (inhalt != "nav_kontakt") && (inhalt != "nav_news") && (inhalt != "nav_ueber") && (inhalt != 27) && (isNaN(inhalt)) )   ) {
		$("#section2").css("padding-left","0px").css("padding-right","0px");
	} else if (bereich != 2) {
		return;
	} else {
		$("#section2").css("padding-left","20px").css("padding-right","20px");
	}	
}

function initMainSites() {
  $(".info_accord_window").children(this).each( function() {

  $(this).filter(".info_accord_command")
  	.unbind("click")
      .click(function() {
		  
		  	var temp = $(this);
			
			var currentDisplayStyle = $(this).parent().children(this).filter(".info_accord_dropdownarea").css("display");
			
			var isLE = 0;
			
			
			$(".LE_HEAD").each(function(index, element) {
                isLE++;
            });

			
			if(currentDisplayStyle != 'none') {
				$(".info_accord_window").children(this).each( function() { 	
				  	$(this).filter(".info_accord_dropdownarea").each( function () {
						if( isLE == 0 || ( (isLE > 0) && $(this).parent().children(this).filter('.info_accord_command').text() != temp.text())  ) {
							$(this).animate(
								{ height: "0px",
								  paddingBottom: "0px",
					 			  paddingTop: "0px",
								  marginBottom: "0px"
								} ,1000,'linear',function () { $(this).css("display","none"); } );
						}
					});
				});
				return;
			}

			$(".info_accord_window").children(this).each( function() { 
			  	$(this).filter(".info_accord_dropdownarea").each( function () {
					if($(this).parent().children(this).filter('.info_accord_command').text() != temp.text()) {
						$(this).animate(
							{ height: "0px",
							  paddingBottom: "0px",
				 			  paddingTop: "0px",
							  marginBottom: "0px"
							} ,1000,'linear',function () { $(this).css("display","none"); } );
					}
				});
			});
			
			
			var tmpHeight = $(this).parent().children().filter(".info_accord_dropdownarea").css("height","auto").height();
			$(this).parent().children().filter(".info_accord_dropdownarea").css("height","0px");
		  			
        	$(this).parent().children().filter(".info_accord_dropdownarea")
			.css("display","block")
			.animate(
			 { height : tmpHeight + "px",
			paddingBottom: "10px",
			paddingTop: "10px",
			marginBottom: "7px" } , 1000 ,'linear', function() { $(this).css("height","auto"); } );

			
      });
  });
	
}

var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;

function map_initialize() {
	directionsDisplay = new google.maps.DirectionsRenderer();
	var middle = new google.maps.LatLng(53.911063, 11.393824);
	var geocoder;
    geocoder = new google.maps.Geocoder();
	var myOptions = {
	   zoom:12,
	   mapTypeId: google.maps.MapTypeId.ROADMAP,
	   center: middle
	 }
	 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	 directionsDisplay.setMap(map);
	/*	
	 var lueb = new google.maps.Marker({
     position: new google.maps.LatLng(53.911063, 11.393824),
     map: map,
     title: 'Lübsche Straße'
    });
    google.maps.event.addListener(lueb, 'click', function() {
      infowindow.open(map,lueb);
    });
	*/
    var address = "Lübsche Straße 207, 23968 Wismar, Germany";
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        	var markerLueb = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location,
			title: "Dienstgebäude Lübsche Straße"
        });
		
		var infowindowLueb = new google.maps.InfoWindow({
			content: "<div class=\"map_infowindow\">Dienstgebäude Lübsche Straße<br><br>Lübsche Straße 207<br>23968 Wismar</div>"
		});	
		google.maps.event.addListener(markerLueb, 'click', function() {
			infowindowLueb.open(map,markerLueb);
		});
      }
    });
	
	address = "Mozart Straße 54, 23968 Wismar, Germany";
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var markerMozart = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location,
			title: "Dienstgebäude Mozart Straße"
        });
		var infowindowMozart = new google.maps.InfoWindow({
			content: "<div class=\"map_infowindow\">Dienstgebäude Mozartstraße<br><br>Mozart Straße 54<br>23968 Wismar</div>"
		});	
		google.maps.event.addListener(markerMozart, 'click', function() {
			infowindowMozart.open(map,markerMozart);
		});
      }
    });
	
	address = "Lindenstraße 15, 23968 Zierow, Germany";
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var markerZierow = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location,
			title: "Dienstgebäude Zierow"
        });
		var infowindowZierow = new google.maps.InfoWindow({
			content: "<div class=\"map_infowindow\">Dienstgebäude Zierow<br><br>Lindenstraße 15<br>23968 Zierow</div>"
		});	
		google.maps.event.addListener(markerZierow, 'click', function() {
			infowindowZierow.open(map,markerZierow);
		});
      }
    });
	
	address = "Amselweg 1, 23968 Zierow, Germany";
	
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var markerWH = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location,
			title: "Wohnheim Zierow"
        });
		var infowindowWH = new google.maps.InfoWindow({
			content: "<div class=\"map_infowindow\">Wohnheim Zierow<br><br>Amselweg 1<br>23968 Zierow</div>"
		});	
		google.maps.event.addListener(markerWH, 'click', function() {
			infowindowWH.open(map,markerWH);
		});
      }
    });
	
}

function adjLocation(sch,hash) {
	if(window.location.pathname.lastIndexOf(sch) != -1 ) {
		window.location.href = window.location.protocol + "//" +  window.location.hostname +"/"+  window.location.pathname.substr(0, window.location.pathname.lastIndexOf("/"+sch) ) + "#"+hash;
	}
}


