function checkFrame(framename,navFrame) {

	fr = eval(framename);

	if (fr) {
		if (fr.location.href.indexOf(str1)!=-1) {
			if (navFrame) {
				str = fr.location.href.replace(fr.location.search,'');
				str += '?active=' + fr.active;
			} else str = fr.location.href;
				
			fr.location.replace(str.replace(str1,str2));
		}
	}

	return true;
}


function checkLanguage(lang) {

	if (lang=="en") {
		str1 = "deutsch/";
		str2 = "english/";			
	} else {
		str1 = "english/";
		str2 = "deutsch/";
	}
	
	if (!top.schiedelFrame) {
		if (self.location.hostname.length>0) {
			top.location.replace("http://www.f-schiedel-stiftung.at/");
		}
	} else { 
		checkFrame("top.schiedelFrame",0);
	}
	
	checkFrame("top.leftFrame",1);
	
	if ((top.mainFrame) && (top.mainFrame.frames.length>0)) {
		checkFrame("top.mainFrame.titelFrame",0);
		checkFrame("top.mainFrame.subnavFrame",1);
	}

	return true;
}