/*
  Simons en Boom
  Copyright (C) 2008 by Systemantics, Bureau for Informatics

  Lutz Issler
  Mauerstr. 10-12
  52064 Aachen
  GERMANY

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

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



$(function() {
	$("#work li:eq(6), #work li:eq(13),").addClass("last");
	$("#men").click(function() {
		this.src = this.src.indexOf("_wave")>0
			? this.src.replace(/_wave/, "_up")
			: this.src.replace(/_up/, "_wave");
	});

	// Hover fix for IE 6
	if ($.browser="msie" && $.browser.version=="6.0") {
		$(".button").hover(
			function() {
				$(this).addClass($(this).attr("id")+"Hover");
			},
			function() {
				$(this).removeClass($(this).attr("id")+"Hover");
			}
		);
	}
	
	$("a.external").click(function() {
		window.open(this.href);
		return false;
	});

	$(window).resize();
});

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

	// Format first image
	$(".work > img:first").addClass("first");

	// Format captions
	$(".captionContainer .caption").each(function() {
		$(this).css("marginTop", -$(this).height());
	});
});
