/**************************************************/
/* Global Scripting Functions                     */
/**************************************************/
/* Ingenieurbüro Groth                            */
/**************************************************/
/* (C) EXYST Internet, ruby@exyst.de              */
/**************************************************/

//### Framework nachladen ###
// Überprüft für jede Seite, ob alle Frames (z.B. Menüleiste etc.) vorhanden sind.
if ( top == self ) {								// Wenn es kein Framework gibt ...
	var LH = location.href;
	var datei = LH.substring(LH.lastIndexOf('/')+1, LH.length);  //Host+Pfad abschneiden
	//alert("Kein Framework vorhanden!\nAufgerufene Datei: '"+datei+"'  (ex_global.js).");
	var indatei = datei;
	if (location.search != '') {  //Datei enthält Search-String
		indatei = LH.substring(LH.indexOf('?')+1, LH.length);  //Search extrahieren
		datei = datei.substring(0, datei.indexOf('?'));  //Datei extrahieren
		//alert("Kein Framework vorhanden! Datei enthält Search-String\nDatei ohne Search: '" + datei + "'\nSearch-String: '" + indatei + "'  (ex_global.js).");
	}
	
	if (datei=='' || datei=='index.html') datei = 'index.htm';
	if (datei != 'index.htm') {						// und wenn es nicht die Startseite ist ...
		var iscontentfile = true;					// dann lade das gesamte Framework nach mit der aufgerufenen Seite als Inhaltsframeseite:
		// Wenn die aufgerufene Seite keine Inhalts-, sondern eine Frameworkseite ist, dann lade die gesamte Homepage ganz normal:
		var framepages = ["menue.htm", "oben.htm", "rechts.htm", "x-links.htm", "x-oben.htm", "x-rechts.htm", "x-unten.htm"];
		for (i=0;i<framepages.length;i++) { 
			if (datei == framepages[i]) {
			  top.document.location.replace('../index.htm'); 
			  iscontentfile = false;
			}
		}
		if (iscontentfile) {
		  //alert("Framework wird nachgeladen mit "+indatei+"  (ex_global.js)");
		  top.document.location.replace('index.htm?' + indatei);
		}
	}
}

//### Ändert die 2 Collagen-Bilder oben und rechts vom Main-Frame aus. ###
function collage(bild_ob,bild_re) {
	if (top.frames['fmenue']) {
		//var imgpath = (document.all) ? "../img/" : "img/";
		var imgpath = "../img/";
		top.foben.document.collage_ob.src   = imgpath + bild_ob;
		top.frechts.document.collage_re.src = imgpath + bild_re;
	}
	else { alert(); }
}

