// JavaScript Document // Scripts www.hgao.de// Jonas Karsten 2007// common Scripts all known browsers// Objektsuche im Dokumentfunction MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}// Swapimages mit verschiedenen Dateinamenfunction MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}/* vorladen der Over oder was immer-Buttons im Hintergrund erwartet zwei Strings, muss aus dem Body aufgerufen werden, als letztes searchStr ist die erweiterung die das schon existierende Stardard (MouseOut)immage kennzeichnet, Bsp.: off switchStr ist die Namenserweiterung , die dafuer gestezt werden soll, Dateien müssen existieren*/function PreloadNaviBMPs(searchStr,switchStr) { // v 0.9 AM	if(document.images) {		document.switchImgs = new Array();		for(i=0; i < document.images.length;i++ ) {			ImgSrcParts = (document.images[i].src).split(".");			URLfirstPart = '';			for(j=0;j<ImgSrcParts.length-1;j++) {				URLfirstPart = (URLfirstPart.concat(ImgSrcParts[j])).concat(".");			}			searchStrPos = document.images[i].src.lastIndexOf(searchStr);			if(searchStrPos > -1) {				menuBMPSrc = URLfirstPart.substring(0,searchStrPos)+switchStr+'.'+ImgSrcParts[(ImgSrcParts.length-1)];				document.switchImgs[i]=new Image; 				document.switchImgs[i].src=menuBMPSrc;			}		}	}/*	document.writeln("<div id=\"preloadLayer\" style=\"position:absolute; left:1px; top:1px; width:1px; height:1x; z-index:1; visibility: visible;\"\>");	document.writeln("	<img src=\""+menuBMPSrc+"\></img\>"); 	document.writeln("<div\>");	*/}// popup öffnenfunction OpenPopUp(windName,targURL) { //v 1.1 AM hieß erst fensterAuf	// requires configured vars docInfoWidth and docInfoHeight in HTML-File or somewhere else	if(screen.width < docInfoWidth) {	cleanTargWidth = screen.width;	} else {	cleanTargWidth = docInfoWidth;	}	if(screen.height < docInfoHeight) {	cleanTargHeight = screen.heigth;	} else {	cleanTargHeight = docInfoHeight;	}  attribs = 'toolbar=YES,location=YES,status=NO,menubar=NO,scrollbars=YES,resizable=YES,width=' + (String(cleanTargWidth)) + ',height=' + (String(cleanTargHeight)); // b u h wegen nc4	targPosX = Math.floor((screen.width-cleanTargWidth)/3);	targPosY = 550;  popWindow = window.open(targURL,windName,attribs);  popWindow.moveTo(0,0);	/* if(cleanTargHeight <> screen.heigth) {  	popWindow.resizeTo(cleanTargWidth,cleanTargHeight + 50); // wenn fenster schon offen	} else */  popWindow.focus();}// popUp so schließen, durch Home linkfunction ClosePopUpAndGoHome(homeURL) { // v. 1.0 AM	opener.location.href=homeURL; 	self.close();	opener.focus();}// Überwachung des korrekten Aufrufes eines popups// -----------------------------------------------// PopUp-seiting, überprüft, ob es opener gibt und FensterNAme richtig istfunction CheckOpener(myName,failURL) {	// called in PopUp itself, works togehter with function CheckCallByPopUp(popUpWindName,popUpURL) called in the mainpage	if(!opener || self.name != myName) { 	//alert(self.name);// 		 // alert(failURL+"?"+myName+"&"+location.pathname+"&"+location.search.substring(1,location.search.length));			location.replace(failURL+"?"+myName+"&"+location.pathname+"&"+location.search.substring(1,location.search.length));  // konvention ist, das 	}}// HauptSeiten-seitig schaut nach, ob sie vom Popup nachgeladen wurdefunction CheckCallByPopUp() { // v. 1.0 AM	// must be called in frameset, not in home	// works only togehther with CheckOpener(myName,failURL) called in PopUp		if(location.search != "") {		reqParts = location.search.substring(1,location.search.length).split("&"); 		// alert(reqParts);		// konvention ist, das erster Parameter der Window.name ist, der zweite der pathname und 		// die folgenden irgendwlche Parameter, die durchgereicht werden		popReq = reqParts[1] + "?";		for(i = 2; i < reqParts.length; i++ ) {			popReq = popReq + "&" + reqParts[i];		}		OpenPopUp(reqParts[0],popReq);	}}