// Function ViewImage ---------------------------------------------------------
// www.web-toolbox.net , W. Jansen
// Übergabeparameter: bildquelle,breite,höhe,bildtitel
// hand over parameters: imagesource,width,height,title

function ViewImage(bildurl,b,h,bildtitel)
{
	var eigenschaft,sbreite,shoehe,fenster,b,h;

	// stellt die Bildschirmabmessungen fest
	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	var ns4 = (document.layers);

	if(ns6||ns4) {
		sbreite = innerWidth;
		shoehe = innerHeight;
	}
	else if(ie4) {
		sbreite = document.body.clientWidth;
		shoehe = document.body.clientHeight;
	}

	x = (sbreite-b)/2;
	y = (shoehe-h)/2;

	eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+b+",height="+h+",menubar=no,toolbar=no";

	fenster=window.open("","",eigenschaften);
	fenster.focus();
	fenster.document.open();
	with (fenster) {
		document.write('<html><head>');
//		document.write("<script type='text/javascript' language='JavaScript'>");
//		document.write("function click() { window.close(); } ");  // bei click  schliessen
//		document.write("document.onmousedown=click ");
//		document.write("</script>");
		document.write('<title>'+ bildtitel +'</title></head>');
		document.write('<body bgcolor="#000000" onblur="window.close()" '); // bei Focusverlust schliessen
		document.write('marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">');
		document.write('<center>');
		document.write('<img src="'+ bildurl +'"border="0">');
		document.write('</center>');
		document.write('</body></html>');
		fenster.document.close();
	}
}
// End of Function ViewImage ----------------------------



// Function TextPop -------------------------------------
// <a href="javascript:TextPop('http://www.deinedomain.de/seite.html','textpopup','640','480','center','front');">LinkText</a>
function TextPop(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}
// End of Function TextPop ------------------------------



// --------------------------------------------------------------------------------------
// http://www.webmaster-resource.de/tricks/javascript/grafik-passend-in-einem-popup-fenster-oeffnen.php
// ...S  mit Scrollbar und resizable
function GrafikAnzeigenS(GrafikURL, Breite, Hoehe)
{
	Fensteroptionen="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1";

	Grafikfenster=window.open("", "", Fensteroptionen + ',width=' + Breite + ',height=' + Hoehe);
	Grafikfenster.focus();
	Grafikfenster.document.open();
	with(Grafikfenster)
	{
		document.write("<html><head>");
		document.write("<title>Grafikanzeige</title>");
		document.write("</head>");
		document.write("<body leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\">");
		document.write("<img border=\"0\" onclick=\"window.close();\" src=\""+ GrafikURL +"\" title=\"Zum Schließen auf das Foto klicken\">");
		document.write("</body></html>");
		Grafikfenster.document.close();
	}
}
// End of Function GrafikAnzeigenS ------------------------------



// --------------------------------------------------------------------------------------
// Stadtplan mit Chalets anzeigen
function FewoPlan(fewoname, x, y)
{
	Fensteroptionen="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1";

	Grafikfenster=window.open("", "", Fensteroptionen + ',width=663,height=1060');
	Grafikfenster.focus();
	Grafikfenster.document.open();
	with(Grafikfenster)
	{
		document.write("<html><head>");
		document.write("<title>" + fewoname + "</title>");
		document.write("</head>");
		document.write("<body style=\"margin:0; padding:0; background-color:#bfb;\">");
		document.write("<img src=\"../mf-stadtplan.gif\" alt=\"\" width=\"640\" height=\"1060\" border=\"0\">");
		document.write("<div style=\"position:absolute; margin:-15px 0 0 -15px; left:"+ x +"px; top:"+ y + "px;\"><img src=\"../fewokreis.gif\" width=\"30\" height=\"30\" alt=\"" + fewoname + "\"></div>");
		document.write("</body></html>");
		Grafikfenster.document.close();
	}
}
// End of Function FewoPlan ------------------------------