private void exit(boolean b) {
		if(b){
			frame.setAlwaysOnTop(false);
			JFileChooser fc = new JFileChooser();
			fc.setFileFilter(new MapFilter());
			fc.setCurrentDirectory(RessourcesCreator.MAP_FOLDER);
			fc.setAcceptAllFileFilterUsed(false);
			if(current.getPath()!=null)
				fc.setCurrentDirectory(current.getPath().getParentFile());
			int returnVal = fc.showSaveDialog(frame);
			if (returnVal == JFileChooser.APPROVE_OPTION) {
	            File file = fc.getSelectedFile();
	            if(!MapFilter.isValid(file))
	            	file = new File(file.getAbsolutePath()+".smap");
	            current.setPath(file);
	            if(brick_pic!=null){
	            	BufferedImage buf = current.getBackground();
		            Graphics g = buf.getGraphics();
		            BufferedImage draw = GraphicsTools.resizeImage(brick_pic, Map.size, Map.size);
		            for (int x = 0; x< Map.width; x++){
		    			for(int y = 0; y<Map.height; y++){
		    				int type = current.getRawCell(x, y);
		    				if(type==Map.CELL_OBSTACLE)
		    					g.drawImage(draw, x*Map.size, y*Map.size, null);
		    			}
		    		}
		            current.setBackground(buf);
	            }
	        }else{
	        	frame.setAlwaysOnTop(true);
	        	return;
	        }
			frame.setAlwaysOnTop(true);
			current.save();
		}
		frame.goTo(new MainMenuPanel(frame));
	}