var moddatetmp=(new Date(document.lastModified)).toLocaleString();
var moddate=moddatetmp.substring(0,moddatetmp.length-9);

function openPopupLage(myname,myaddr)
{
	MyName=myname;
	MyAddr=myaddr;
	openpopup('popup/lage.html','EMail',440,680,0,0,0,0);
}

function openRoute(myaddress)
{
	openpopup("popup/route.html?MyAddress="+myaddress,"Route",1024,768,1,1,1,1);
}

// Open Popups
function openpopup (myfile, myname, breite, hoehe, posX, posY, resizable, scrollbars){
	if (myname == '') myname = 'FC Puchheim';
	if (posX == '') posX = '0';
	if (posY== '') posY = '0';
	if(resizable == null) resizable = '0';
	if(scrollbars == null) scrollbars = '0';
	if(scrollbars == '1')  breite = parseInt(breite) + 22;
	if (hoehe == '0') {
		neuehoehe = screen.availHeight-screen.availHeight/10;
		if (neuehoehe>900) neuehoehe=900;
			hoehe = neuehoehe;
	}
	var params;
	if (navigator.appName.indexOf("Explorer") != -1)
		var params = "width=" + breite + ",height=" + hoehe + ",left=" +posX+ ",top=" +posY+ ",resizable=" + resizable + ",status=1,scrollbars=" + scrollbars + ",toolbar=0,location=0,directories=0,menubar=0";   
	else
		var params = "width=" + breite + ",height=" + hoehe + ",screenX=" +posX+ ",screenY=" +posY+ ",resizable=" + resizable + ",status=1,scrollbars=" + scrollbars + ",toolbar=0,location=0,directories=0,menubar=0";

	var newwin = window.open(myfile ,myname ,params);
	newwin.focus();
}

function getRoute () {
	var x = 0;
	mySearch = location.search.substr(1).split("&");

	for (x=0;x<mySearch.length;x++)
	{
		myValues=mySearch[x].split("=");
		if (myValues[0]=="MyAddress")
			myaddress=myValues[1];
	}
	switch (myaddress) {
	  case "1":
			myRoutename="Heiliggeist-Kirche, Freising, Heiliggeistgasse 5";
			myRouteaddr="Heiliggeist-Kirche, Freising, Heiliggeistgasse 5";
			myRoutesearch="Freising+Heiliggeistgasse+5";
	    break;
	  case "2":
			myRoutename="Hallbergmoos, Garchinger Weg 72";
			myRouteaddr="Hallbergmoos, Garchinger Weg 72";
			myRoutesearch="Hallbergmoos+Garchinger+Weg+72";
	    break;
	  case "3":
			myRoutename="Dornach Schweiz";
			myRouteaddr="Rüttiweg 45, CH-4143 Dornach (Goetheanum, Allgemeine Anthroposophische Gesellschaft)";
			myRoutesearch="Rüttiweg+45+CH-4143+Dornach";
	    break;
	}
}