//fenster oeffnen
function openwin(file, name, width, height, left, top, scrollbars)
{
	if(window.opened_win && !window.opened_win.closed)
	{	
		opened_win.close();
	}
		if(left == null || left == "")
		{
			left = (screen.availWidth/2) - (width/2);
		}
		if(top == null || top == "")
		{
			top = (screen.availHeight/2) - (height/2);
		}
		if(scrollbars == null || scrollbars == "")
		{
			scrollbars = "no";
		}
		
		try
		{
			opened_win = window.open(file, name, "width="+width+", height="+height+", left="+left+", top="+top+", location=no, menubar=no, resizable=no, scrollbars="+scrollbars+", status=yes, toolbar=no");
			if(!opened_win || typeof(opened_win) != 'object' || opened_win.closed)
			{
      			throw "popup_failed"; 
   			}
				
			opened_win.focus();
		}
		catch(e)
		{
			if ( e == "popup_failed" )
			{
      			return false;
   			}
		}
	return opened_win;
}

