/*
+-----------------------------------------------------------------------------+
| zimtkorn GmbH                                                               |
| Gjuchstrasse 19                                                             |
| 8953 Dietikon                                                               |
+-----------------------------------------------------------------------------+
| Projektbezeichnung: gate24.ch                                               |
+-----------------------------------------------------------------------------+
| Datei:              gate24.js                                               |
+-----------------------------------------------------------------------------+
| Das Urheberrecht an diesem Dokument (Code) verbleibt auf unbeschränkte Zeit |
| bei der zimtkorn GmbH, Dietikon. Ohne deren schriftliche Einwilligung darf  |
| es weder vervielfaeltigt, veraendert noch an Dritte, auch nicht in abgeaen- |
| derter Form, ganz oder teilweise mitgeteilt, zugaenglich oder nutzbar ge-   |
| macht werden. Dieses Dokument ist nach Art. 2 Abs. 3 URG urheberrechtlich   |
| geschützt. Des weiteren gelten die Allgemeinen Geschäftsbedingungen der     |
| zimtkorn GmbH, Dietikon                                                     |
+-----------------------------------------------------------------------------+

Document history:
2004-02-16  ker  created
2004-03-16  ker  added showMenu
2004-03-24  ker  added index stuff
2004-05-12  jm	 added showVereinPage
2004-06-03  jm	 added showHP
*/

function showCitySelection() {
	var cx = 250, cy = 600;
	var left = (screen.availWidth - cx) / 2, top = (screen.availHeight - cy) / 2;
	var params = "left=" + left + ",top=" + top + ",width=" + cx + ",height=" + cy + ",resizable=1";
	if (location.pathname.indexOf("/gastro/") >= 0) {
		var wnd = window.open("../cities.htm", "selection", params);
	}
	else {
		var wnd = window.open("cities.htm", "selection", params);
	}
	wnd.focus();
}

function showSectorSelection() {
	var cx = 250, cy = 600;
	var left = (screen.availWidth - cx) / 2, top = (screen.availHeight - cy) / 2;
	var params = "left=" + left + ",top=" + top + ",width=" + cx + ",height=" + cy + ",resizable=1";
	var wnd = window.open("sectors.htm", "sectorSelection", params);
	wnd.focus();
}

function showMenu(gastroId) {
	var cx = 600, cy = 600;
	var left = (screen.availWidth - cx) / 2, top = (screen.availHeight - cy) / 2;
	var params = "left=" + left + ",top=" + top + ",width=" + cx + ",height=" + cy + ",resizable=1,scrollbars=1";
	if (location.pathname.indexOf("/gastro/") >= 0) {
		var wnd = window.open("menu.aspx?id=" + gastroId, null, params);
	}
	else if (location.pathname.indexOf("/myCH/") >= 0) {
		var wnd = window.open("../gastro/menu.aspx?id=" + gastroId, null, params);
	}
	else if (location.pathname.indexOf("/d/") >= 0 || location.pathname.indexOf("/f/") >= 0 
			|| location.pathname.indexOf("/i/") >= 0 || location.pathname.indexOf("/e/") >= 0) {
		var wnd = window.open("http://www.gate24.ch/gastro/menu.aspx?id=" + gastroId, null, params);
	}
	else {
		var wnd = window.open("gastro/menu.aspx?id=" + gastroId, null, params);
	}
	wnd.focus();
}

function showHP(Id,nid) {
	var cx = 630, cy = 600;
	var left = (screen.availWidth - cx) / 2, top = (screen.availHeight - cy) / 2;
	var params = "left=" + left + ",top=" + top + ",width=" + cx + ",height=" + cy + ",resizable=1,scrollbars=1";
	if (location.pathname.indexOf("/hp/") >= 0) {
		if (nid != "") {
			var wnd = window.open("page.aspx?id=" + Id + "&nid=" + nid, null, params);
		}
		else {
			var wnd = window.open("page.aspx?id=" + Id, null, params);
		}
	}
	else if (location.pathname.indexOf("/gastro/") >= 0 || location.pathname.indexOf("/verein/") >= 0) {
		var wnd = window.open("../hp/page.aspx?id=" + Id, null, params);
	}
	else if (location.pathname.indexOf("/d/") >= 0 || location.pathname.indexOf("/f/") >= 0 
			|| location.pathname.indexOf("/i/") >= 0 || location.pathname.indexOf("/e/") >= 0) {
		var wnd = window.open("http://www.gate24.ch/hp/page.aspx?id=" + Id, null, params);
	}
	else {
		var wnd = window.open("hp/page.aspx?id=" + Id, null, params);
	}
	wnd.focus();
}

function showVereinPage(vereinId) {
	var cx = 630, cy = 600;
	var left = (screen.availWidth - cx) / 2, top = (screen.availHeight - cy) / 2;
	var params = "left=" + left + ",top=" + top + ",width=" + cx + ",height=" + cy + ",resizable=1,scrollbars=1";
	if (location.pathname.indexOf("/verein/") >= 0) {
		var wnd = window.open("page.aspx?id=" + vereinId, null, params);
	}
	else {
		var wnd = window.open("verein/page.aspx?id=" + vereinId, null, params);
	}
	wnd.focus();
}

function gotoPage(href,area) {
	var bannerUrl = "banner.aspx?area=" + (area ? area : '');
	var menuUrl = "menu.aspx?area=" + (area ? area : 'none');
	if (location.pathname.indexOf("/gastro/") >= 0 || location.pathname.indexOf("/verein/") >= 0 || location.pathname.indexOf("/hp/") >= 0 ) {
		bannerUrl = "../" + bannerUrl;
		menuUrl = "../" + menuUrl;
	}
	top.banner.location.href = bannerUrl;
	top.menu.location.href = menuUrl;
	top.main.location.href = href;
}

