
/*Betrifft Javascript:
    bsc-comm, Andreas Bimminger 2002
    URL: http://www.bsc.at/


  Functionen: 
  	- popup(url, height, width);
  	- lexikon(begriff);
  	- lexikonfull(lexikon, buchstabe, begriffid);
  	- imageresize(url, popupWidth, popupHeight);
*/


function mypopup(url, myheight, mywidth)
	{
		
		var myleft;
		var mytop;
		
		myleft = 0;
		mytop = 0;
		
		if(myheight == null) myheight = 400;
		if(mywidth == null) mywidth = 300;

		if(screen.availHeight < myheight) myheight=screen.availHeight;

		if(screen.availWidth < mywidth) mywidth=screen.availWidth;
			
		mytop = Math.floor((screen.availHeight - myheight)/2);
		myleft = Math.floor((screen.availWidth - mywidth)/2);	
		
		if(url != null) 
			window.open(url, "_blank", "width="+mywidth+",height="+myheight+",left="+myleft+",top="+mytop+",resizable=yes,location=no,menubar=no,toolbar=no,scrollbars=yes");			
		else 
			alert("Leider ist ein Fehler aufgetreten. Kann den Link nicht finden!");
	}

function lexikon(begriff)
	{
		window.open("/content/lexikon.php?eintrag="+begriff, "lexikon", "width=450,height=300,left=150,top=150,resizable=yes,location=no,menubar=no,toolbar=yes,scrollbars=yes");
	}


function lexikonfull(lexikon, buchstabe, begriffid)
	{
		window.resizeTo(450,600);
		window.location = "/content/lexikon.php?lexikon=" + lexikon + "&buchstabe=" + buchstabe + "&noframe=2#lexikon" + begriffid;
	}

function imageresize(url, popupWidth, popupHeight)
	{
		var maxwidth;
		var maxheight;
		
		maxwidth = screen.width;
		maxheight = screen.height;
		
		if(maxheight == null ) maxheight = popupHeight;
		if(maxwidth == null ) maxwidth = popupWidth;

		window.open(url+"&screenHeight="+maxheight+"&screenWidth="+maxwidth, "_blank", "width="+popupWidth+",height="+popupHeight+",left=20,top=20,resizable=yes,location=no,menubar=no,toolbar=no,scrollbars=auto");
	}

function checkForFrames()
	{
		if(window.top.location != window.location)
			window.top.location = window.location;
	}
