// Nur für IE 5+ und NN 6+

ie5=(document.getElementById && document.all && document.styleSheets)?1:0;
nn6=(document.getElementById && !document.all)?1:0;


// Kontextmenü initialisieren

if (ie5 || nn6) 
{

menuWidth=120;
menuHeight=150;
menuStatus=0; 

document.write(

		"<div id='menu' style='position:absolute;top:-250;left:0;z-index:100'>"+
		"<table cellpadding='3' cellspacing='1' width='"+menuWidth+"' height='"+menuHeight+"' bgcolor='#846F56'>"+
		"<tr><td bgcolor='#4F381B' align='center'><b>Kontextmenü</td></tr>"+
		"<tr><td bgcolor='#735E44' id='m1' onmouseover='document.getElementById(this.id).style.backgroundColor=\"#867158\"' onmouseout='document.getElementById(this.id).style.backgroundColor=\"#735E44\"' onclick='location.href=\"javascript:history.back()\"' style='cursor:pointer;'> >> Zur&uuml;ck</td></tr>"+
		"<tr><td bgcolor='#735E44' id='m2' onmouseover='document.getElementById(this.id).style.backgroundColor=\"#867158\"' onmouseout='document.getElementById(this.id).style.backgroundColor=\"#735E44\"' onclick='location.href=\"javascript:history.forward()\"' style='cursor:pointer;'> >> Vorw&auml;rts</td></tr>"+
		"<tr><td bgcolor='#4F381B' height='5'><img src=\"bilder/space.gif\" height=\"5\"></td></tr>"+
		"<tr><td bgcolor='#735E44' id='m3' onmouseover='document.getElementById(this.id).style.backgroundColor=\"#867158\"' onmouseout='document.getElementById(this.id).style.backgroundColor=\"#735E44\"' onclick='location.href=\"javascript:location.reload()\"' style='cursor:pointer;'> >> Aktualisieren</td></tr>"+
		"<tr><td bgcolor='#735E44' id='m4' onmouseover='document.getElementById(this.id).style.backgroundColor=\"#867158\"' onmouseout='document.getElementById(this.id).style.backgroundColor=\"#735E44\"' onclick='location.href=\"javascript:viewSource()\"' style='cursor:pointer;'> >> Quelltext</td></tr>"+
		"<tr><td bgcolor='#4F381B' height='5'><img src=\"bilder/space.gif\" height=\"5\"></td></tr>"+
		"<tr><td bgcolor='#735E44' id='m6' onmouseover='document.getElementById(this.id).style.backgroundColor=\"#867158\"' onmouseout='document.getElementById(this.id).style.backgroundColor=\"#735E44\"' onclick='location.href=\"javascript:openFrameInNewWindow()\"' style='cursor:pointer;'> >> Neues Fenster</td></tr>"+
		"</table></div>");



	// Rechter Mausklick: Menü anzeigen, linker Mausklick: Menü verstecken

	document.oncontextmenu=showMenu; //oncontextmenu geht nicht bei NN 6.01

	document.onmouseup=hideMenu;
}

// Kontextmenü anzeigen
function showMenu(e) {

	if(ie5) {

		if(event.clientX>menuWidth) xPos=event.clientX-menuWidth+document.body.scrollLeft;

		else xPos=event.clientX+document.body.scrollLeft;

		if (event.clientY>menuHeight) yPos=event.clientY-menuHeight+document.body.scrollTop;

		else yPos=event.clientY+document.body.scrollTop;

	}

	else {

		if(e.pageX>menuWidth+window.pageXOffset) xPos=e.pageX-menuWidth;

		else xPos=e.pageX;

		if(e.pageY>menuHeight+window.pageYOffset) yPos=e.pageY-menuHeight;

		else yPos=e.pageY;

	}

	document.getElementById("menu").style.left=xPos;

	document.getElementById("menu").style.top=yPos;

	menuStatus=1;

	return false;

}



// Kontextmenü verstecken

function hideMenu(e) {

	if (menuStatus==1 && ((ie5 && event.button==1) || (nn6 && e.which==1))) {

		setTimeout("document.getElementById('menu').style.top=-250",250);

		menuStatus=0;

	}
}



// Quelltext anzeigen

function viewSource() {

	var w=window.open("view-source:"+window.location,'','resizable=1,scrollbars=1');

}



// Seite in neuem Fenster öffnen

function openFrameInNewWindow() {

	var w=window.open(window.location,'','resizable=1,scrollbars=1,status=1,location=1,menubar=1,toolbar=1');

}
