		var newWindow;

		function checkWindow() {
			if (newWindow){
				newWindow.close();
			}
		}
	
		function question(id,wysokosc,szerokosc) {
			checkWindow(); 			
      var winl = (screen.width - szerokosc) / 2;
      var wint = (screen.height - wysokosc - 150 ) / 2;
			newWindow = window.open('msg_pop.php?id='+id,'question','top='+wint+',left='+winl+',align=center,toolbar=no,status=no,location=no,directories=no,resizable=no,scrollbars=auto,width='+szerokosc+',height='+wysokosc+',menubar=no, dependent=yes');						
			newWindow.document.close();
		}
		
	
		function wykres() {
			checkWindow(); 		

			var wysokosc 	= 570	
			var szerokosc = 514	

      var winl = (screen.width - szerokosc) / 2;
      var wint = (screen.height - wysokosc - 150 ) / 2;
			newWindow = window.open('wykres.php','wykres','top='+wint+',left='+winl+',align=center,toolbar=no,status=no,location=no,directories=no,resizable=no,scrollbars=auto,width='+szerokosc+',height='+wysokosc+',menubar=no, dependent=yes');						
			newWindow.document.close();
		}