
// ------------------------------------------------------------
// TYPO3-Funktionen
// ------------------------------------------------------------
function openPic(url,winName,winParams)	{	//
	var theWindow = window.open(url,winName,winParams);
	if (theWindow)	{theWindow.focus();}
}
// ------------------------------------------------------------


// Window-Status permanent setzen
window.status = "...Zahnzentrum Lübeck...";

// ------------------------------------------------------------
// Ändert den Text in der Statuszeile des Browserfensters.
// ------------------------------------------------------------
function stat(aname) {
	var text;
	text = aname;
	if ( aname == '1' ) { text = '...Startseite...'; }
	if ( aname == '2' ) { text = '...Praxis...'; }
	if ( aname == '3' ) { text = '...Diagnostik...'; }
	if ( aname == '4' ) { text = '...Therapien...'; }
	if ( aname == '5' ) { text = '...Patienteninfo...'; }
	if ( aname == '6' ) { text = '...Kontakt...'; }
	if ( aname == '7' ) { text = '...Links...'; }
	window.status = text;
	return true;
}
// Setzt die Statuszeile des Browserfensters wieder zurück.
function s_off () {
	window.status = "...Zahnzentrum Lübeck...";
	return true;
}
// ------------------------------------------------------------


// ------------------------------------------------------------
// Open_Window: Neues Fenster öffnen
// ------------------------------------------------------------
function blank_window(url) {
	var blank_win = window.open( url, "blankwindow" );
	 return false;
}
function open_window(url, x, y) {
	if (x && x != "") { width = x; } else { width = 600; }
	if (y && y != "") { height = y + 17; } else { height = 507; }
	var zoom_win = window.open(url, "openwindow", "width="+width+",height="+height+",scrollbars=yes,menubar=no,toolbar=no,location=no,status=yes,resizable=yes,top=0,left=0");
}
function open_window_full(url) {
	var zoom_win = window.open(url, "openwindowfull", 'width=' + screen.availWidth + ',height=' + screen.availHeight + ',top=0,left=0,scrollbars=auto,menubar=yes');
}
// ------------------------------------------------------------


// ------------------------------------------------------------
// Allgemeine Image-Changer
// ------------------------------------------------------------
function chg (ImageName, FileName) {
	document[ImageName].src = "/fileadmin/template/zzl/images/" + FileName;
	return true;
}
// ------------------------------------------------------------


// ------------------------------------------------------------
// Einzelne Menü-Items An-/Ausschalten
// ------------------------------------------------------------
function navon(Name) {
	document[Name].src = "/images/nav/" + Name + "_m.gif";
	return true;
}
function navoff(Name) {
	document[Name].src = "/images/nav/" + Name + ".gif";
	return true;
}
function navoff_s(Name) {
	document[Name].src = "/images/nav/" + Name + "_s.gif";
	return true;
}
// ------------------------------------------------------------


// ------------------------------------------------------------
// Formular-Elemente hervorheben
// ------------------------------------------------------------
// Element hervorheben
var fade_start = 60;
var fade_end = 95;
var counter = 0;	// Schutzmechanismus
function FocusElement (obj) {
	counter = 0;
	if (document.getElementById || document.all) {
		document.all[obj].style.backgroundColor = "#EFEFDD";
		document.all[obj].style.fontWeight = "bold";
		if( document.all[obj].filters.alpha.opacity ) { fadein( obj ) };
	}
}
function BlurElement (obj) {
	counter = 0;
	if (document.getElementById || document.all) {
		document.all[obj].style.backgroundColor = "#EEEEEF";
		document.all[obj].style.fontWeight = "normal";
		if( document.all[obj].filters.alpha.opacity ) { fadeout(obj); }
	}
}
function fadein (obj) {
	if( counter <= 30 ) {
		if(document.all[obj].filters.alpha.opacity < fade_end) {
			document.all[obj].filters.alpha.opacity += 3;
			counter++;
			setTimeout("fadein('"+obj+"')",1);
		}
	}
}
function fadeout (obj) {
	if( counter <= 30 ) {
		if(document.all[obj].filters.alpha.opacity > fade_start) {
			document.all[obj].filters.alpha.opacity -= 3;
			counter++;
			setTimeout("fadeout('"+obj+"')",1);
		}
	}
}

// Navigation Highlighting inkl. Transparency Effekt
function high_on(obj, color) {
	if( obj.style ) {
		if( ! color || color == "" ) {
			// obj.style.background='#5E6669';
		} else {
			obj.style.background=color;
		}
		if( obj.filters ) {
			obj.style.filter="progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=70 )";
		} else if ( obj.style.MozOpacity ) {
			obj.style.MozOpacity = 0.7;
		}
	}
	return true;
}
function high_off(obj) {
	if( obj.style ) {
		obj.style.background='';
		if( obj.filters ) {
			obj.style.filter="progid:DXImageTransform.Microsoft.Alpha( style=0,opacity=100 )";
		} else if ( obj.style.MozOpacity ) {
			obj.style.MozOpacity=1.0;
		}
	}
	return true;
}

// Swap-Image mit Fading-Effekt von AIZ
function MM_swapImage(obj) { //v3.0
  if( obj.filters ) { obj.style.filter = "progid:DXImageTransform.Microsoft.fade(duration=1.5)"; }
  // alert( "test: " + obj.style.filter );
  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;
		// Abwandlung für Transition
		if( obj.filters ) { 
			obj.filters[0].Apply();
			obj.src = a[2];
			obj.filters[0].Play();
		}
		x.src=a[i+2];
      }
   }
}
function findObj(n, d) {
  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;
}

// Layer verstecken/zeigen
function hideLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "hidden";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.visibility = "hidden";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "hidden";
	}
}
function showLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "visible";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.visibility = "visible";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "visible";
	}
}

// ------------------------------------------------------------
// Div ein-/ausblenden, http://www.technorealm.co.uk/scripts/mouseovershowtext.html
// ------------------------------------------------------------
function toggleDiv(id,flagit) {
	if (flagit=="1"){
		if (document.layers) document.layers[''+id+''].visibility = "show"
		else if (document.all) {
			document.all[''+id+''].style.visibility = "visible";
			// document.all[''+id+''].style.display = "block";
		} else if (document.getElementById) {
			document.getElementById(''+id+'').style.visibility = "visible";
			// document.getElementById(''+id+'').style.display = "block";
		}
	} else if (flagit=="0"){
		if (document.layers) document.layers[''+id+''].visibility = "hide"
		else if (document.all) {
			document.all[''+id+''].style.visibility = "hidden";
			// document.all[''+id+''].style.display = "none";
		} else if (document.getElementById) {
			document.getElementById(''+id+'').style.visibility = "hidden";
			// document.getElementById(''+id+'').style.display = "none";
		}
	}
}
// ------------------------------------------------------------

// Browser-Größe auslesen
/*if( document.body.offsetWidth ) {
	windowWidth = document.body.offsetWidth-20
	windowHeight = document.body.offsetHeight-4
} else {
	windowWidth = window.innerWidth;
	windowHeight = window.innerHeight;
}*/
// ------------------------------------------------------------

// Image-Preload
/* function preload () {
	if (document.images) {
		var jscr = new Array();
		for (var i = 0; i < 7; i++) { jscr[i] = new Image(); }
		var dir = "/images/nav/";
		jscr[1].src = dir + "xxx_m.gif";
		jscr[2].src = dir + "heilpraktiker_kontakt_m.gif";
		jscr[3].src = dir + "naturheilpraxis_m.gif";
		jscr[4].src = dir + "osteopathie_links_m.gif";
		jscr[5].src = dir + "patienteninfo_naturheilkunde_m.gif";
		jscr[6].src = dir + "therapie_luebeck_m.gif";
	}
}*/

