/*
  Groene Golf
  Copyright (C) 2009 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.

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



$(function() {
	$("#company-about .text, #book .text").columnize({
		height: 200,
		columns: 2
	});
	$(".column:first-child").addClass("column-first");
	$(".column p:last-child").addClass("p-last");
	var parts = location.hash.split("-");
	$("#content").accordion({
		active: $(parts[0]).prev(),
		animated: false,
		autoHeight: false,
		header: "h1"
	});
	$("#company").tabs();
	$('#book').tabs({
		select: function(event, ui) {
			var url = $.data(ui.tab, 'load.tabs');
			if (url) {
				window.open(url);
				return false;
			}
			return true;
		}
	});
	if (parts.length==3 && parts[0]=="#company" && parts[1]=="team") {
		$("#company").tabs("select", "#company-team");
	}
	$("#company-team, #services, #clients, #book-press").tabs({
		event: "mouseover"
	});
	$("a, .ui-accordion-header").click(function() {
		this.blur();
	});
	$("a[href^=http://]").click(function() {
		window.open(this.href);
		return false;
	});
	$(window)
		.resize(function() {
			$("#container").css({
				left: Math.max(-250, ($(window).width()-$("#container").width())/2),
				top: Math.max(0, ($(window).height()-$("#container").height())/2)
			});
		})
		.resize();
});
