$.easing.custom = function (x, t, b, c, d) {
	var s = 1.70158;
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}

$(function() {
	$("#headoptionen div.scrollable").scrollable({easing: 'custom', speed: 700, circular: true});

	$("#headfoto div.scrollable").scrollable({circular: true}).navigator().autoscroll({interval: 15000});

	$("ul.tabs").tabs("div.panes > div");

	$("#footer_inner .nlv_1").show();
	$("a.open-close").click(function () {
		$("#footer_inner .nlv_1").slideToggle("slow");
	});

	$(".dropdown dt a").click(function() {
		$(".dropdown dd ul").toggle();
	});
	$(".dropdown dd ul li a").click(function() {
		var text = $(this).html();
	   $(".dropdown dt a span").html(text);
	   $(".dropdown dd ul").hide();
	   $("#result").html("Selected value is: " + getSelectedValue("sample"));
	});

	function getSelectedValue(id) {
		return $("#" + id).find("dt a span.value").html();
	}

	$(document).bind('click', function(e) {
		var $clicked = $(e.target);
	   if (! $clicked.parents().hasClass("dropdown"))
	   	$(".dropdown dd ul").hide();
	});

   $("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: null});
});
