$(document).ready(function() 
{
	/* 360° Rundgang */

	$("img.advancedpanorama").panorama(
	{
	    auto_start: 0,
	    start_position: 0
	});
	
	/* Hörer abspielen */
	
	$("#jquery_jplayer_1").jPlayer(
	{
		ready: function () 
		{
			$(this).jPlayer("setMedia", 
			{
				mp3: "sounds/spot1+2.mp3"
			});
		},
		swfPath: "js",
		supplied: "mp3"
	})
	.bind($.jPlayer.event.play, function() 
	{
		$(this).jPlayer("pauseOthers");
	});
	
	$("#jquery_jplayer_2").jPlayer(
	{
		ready: function () 
		{
			$(this).jPlayer("setMedia", 
			{
				mp3: "sounds/spot3+4+5.mp3"
			});
		},
		swfPath: "js",
		supplied: "mp3",
		cssSelectorAncestor: "#jp_interface_2",
		cssSelector: 
		{
		      play:".jp-play2",
		      pause:".jp-pause2"
		}
	})
	.bind($.jPlayer.event.play, function() 
	{
			$(this).jPlayer("pauseOthers");
	});
	
	/* Animiertes Scrollen */
	
	$(".navi a[href*=#]").bind("click", function(event) 
	{
		event.preventDefault();
		$("#navigation ul li.navi a").removeClass("active");
		$(this).toggleClass("active");
		var ziel = $(this).attr("href");
		$("html,body").animate(
		{
			scrollTop: $(ziel).offset().top
		}, 2000 , function (){location.hash = ziel;});
	});
	return false;
});

$(function() 
{
	/* Animiertes Telefon */
	
	$("#telefon").everyTime(10,function()
	{ 
		$("#telefon").animate({top: "-50px"}, 2500 ).animate({top: "0px"}, 2500 );
	});
	
	$("#telefon2").everyTime(10,function()
	{ 
		$("#telefon2").animate({top: "0px"}, 2500 ).animate({top: "-50px"}, 2500 );
	});
	
	/* Tooltip bei Rollover */
	
	$(".jeans .jeansbild").tooltip(
	{
		delay:500
	});
	$("#dortmund #dortmundstore").tooltip(
	{
		delay:500
	});
	$("#audiospots h2").tooltip(
	{
		delay:500
	});
	$("#citycards h2").tooltip(
	{
		delay:500
	}).dynamic({ bottom: { direction: 'down', bounce: true } });;
	
	/* Overlay bei Klick */
	
	$("#bottomnavi ul li[rel]").overlay({effect: 'apple'});
	$(".overlaytrigger[rel]").overlay({effect: 'apple'});
	
	/* Google Maps */
	
	$("#bottomnavi ul li[rel=#anfahrt]").live("click", function() 
	{
		setTimeout( function()
		{
			initialize();
		}, 500);
	});
});
