//alert("Hurra die Gams aus frame_functions");

// Grafiken fuer oberen div

Oben1 = new Image();
Oben1.src = "../top/ccddf1_180x75.gif";     /* 1. Standard-Grafik */

Oben2 = new Image();
Oben2.src = "../top/de_top.gif";     /* 2. Standard-Grafik */

// Grafiken fuer unteren div

Unten1 = new Image();
Unten1.src = "../top/home01.jpg";     /* 3. Standard-Grafik */

Unten2 = new Image();
Unten2.src = "../top/produkte01.jpg";     /* 4. Standard-Grafik */

Unten3 = new Image();
Unten3.src = "../top/umw-gef_01.jpg";     /* 5. Standard-Grafik */

Unten4 = new Image();
Unten4.src = "../top/pro-han_01.jpg";     /* 6. Standard-Grafik */

Unten5 = new Image();
Unten5.src = "../top/cleaning.jpg";     /* 7. Standard-Grafik */

//Unten6 = new Image();
// Unten6.src = "../top/arb-psa_01.jpg";     /* 8. Standard-Grafik */

Unten7 = new Image();
Unten7.src = "../top/gefahrstofflagertechnik-it.jpg";     /* 9. Standard-Grafik */

Unten8 = new Image();
Unten8.src = "../top/waermetechnik-it.jpg";     /* 10. Standard-Grafik */

//Unten9 = new Image();
// Unten9.src = "../top/lufttechnik.jpg";     /* 11. Standard-Grafik */

//Unten10 = new Image();
// Unten10.src = "../top/it-technik.jpg";     /* 12. Standard-Grafik */

Unten11 = new Image();
Unten11.src = "../top/projekt.jpg";     /* 13. Standard-Grafik */


// Farbwerte fuer Schmuck div + Links

farbe1 = "#99b2d3";
farbe2 = "#86a290";
farbe3 = "#ff9966";
farbe4 = "#ffcc66";

//linkStandard = "#003366"; // blau
linkStandard = ""; // blau
linkAktiv = "#990000"; // rot


function Bildwechsel(BildobjektOben,BildobjektUnten) {
	parent.topFrame.window.document.images[0].src = BildobjektOben.src;
	parent.topFrame.window.document.images[1].src = BildobjektUnten.src;
}

function Farbwechsel(farbe) {
	//parent.topFrame.window.document.getElementById("farbig").className = "darkbg";
	parent.topFrame.window.document.getElementById("farbig").style.backgroundColor = farbe;
}

function kopfframe(seite) {
	if(seite == 'home'){
		parent.topFrame.window.document.getElementById("home").className = "aktiv";
		parent.topFrame.window.document.getElementById("impressum").className = "passiv";
		parent.topFrame.window.document.getElementById("sitemap").className = "passiv";
	} else if(seite == 'sitemap'){
		parent.topFrame.window.document.getElementById("sitemap").className = "aktiv";
		parent.topFrame.window.document.getElementById("home").className = "passiv";
		parent.topFrame.window.document.getElementById("impressum").className = "passiv";
	} else if(seite == 'impressum'){
		parent.topFrame.window.document.getElementById("impressum").className = "aktiv";
		parent.topFrame.window.document.getElementById("home").className = "passiv";
		parent.topFrame.window.document.getElementById("sitemap").className = "passiv";
	} else {
		parent.topFrame.window.document.getElementById("impressum").className = "passiv";
		parent.topFrame.window.document.getElementById("home").className = "passiv";
		parent.topFrame.window.document.getElementById("sitemap").className = "passiv";
	}
}

/* function neueSeite(URL, BildobjektOben, BildobjektUnten, farbe){
	top.mainFrame.location.href = URL; // Seite in Hauptframe laden
	Bildwechsel(BildobjektOben,BildobjektUnten); // Bilder autauschen
	Farbwechsel(farbe); // Farbe autauschen
	return;
} */

	
function frameChecken(BildobjektOben, BildobjektUnten, farbe, seite) {
	//alert("Hurra die Gams aus frameChecken vorher");
	var h = window.location.hostname; // host
	var p = window.location.pathname; // pfad
	var hr = window.location.href; // kompletter URL
	var re = new RegExp('/([^\/]+)/([^\/]+)$'); // regex zur Isolierung des Ordnerpfades
	var m = re.exec(hr);
	//alert("ausserhalb ");
	//alert("m0 = " + m[0]);
	//alert("m1 = " + m[1]);
	//alert("m2 = " + m[2]);
	//var tl = top.location;
	//var fs = re.exec(tl);
	//alert("fs0 = " + fs[0]);
	//alert("fs1 = " + fs[1]);
	//alert("fs2 = " + fs[2]);
	if (top.fs_loaded != 1) {
		//alert("innerhalb ");
		//alert(m[2]);
		//top.location.replace('../index.html?' +m[0]); // wenn Seite NICHT als top-Seite erscheinen soll: Ordnerpfad in URL uebergeben
		if (screen.width <= 800) { top.location.replace('../start_800.html?' +m[0]);}
		if (screen.width > 800) { top.location.replace('../index.html?' +m[0]);}
		//else {top.location.replace('../index.html?' +m[0]);}
	} else { 
		Bildwechsel(BildobjektOben,BildobjektUnten); // Bilder autauschen
		Farbwechsel(farbe); // Farbe autauschen
		kopfframe(seite); // Link im oberen Frame aktivieren?
	}
}


function changePages(obenURL,untenURL){
			parent.topFrame.location.href = obenURL;
			parent.mainFrame.location.href = untenURL;
			}
			
function changePage(untenURL){
			parent.mainFrame.location.href = untenURL;
			}			
