//---------------------------------------------------------------------------------------	
//scripte fuer Schubert Wintergarten 
//author michael schulze, www.ju-mi.com, 2007
//---------------------------------------------------------------------------------------	

//---------------------------------------------------------------------------------------	
//allgemeine scripts
	// Styleswitch und LayerRef
	// Funktionsaufruf fuer NS 4-Reload
	function initBrowser(){
		if (document.layers) {
			layerStyleRef="layer.";
			layerRef="document.layers";
			styleSwitch="";
			ns6="";
			pix="";
		}
		else if (document.getElementById) { //Netscape 6,7, IE 5,6
			layerStyleRef="layer.";
			layerRef="document.getElementById(";
			styleSwitch=").style";
			ns6=")";
			pix="px";
		}
		else {
			layerStyleRef="layer.style.";
			layerRef="document.all";
			styleSwitch=".style";
			ns6="";
			pix="";
		}
		
	}
	
	
//---------------------------------------------------------------------------------------	
// Ebenenfunktionen

	// Netscape Layer Bug (Dreamweaver-Loesung)
	function MM_reloadPage(init) {  file:
	  if (init==true) with (navigator) {
		  	if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		    	document.MM_pgW=innerWidth; 
				document.MM_pgH=innerHeight; 
				onresize=MM_reloadPage; 
			}
		}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);
	

	
	
//---------------------------------------------------------------------------------------	
//Formular-Funktionen
	function initForm(name){
		if (document.layers) {eval('ref="document.text.document.' + name + '";');}
		else				 {eval('ref="document.' + name + '";');}
	}
	
	function clearForm(name){
		if (confirm('Wollen Sie Ihre Angaben wirklich verwerfen?') == true) {
			initForm(name);
			eval(ref + '.reset()');
		}
	}


	

//---------------------------------------------------------------------------------------	
// diverse Funktionen

	// Druckansicht
	function druckAnsicht(url){
		x_coord= (screen.width-640)/2;
		y_coord= (screen.height-480)/2;
		eval ("druck=window.open('_main/sbw_druckansicht.php?" + url + "','druck','width=640,height=480,resizable=no,scrollbars')");
		druck.moveTo(x_coord,y_coord);
		druck.focus();
	}
	
	// Bildzoom
	function bildZoom(url,breite,hoehe){
		x_coord= (screen.width-breite)/2;
		y_coord= (screen.height-hoehe)/2;
		eval ("zoom=window.open('sbw_bildzoom.php?image=" + url + "','zoom','width=" + breite + ",height=" + hoehe + ",location=no,status=no,resizable=no')");
		zoom.moveTo(x_coord,y_coord);
		zoom.focus();
	}
	
	// Bildzoom Diashow
	function bildZoomDia(url,breite,hoehe,id,pos,bildmax){
		x_coord= (screen.width-breite)/2;
		y_coord= (screen.height-hoehe)/2;
		breite=breite+60;
		hoehe=hoehe+60;
		eval ("diashow=window.open('sbw_bildzoom_dia.php?image=" + url + "&bild=" + id + "&pos=" + pos + "&max=" + bildmax + "','diashow','width=" + breite + ",height=" + hoehe + ",location=no,status=no,resizable=no')");
		diashow.moveTo(x_coord,y_coord);
		diashow.focus();
	}
	
	// Diashow weiter/vor
	function diaGoto(url,breite,hoehe,id,pos,bildmax,dia){
		breite=breite+60;
		hoehe=hoehe+140;
		eval ("location.href='sbw_bildzoom_dia.php?image=" + url + "&bild=" + id + "&pos=" + pos + "&max=" + bildmax + "&dia=" + dia + "','diashow','width=" + breite + ",height=" + hoehe + ",location=no,status=no,resizable=no';");
		window.resizeTo(breite,hoehe);
	}