///////////////////////////////////////////////////////////////////////////////
//	Scriptname:		syncnavigation.js 
//	Zweck:			Aktualisiert die Navigationsleiste für eine Webseite
//	Aktualisiert:	15.09.2003									 © M. Scheepers 
///////////////////////////////////////////////////////////////////////////////
//	Funktion:		parseQuerystring()
//	Parameter:		searchString string : Request.Query
//	Beschreibung:	Ermittelt den Wert zu einem Parameter aus dem Querystring.
//	Rückgabe:		string
///////////////////////////////////////////////////////////////////////////////
function parseQuerystring(searchString, paramName) {
	var sResult = "";
	var iStart = 0, iEnde = 0;
	if (searchString.length > 0) {
		iStart = searchString.indexOf(paramName);
		if (iStart != -1) {
			iStart += paramName.length;
			iEnde = searchString.indexOf("&", iStart);
			if (iEnde == -1)
				iEnde = searchString.length;
			iEnde -= iStart;
			sResult = searchString.substr(iStart, iEnde);
		}
	}
	return sResult;
}
///////////////////////////////////////////////////////////////////////////////
//	Funktion:		window.onload=function()
//	Parameter:		keine
//	Beschreibung:	Ereignisbehandlung für das OnLoad-Ereignis einer Webseite
//					Prüft ob eine Aktualisierung der Nav.-Leiste nötig ist.
///////////////////////////////////////////////////////////////////////////////
window.onload=function() {
	/*window.alert('location.href: ' + parent.location.href);
	window.alert('location.host: ' + parent.location.host);
	window.alert('location.hostname: ' + parent.location.hostname);
	window.alert('location.pathname: ' + parent.location.pathname);*/
	var nav = '';
	var path = '';
	if (parent.location.host == "www.acontipro.net" 
		|| parent.location.host == "www.acontipro.de"
		|| parent.location.host == "acontipro.net" 
		|| parent.location.host == "duscdweb01.www.acontipro.net" 		
		|| parent.location.host == "affiliate01.www.acontipro.net") {
		nav = '/navi.aspx?l=';
		path = self.location.pathname;
	}
	else {
		nav = '/www.acontipro.net/navi.aspx?l='
		path = self.location.pathname; //self.location.pathname.substr(11);
	}
	if (parseQuerystring(window.location.search, "p=") == "") {
		/*window.alert('nav: ' + nav);
		window.alert('path: ' + path);*/
		parent.leftFrame.location.href = nav + path
	}
}
