/*
  Productiehuis Godschalk
  Copyright (C) 2010 by Systemantics, Bureau for Informatics

  Systemantics GmbH
  Am Lavenstein 3
  52064 Aachen
  GERMANY

  Web:    www.systemantics.net
  Email:  hello@systemantics.net

  Permission granted to use the files associated with this
  website only on your webserver.

  Changes to these files are PROHIBITED due to license restrictions.
*/



$(function() {
	$(".images").each(function() {
		if ($("img", this).length<=1) {
			return;
		}
		var images = this;
		$("img", this).each(function() {
			var thumb = $('<img class="small" src="'+this.src.replace("images/", "images/s_")+'" alt="" />')
				.click(function() {
					$(".large:first", images).attr("src", $(this).siblings(".large").attr("src"));
				});
			$(this)
				.addClass("large")
				.wrap('<div class="image"></div>')
				.after(thumb);
		});
		$(".image", this)
			.wrapAll('<div class="thumbnails"></div>');
		$(".thumbnails .large:first", this).clone().prependTo(this);
	});

	$("a[href^=http://], a[href^=https://], a.external").click(function() {
		this.blur();
		window.open(this.href);
		return false;
	});

	$(window)
		.resize(function() {
			$("#container").css("left", Math.max(0, ($(window).width()-$("#container").width())/2));
		})
		.resize();
});

