/********************************************************
** Copyright dirk.wildt@think-visually.de, Berlin 2003 **
********************************************************/

var globPathContent = "content/";							// Verzeichnisse:	Inhalt
var globPathMenu    = "menu/";								//								Menu
var globPathNavigat = "navigation/";					//								Navigation
var globContentTitl = "title";								// Frames:	Inhalt: Titel
var globContentPath = "path";									//					Inhalt: Pfad
var globContentText = "text";									//					Inhalt: Text/Bilder
var globContDesktop = "desktop";							//					Inhalt: Desktop
var globMenuContent = "menu";									//					Menü
var globMenuFotoTop = "menuFotoTop";					//					Menü: Foto oben
var globMenuFotoBot = "menuFotoBottom";				//					Menü: Foto unten
var globFileHome = "home/home.html";					// Um Desktop, FotoTop und -bottom aktualisieren zu können

function fGetDocname(strPath) {
  /*******************
  ** Diese Funktion ermittelt aus strPath den Namen der in strPath angegebenen Datei
  ** Rückgabewert: (String) Name der Datei; z.B. 'home.html'
  *******************/
  var strDocname = String(strPath);
  var intIndexBegin = strDocname.lastIndexOf("/") + 1;
  var intIndexEnd = strDocname.length;
  return strDocname.substring(intIndexBegin, intIndexEnd);
}
function setFrames(strDocname, strFrame, boolDesktop, boolMenu, boolFotoTop, boolFotoBot) {
  /*******************
  ** Diese Funktion füllt Frames mit den in strDocname angegebenen Dateien
  ** Hinweis
  ** Der Frame, aus dem diese Funktion aufgerufen wird, muss als letztes 
  ** aktualisiert werden, da andernfalls ein Laufzeitfehler (in Netscape) auftritt.
  *******************/
	var strPathContentTitl = PathToRoot + globPathContent + globContentTitl + '/';
	var strPathContentPath = PathToRoot + globPathNavigat + globContentPath + '/';
	var strPathContentText = PathToRoot + globPathContent + globContentText + '/';
	var strPathContDesktop = PathToRoot + globPathContent + globContDesktop + '/';
	var strPathMenuContent = PathToRoot + globPathNavigat + globPathMenu + globMenuContent + '/';
	var strPathMenuFotoTop = PathToRoot + globPathNavigat + globPathMenu + globMenuFotoTop + '/';
	var strPathMenuFotoBot = PathToRoot + globPathNavigat + globPathMenu + globMenuFotoBot + '/';
	if (1 == 0) {
 		alert('true: ' + strPathContentTitl + strDocname + '\n' +
 			'true: ' + strPathContentPath + strDocname + '\n' +
 			'true: ' + strPathContentText + strDocname + '\n' +
 			boolDesktop + ": " + strPathContDesktop + strDocname + '\n' +
 			boolMenu + ": " + strPathMenuContent + strDocname + '\n' +
 			boolFotoTop + ": " + strPathMenuFotoTop + strDocname + '\n' +
 			boolFotoBot + ": " + strPathMenuFotoBot + strDocname + '\n\n' +
 			'Frame: ' + strFrame
 			);
 	}
	
	if (strFrame != globContentPath) {
		parent.frames[globContentPath].location.href = strPathContentPath + strDocname;
	}
	if (strFrame != globContentText) {
		parent.frames[globContentText].location.href = strPathContentText + strDocname;
	}
	if (strFrame != globContentTitl) {
		parent.frames[globContentTitl].location.href = strPathContentTitl + strDocname;
	}
	if (strFrame != globContDesktop) {
		if (boolDesktop) {
			parent.frames[globContDesktop].location.href = strPathContDesktop + strDocname;
		} else
		{
			parent.frames[globContDesktop].location.href = strPathContDesktop + globFileHome;
		}
	}
	if (strFrame != globMenuContent) {
		if (isAll || isID && (navigator.appName.indexOf('Opera') != 0))
 		{
			//alert('standardmenü');
			// do nothing!
		} else {
			//alert('NS4-Menü');
			if (boolMenu) parent.frames[globMenuContent].location.href = strPathMenuContent + strDocname;
		}
	}
	if (strFrame != globMenuFotoTop) {
		if (boolFotoBot) {
			parent.frames[globMenuFotoTop].location.href = strPathMenuFotoTop + strDocname;
		} else
		{
			parent.frames[globMenuFotoTop].location.href = strPathMenuFotoTop + globFileHome;
		}
	}
	if (strFrame != globMenuFotoBot) {
		if (boolFotoBot) {
			parent.frames[globMenuFotoBot].location.href = strPathMenuFotoBot + strDocname;
		} else
		{
			parent.frames[globMenuFotoBot].location.href = strPathMenuFotoBot + globFileHome;
		}
	}
	if (strFrame == globContentPath) {
		parent.frames[globContentPath].location.href = strPathContentPath + strDocname;
		return;
	}
	if (strFrame == globContentText) {
		parent.frames[globContentText].location.href = strTextContentText + strDocname;
		return;
	}
	if (strFrame == globContentTitl) {
		parent.frames[globContentTitl].location.href = strTitlContentTitl + strDocname;
		return;
	}
	if (strFrame == globContDesktop) {
		if (boolDesktop) {
			parent.frames[globContDesktop].location.href = strPathContDesktop + strDocname;
		} else
		{
			parent.frames[globContDesktop].location.href = strPathContDesktop + globFileHome;
		}
		return;
	}
	if (strFrame == globMenuContent) {
		if (isAll || isID && (navigator.appName.indexOf('Opera') != 0))
 		{
			//alert('standardmenü');
			// do nothing!
		} else {
			//alert('NS4-Menü');
			if (boolMenu) parent.frames[globMenuContent].location.href = strPathMenuContent + strDocname;
		}
		return;
	}
	if (strFrame == globMenuFotoTop) {
		if (boolFotoBot) {
			parent.frames[globMenuFotoTop].location.href = strPathMenuFotoTop + strDocname;
		} else
		{
			parent.frames[globMenuFotoTop].location.href = strPathMenuFotoTop + globFileHome;
		}
		return;
	}
	if (strFrame == globMenuFotoBot) {
		if (boolFotoBot) {
			parent.frames[globMenuFotoBot].location.href = strPathMenuFotoBot + strDocname;
		} else
		{
			parent.frames[globMenuFotoBot].location.href = strPathMenuFotoBot + globFileHome;
		}
		return;
	}
	
	alert('Datei/Funktion: frames.jss, setFames()\n\n' +
		'Der in der Variablen strFrame übergebene Frame\n' +
    '\"' + strFrame + '\" ist undefiniert.\n\n' +
    'Möglicherweise können die aufgerufenen Links nicht\n' + 
    'ausgeführt werden.\n\n' + 
    'Wenden Sie sich in diesem Fall an den Administrator dieser Domain\n' + 
    'oder an http://www.think-visually.de');
  return;
}  
function setFramesAndToggleMenu(mnuNr, strDocname, strFrame, boolDesktop, boolMenu, boolFotoTop, boolFotoBot) {
	if (mnuNr != '') toggleMenu(mnuNr);
	setFrames(strDocname, strFrame, boolDesktop, boolMenu, boolFotoTop, boolFotoBot);
}

