	void show(Contact contact) {
		if (contact != null) {
			if (contact.hasBirthday()) {
				bdayIcon.setVisible(true);
			} else {
				bdayIcon.setVisible(false);
			}
			if (contact.hasNameDay()) {
				namedayIcon.setVisible(true);
			} else {
				namedayIcon.setVisible(false);
			}
			if (contact.hasCelebration()) {
				celebrationIcon.setVisible(true);
			} else {
				celebrationIcon.setVisible(false);
			}
			photo.setContact(contact);
			photo.setVisible(true);
			name.setText(String.format("<html><h1>" + contact.getFullName() + "</h1></html>"));
			if (contact.getNickName() != null && !contact.getNickName().isEmpty()) {
				nicknameLabel.setVisible(true);
				nickname.setVisible(true);
				nickname.setText(contact.getNickName());
			} else {
				nicknameLabel.setVisible(false);
				nickname.setVisible(false);
			}
			address.removeAll();
			addressLabel.setVisible(false);
			for (Address a : contact.getAdresses()) {
				if (!a.getAddress().isEmpty()) {
					addressLabel.setVisible(true);
					JLabelButton l = new JLabelButton();
					l.setVerticalTextPosition(JLabel.TOP);
					l.setHorizontalTextPosition(JLabel.CENTER);
					l.setAlignmentX(Component.LEFT_ALIGNMENT);
					l.setCursor(new Cursor(Cursor.HAND_CURSOR));
					l.setText(a.getAddress());
					try {
						l.setIcon(new ImageIcon(new URL("http://maps.google.com/maps/api/staticmap?size=128x128&sensor=false&markers=" + URLEncoder.encode(l.getText(), "utf8"))));
					} catch (IOException e) {
						System.err.println(e);
					}
					l.addActionListener(new MapListener());
					address.add(l);
				}
			}
			emails.removeAll();
			emailLabel.setVisible(false);
			for (Email e : contact.getEmails()) {
				if (!e.getEmail().isEmpty()) {
					emailLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(e.getEmail());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new EmailListener());
					emails.add(lb);
				}
			}
			webs.removeAll();
			websLabel.setVisible(false);
			for (Url u : contact.getUrls()) {
				if (u.getValue() != null) {
					websLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(u.getValue().toString());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new WebListener());
					emails.add(lb);
				}
			}
			if (!contact.getPhoneNumbers().isEmpty()) {
				phoneLabel.setVisible(true);
				phones.setVisible(true);
				phones.setText("<html>" + contact.getAllPhones().replaceAll(", ", "<br>") + "</html>");
			} else {
				phoneLabel.setVisible(false);
				phones.setVisible(false);
			}
			if (contact.getBirthday() != null && contact.getBirthday().getDate() != null) {
				birthday.setVisible(true);
				birthdayLabel.setVisible(true);
				birthday.setText(DateFormat.getDateInstance().format(contact.getBirthday().getDate()));
			} else {
				birthday.setVisible(false);
				birthdayLabel.setVisible(false);
			}
			if (contact.getNameDay() != null && contact.getNameDay().getDate() != null) {
				nameday.setVisible(true);
				namedayLabel.setVisible(true);
				nameday.setText(DateFormat.getDateInstance().format(contact.getNameDay().getDate()));
			} else {
				nameday.setVisible(false);
				namedayLabel.setVisible(false);
			}
			if (contact.getCelebration() != null && contact.getCelebration().getDate() != null) {
				celebration.setVisible(true);
				celebrationLabel.setVisible(true);
				celebration.setText(DateFormat.getDateInstance().format(contact.getCelebration().getDate()));
			} else {
				celebration.setVisible(false);
				celebrationLabel.setVisible(false);
			}
			if (contact.getNote() != null && !contact.getNote().isEmpty()) {
				note.setVisible(true);
				noteLabel.setVisible(true);
				note.setText("<html>" + contact.getNote().replaceAll("\n", "<br>") + "</html>");
			} else {
				note.setVisible(false);
				noteLabel.setVisible(false);
			}
			String separator = "";
			final StringBuilder groupstring = new StringBuilder();
			groups.setVisible(false);
			groupsLabel.setVisible(false);
			for (Group g : db.getAllGroupsForContact(contact)) {
				groups.setVisible(true);
				groupsLabel.setVisible(true);
				groupstring.append(separator);
				groupstring.append(g.getName());
				separator = ", ";
			}
			groups.setText(groupstring.toString());
			detailScrollPane.setVisible(true);
		}
	}

	void show(Contact contact) {
		if (contact != null) {
			if (contact.hasBirthday()) {
				bdayIcon.setVisible(true);
			} else {
				bdayIcon.setVisible(false);
			}
			if (contact.hasNameDay()) {
				namedayIcon.setVisible(true);
			} else {
				namedayIcon.setVisible(false);
			}
			if (contact.hasCelebration()) {
				celebrationIcon.setVisible(true);
			} else {
				celebrationIcon.setVisible(false);
			}
			photo.setContact(contact);
			photo.setVisible(true);
			name.setText(String.format("<html><h1>" + contact.getFullName() + "</h1></html>"));
			if (contact.getNickName() != null && !contact.getNickName().isEmpty()) {
				nicknameLabel.setVisible(true);
				nickname.setVisible(true);
				nickname.setText(contact.getNickName());
			} else {
				nicknameLabel.setVisible(false);
				nickname.setVisible(false);
			}
			address.removeAll();
			addressLabel.setVisible(false);
			for (Address a : contact.getAdresses()) {
				if (!a.getAddress().isEmpty()) {
					addressLabel.setVisible(true);
					JLabelButton l = new JLabelButton();
					l.setVerticalTextPosition(JLabel.TOP);
					l.setHorizontalTextPosition(JLabel.CENTER);
					l.setAlignmentX(Component.LEFT_ALIGNMENT);
					l.setCursor(new Cursor(Cursor.HAND_CURSOR));
					l.setText(a.getAddress());
					try {
						l.setIcon(new ImageIcon(new URL("http://maps.google.com/maps/api/staticmap?size=128x128&sensor=false&markers=" + URLEncoder.encode(l.getText(), "utf8"))));
					} catch (IOException e) {
						System.err.println(e);
					}
					l.addActionListener(new MapListener());
					address.add(l);
				}
			}
			emails.removeAll();
			emailLabel.setVisible(false);
			for (Email e : contact.getEmails()) {
				if (!e.getEmail().isEmpty()) {
					emailLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(e.getEmail());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new EmailListener());
					emails.add(lb);
				}
			}
			webs.removeAll();
			websLabel.setVisible(false);
			for (Url u : contact.getUrls()) {
				if (u.getValue() != null) {
					websLabel.setVisible(true);
					JLabelButton lb = new JLabelButton(u.getValue().toString());
					lb.setCursor(new Cursor(Cursor.HAND_CURSOR));
					lb.addActionListener(new WebListener());
					webs.add(lb);
				}
			}
			if (!contact.getPhoneNumbers().isEmpty()) {
				phoneLabel.setVisible(true);
				phones.setVisible(true);
				phones.setText("<html>" + contact.getAllPhones().replaceAll(", ", "<br>") + "</html>");
			} else {
				phoneLabel.setVisible(false);
				phones.setVisible(false);
			}
			if (contact.getBirthday() != null && contact.getBirthday().getDate() != null) {
				birthday.setVisible(true);
				birthdayLabel.setVisible(true);
				birthday.setText(DateFormat.getDateInstance().format(contact.getBirthday().getDate()));
			} else {
				birthday.setVisible(false);
				birthdayLabel.setVisible(false);
			}
			if (contact.getNameDay() != null && contact.getNameDay().getDate() != null) {
				nameday.setVisible(true);
				namedayLabel.setVisible(true);
				nameday.setText(DateFormat.getDateInstance().format(contact.getNameDay().getDate()));
			} else {
				nameday.setVisible(false);
				namedayLabel.setVisible(false);
			}
			if (contact.getCelebration() != null && contact.getCelebration().getDate() != null) {
				celebration.setVisible(true);
				celebrationLabel.setVisible(true);
				celebration.setText(DateFormat.getDateInstance().format(contact.getCelebration().getDate()));
			} else {
				celebration.setVisible(false);
				celebrationLabel.setVisible(false);
			}
			if (contact.getNote() != null && !contact.getNote().isEmpty()) {
				note.setVisible(true);
				noteLabel.setVisible(true);
				note.setText("<html>" + contact.getNote().replaceAll("\n", "<br>") + "</html>");
			} else {
				note.setVisible(false);
				noteLabel.setVisible(false);
			}
			String separator = "";
			final StringBuilder groupstring = new StringBuilder();
			groups.setVisible(false);
			groupsLabel.setVisible(false);
			for (Group g : db.getAllGroupsForContact(contact)) {
				groups.setVisible(true);
				groupsLabel.setVisible(true);
				groupstring.append(separator);
				groupstring.append(g.getName());
				separator = ", ";
			}
			groups.setText(groupstring.toString());
			detailScrollPane.setVisible(true);
		}
	}
