// Browser abfragen
var ie = document.all
// var ns = document.layers
var ns = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4")
var ns6= document.getElementById&&!document.all
var aktiv = false

function moveMenu(x,y) {
	if (y < x) {
		y += 10; if (y>x+10) { y=x+10; window.setTimeout("position()",500); }
		document.all['MM'].style.top=y;
		window.status = "Y: "+y+" X: "+x;
		window.setTimeout("moveMenu(x,y),1");
	} else {
		y -= 10; if (y<x+10) { y=x+10; window.setTimeout("position()",500); }
		document.all['MM'].style.top=y;
		window.status = "Y: "+y+" X: "+x;
		window.setTimeout("moveMenu(x,y),1");
	}
}

// Positioniert das Menü nach dem Scrollen neu
function position() {
	if (ie||ns6) {
		z = document.all['MM'].style.top; 	// tatsächliche Position der Tabelle (wird mit px ausgegeben!!)
		var tmp = z.split("px");
		y = tmp[0]; y++; y--;
		x = document.body.scrollTop;	// jetzige Position des Fensters
//		window.status = "Y: "+y+" X: "+x;
		if (y-10 != x) {
//			moveMenu(x,y);
			document.all['MM'].style.top=document.body.scrollTop  + 0;
			document.all['M2'].style.top=document.body.scrollTop  + 12;
			document.all['M3'].style.top=document.body.scrollTop  + 40;
			document.all['M4'].style.top=document.body.scrollTop  + 96;
			document.all['M5'].style.top=document.body.scrollTop  + 70;
			document.all['M6'].style.top=document.body.scrollTop  + 278;
			document.all['M7'].style.top=document.body.scrollTop  + 155;
			document.all['M8'].style.top=document.body.scrollTop  + 195;
			if (ie)
				document.all['palm'].style.top=document.body.scrollTop + (document.body.offsetHeight - 190);
			else
				document.all['palm'].style.top=document.body.scrollTop + (innerHeight - 190);
		}
	} else {
		document.all['MM'].style.top=window.pageYOffset  + 0;
		document.all['M2'].style.top=window.pageYOffset  + 12;
		document.all['M3'].style.top=window.pageYOffset  + 40;
		document.all['M4'].style.top=window.pageYOffset  + 96;
		document.all['M5'].style.top=window.pageYOffset  + 70;
		document.all['M6'].style.top=window.pageYOffset  + 278;
		document.all['M7'].style.top=window.pageYOffset  + 155;
		document.all['M8'].style.top=window.pageYOffset  + 195;
		document.all['palm'].style.top=document.body.scrollTop + (innerHeight - 190);
	}
	window.setTimeout("position()",500);
}
function moveIn(x) {
	y = 0;
	document.all[x].style.left=y;
	document.all[x].style.visibility="visible";
	while (y < 135) {
		document.all[x].style.left=y;
		document.all[x].style.visibility="visible";
		y+=5;
	}
}
// Layer einblenden
function show_layer(x) {
//	h_layer(x);
//	aktiv = window.setTimeout("h_layer('"+x+"')",1);
	if (aktiv) window.clearTimeout(aktiv);
	if (ie||ns6) {
		document.all['M2'].style.visibility="hidden";
		document.all['M3'].style.visibility="hidden";
		document.all['M4'].style.visibility="hidden";
		document.all['M5'].style.visibility="hidden";
		document.all['M6'].style.visibility="hidden";
		document.all['M7'].style.visibility="hidden";
		document.all['M8'].style.visibility="hidden";
//		moveIn(x);
		document.all[x].style.visibility="visible";
//		return false;
	} else {
		document.all[x].style.visibility="visible";
		document.layers[M2].visibility="hide";
		document.layers[M3].visibility="hide";
		document.layers[M4].visibility="hide";
		document.layers[M5].visibility="hide";
		document.layers[M6].visibility="hide";
		document.layers[M7].visibility="hide";
		document.layers[M8].visibility="hide";
		document.layers[x].visibility="show";
	}
}

// Layer ausblenden - erst Verzögerung aktivieren
function hide_layer(x){
	aktiv = window.setTimeout("h_layer('"+x+"')",500);
}
function h_layer(x) {
	if (ie||ns6)
		document.all[x].style.visibility="hidden";
	else
		document.layers[x].visibility="hide";
}

/* Rechte Maus-Taste prüfen */
function right(e) {
	if (navigator.appName == 'Netscape' && 
			(e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && 
			(event.button == 2 || event.button == 3)) {
		alert("© 2005 Iris & Rudi Schneller \n\n     realized & designed\n      by DESIGNEN.net");
		return false;
	}
	return true;
}

var URL = document.URL;
var lokal = URL.search(/www/i);
if(lokal != -1) {
	document.onmousedown=right;
	if (document.layers) window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown=right;
}
/* Uhrzeit und Datum permanent aktualisieren*/
var hours, minutes, seconds;
var now, day, Jahresmonat, Monat, year;
/* window.setTimeout("view_time()",500); */
/* window.setTimeout("view_date()",500); */

function view_date() {
	now=new Date();
	day=now.getDate();
	Jahresmonat = now.getMonth();
	var Monat = new
		Array("Januar","Februar","M&auml;rz","April","Mai","Juni",
		"Juli","August","September","Oktober","November","Dezember");
	year=now.getYear();
	date=day+". "+Monat[Jahresmonat]+" "+year;
	datum.innerHTML=date;
	window.setTimeout("view_date()",3600000);
}

function view_time() {
	var uhr=document.getElementById('uhr');
	now=new Date();
	hours=now.getHours();
	minutes=now.getMinutes();
	seconds=now.getSeconds();
	StdAusgabe  = ((hours < 10) ? "0" + hours : hours);
	MinAusgabe  = ((minutes < 10) ? "0" + minutes : minutes);
	SekAusgabe  = ((seconds < 10) ? "0" + seconds : seconds);
	time=StdAusgabe+":"+MinAusgabe+":"+SekAusgabe;

//	pre_h=((hours<10)?"0":"");
//	pre_m=((minutes<10)?":0":":");
//	pre_s=((seconds<10)?":0":":");
//	time=pre_h+hours+pre_m+minutes+pre_s+seconds;

	uhr.innerHTML=time;
				
	if (time == "00:00:00") window.setTimeout("view_date()",500);

	window.setTimeout("view_time()",999);
}

/* Uhrzeit und Datum lesen */
function read_datetime() {
	now=new Date();
	day=now.getDate();
	Jahresmonat = now.getMonth();
	var Monat = new
		Array("Januar","Februar","M&auml;rz","April","Mai","Juni",
		"Juli","August","September","Oktober","November","Dezember");
	year=now.getYear();
	date=day+". "+Monat[Jahresmonat]+" "+year;

	now=new Date();
	hours=now.getHours();
	minutes=now.getMinutes();
	seconds=now.getSeconds();
	pre_h=((hours<10)?"0":"");
	pre_m=((minutes<10)?":0":":");
	pre_s=((seconds<10)?":0":":");
				
	time=pre_h+hours+pre_m+minutes+pre_s+seconds;
}

/* prüft, ob die Seite _top geöffnet wurde */
function FrameCheck () {
	if (!parent.lhMain) {
		alert("Sie rufen ein Fenster einzeln auf!\nDie komplette Seite wird nachgeladen.");
		top.location.href="/index.html";
	}
} /* FrameCheck */

function message (txt,zeit) { 
	window.status = txt;
	if (zeit)
		setTimeout("remove_message()",zeit);
}

function remove_message () { 
	window.status=""; 
}

function popup(datei,art) {
	breite = 500;
	var hoehe = 500;
	var pos_top = (screen.availHeight-hoehe)/2-65;
	var pos_left = (screen.availWidth-breite)/2-45;

	var daten = "height="+hoehe+",width="+breite+",resizable=no,scrollbars=yes,top="+pos_top+",left="+pos_left;

	window.open(datei, "PopupFenster", daten); 
//	PopupFenster = window.open(datei, "PopupFenster", daten); 
//	PopupFenster.focus();
}

// wie Popup aber ohne Scrollmöglichkeit
function popupNS(datei,art) {
	breite = 500;
	var hoehe = 500;
	var pos_top = (screen.availHeight-hoehe)/2-65;
	var pos_left = (screen.availWidth-breite)/2-45;

	var daten = "height="+hoehe+",width="+breite+",resizable=no,scrollbars=no,top="+pos_top+",left="+pos_left;

	window.open(datei, "PopupFenster", daten); 
//	PopupFenster = window.open(datei, "PopupFenster", daten); 
//	PopupFenster.focus();
}

function popupTS() {
	breite = 700;
	var hoehe = 500;
	datei = "http://www.travelsecure.de/travelsecure/travel.asp?partnerid=1-8-1047";
	var pos_top = (screen.availHeight-hoehe)/2-65;
	var pos_left = (screen.availWidth-breite)/2-45;

	var daten = "height="+hoehe+",width="+breite+",resizable=no,scrollbars=yes,top="+pos_top+",left="+pos_left;

	window.open(datei, "PopupFenster", daten); 
//	PopupFenster = window.open(datei, "PopupFenster", daten); 
//	PopupFenster.focus();
}

function showBigImage(bild) {
	var winProperties = "toolbar=no,location=no,directories=no,status=no,copyhistory=no,width=200,height=50,resizable=no";
	var url = "popup.php?bild="+bild;
	window.open(url,'big',winProperties);
}

function showBigAni(pfad) {
	var winProperties = "toolbar=no,location=no,directories=no,status=no,copyhistory=no,width=200,height=50,resizable=no";
	var url = "popup_ani.php?bild="+pfad;
	window.open(url,'big',winProperties);
}

FrameCheck();
