	// Zamykanie wszystkich okienek CMSa
	function Zamknij_wszystkie(){
		Windows.closeAll();
	}
    
	// Przywracanie wszystkich okienek CMSa
	function Przywroc_wszystkie(){
		Windows.restoreAll();
	}		
	
	// id nowego okna
	var windowLastId = 0;
		
	function CPwindow(elem, id, title, width, height)
	{						
		if (document.getElementById(id)!=null)
		{
			Windows.getWindow(id).toFront();
			return false;
		}	
        
		jQuery('#admin-taskbar').append('<a class="otwarte_okienko" rel="'+ id +'" onclick="Windows.getWindow(\''+id+'\').show(); Windows.getWindow(\''+id+'\').toFront();">' + title + '</a>');	
												
		var win = new Window(
						id, 
						{
							className: "mac_os_x", 
							title: title,
							top: 15,
							left: 10,
					  		width: width != undefined ? width : 500, 
					  		height: height != undefined ? height : 300, 
					  		url: elem.href, 
							minWidth: 675,
							minHeight: 300,
							recenterAuto: true,
					  		showEffectOptions: { duration: 0 },
							hideEffectOptions: { duration: 0 }
					  	}
					 );
					  
		win.setDestroyOnClose();
		
		// zapamietywanie lokalizacji okienka
		date = new Date();
		date.setMonth(date.getMonth()+3);
		win.setCookie(id, date);
		
		win.show();
		

		
		return false;
	}
	
	
	function CPwindowURL(elem, id, title, width, height, url)
	{						
		if (document.getElementById(id)!=null){
			Windows.getWindow(id).toFront();
			return false;
		}			
			
		jQuery('#admin-taskbar').append('<a class="otwarte_okienko" rel="'+ id +'" onclick="Windows.getWindow(\''+id+'\').show(); Windows.getWindow(\''+id+'\').toFront();">' + title + '</a>');
            									
		var win = new Window(
						id, 
						{
							className: "mac_os_x", 
							title: title,
							top: 15,
							left: 10,
					  		width: width != undefined ? width : 500, 
					  		height: height != undefined ? height : 300, 
					  		url: url, 
							minWidth: 675,
							minHeight: 300,
							recenterAuto: true,
					  		showEffectOptions: { duration: 0 },
							hideEffectOptions: { duration: 0 }
					  	}
					 );
					  
		win.setDestroyOnClose();
		
		// zapamietywanie lokalizacji okienka
		date = new Date();
		date.setMonth(date.getMonth()+3);
		win.setCookie(id, date);
		
		win.show();
		

		
		return false;
	}	