var secondWnd;				
	       		
jQuery.createWindow = function(url, options)
{
	var width = options.width ? ''+options.width : '640';
	var height = options.height ? ''+options.height : '480';
	var scrollbars = options.scrollbars != null ? ''+options.scrollbars : '0';
	var resizable = options.resizable != null ? ''+options.resizable : '1';
	var isFront = options.isFront != null ? options.isFront : true;
	
	var parameter = '"width='+ width +',height='+ height +',scrollbars='+ scrollbars +',resizable='+ resizable +'"';
		
	if(isFront)
	{	
		jQuery(document).click(function(){
			if(secondWnd != null)
			{
				secondWnd.focus();
			}						
		});
	}
			
	if(secondWnd != null && secondWnd.closed == false) //wenn ein zweites Fenster existiert abfragen ob es durch den neuen Inhalt überschrieben werden soll
   	{
   		secondWnd.focus();
     
     	var agent = navigator.userAgent.toLowerCase(); // hack nur für Safari, sonst bekommt das zweitfenster nicht den Fokus
       	if (agent.indexOf("safari") >-1 ) 
       	{
       		blur();
     	}

       	var msg = 'Soll der Inhalt dieses Fensters '+unescape('%fc')+'berschrieben werden?';
      
     	var bestaetigung = secondWnd.confirm(unescape(msg));

     	if(bestaetigung) 
     	{ // Ok wurde gedrückt
       		secondWnd = window.open(url, "Zweitfenster",  parameter);
       		secondWnd.resizeTo(width, height);
       		secondWnd.focus();	               		
     	}
     	else 
     	{
     		secondWnd.focus();
     	}		             
   	}
   	else
   	{
		secondWnd = window.open(url, "Zweitfenster", parameter);
     	secondWnd.resizeTo(width, height);
     	secondWnd.focus();
   	}	   
}