$(document).ready(function(){
<!--$.preloadImages("/img/sneaker_bg_2.jpg", "/img/sneaker_bg_3.jpg","/img/sneaker_bg_1.jpg", "/img/sneaker_1.jpg", "/img/sneaker_2.jpg", "/img/sneaker_3.jpg", "/img/sneaker_4.jpg");-->

$("div.scrollable").scrollable();

        $('a[href*=#home]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000, 'easeInOutQuart');
             return false;
            }
          }
        });
   
	   
        $('a[href*=#about]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000, 'easeInOutQuart');
             return false;
            }
          }
        });
     	  
	  
        $('a[href*=#sneaker]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000, 'easeInOutQuart');
             return false;
            }
          }
        });
		
		      $('a[href*=#galerie]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000, 'easeInOutQuart');
             return false;
            }
          }
        });


    
	    $('a[href*=#anker_bestellen]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000, 'easeInOutQuart');
             return false;
            }
          }
        });
		
	
	$('a[href*=#anker_kontakt]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
          && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000, 'easeInOutQuart');
             return false;
            }
          }
        });
		


$("a#link_home").click(function(){ 
	$(".next").fadeOut("fast",function(){ 	});
	$(".prev").fadeOut("fast",function(){ 	}); 
});


$("a#link_about").click(function(){ 
	$(".next").fadeOut("fast",function(){ 	});
	$(".prev").fadeOut("fast",function(){ 	}); 
});

   
$("a#link_sneaker").click(function(){ 
   $(".next").fadeIn("slow",function(){ 	}); 
   $(".prev").fadeIn("slow",function(){ 	});
   $("#content_sneaker_1").focus();
});


$("a#link_kontakt").click(function(){ 
	$(".next").fadeOut("fast",function(){ 	});
	$(".prev").fadeOut("fast",function(){ 	}); 
});


$("a#link_galerie").click(function(){ 
	$(".next").fadeOut("fast",function(){ 	});
	$(".prev").fadeOut("fast",function(){ 	}); 
});


$("a#link_bestellen").click(function(){ 
	$(".next").fadeOut("fast",function(){ 	});
	$(".prev").fadeOut("fast",function(){ 	}); 
});



 $("a#link_about_2").click(function(event){
   event.preventDefault();
	$("#content_about_1").fadeOut("slow",function(){ 	});
	$("#content_about_2").fadeIn("slow",function(){ 	}); 
});

 $("a#link_about_1").click(function(event){
   event.preventDefault();
	$("#content_about_2").fadeOut("slow",function(){ 	});
	$("#content_about_1").fadeIn("slow",function(){ 	}); 
});


 $("a#link_sneaker_3").click(function(event){
   event.preventDefault();
	$("#content_sneaker_1").fadeOut("slow",function(){ 	});
	$("#content_sneaker_2").fadeIn("slow",function(){ 	}); 
});

 $("a#link_sneaker_1").click(function(event){
   event.preventDefault();
	$("#content_sneaker_2").fadeOut("slow",function(){ 	});
	$("#content_sneaker_1").fadeIn("slow",function(){ 	}); 
});



 $("a#link_kontakt_1").click(function(event){
   event.preventDefault();
	$("#content_kontakt_2").fadeOut("slow",function(){ 	});
	$("#content_kontakt_3").fadeOut("slow",function(){ 	});
	$("#content_kontakt_1").fadeIn("slow",function(){ 	}); 
});


$("a#link_kontakt_2").click(function(event){
   event.preventDefault();
	$("#content_kontakt_1").fadeOut("slow",function(){ 	});
	$("#content_kontakt_3").fadeOut("slow",function(){ 	});
	$("#content_kontakt_2").fadeIn("slow",function(){ 	}); 
});

 $("a#link_kontakt_3").click(function(event){
   event.preventDefault();
    $("#content_kontakt_1").fadeOut("slow",function(){ 	});
	$("#content_kontakt_2").fadeOut("slow",function(){ 	});
	$("#content_kontakt_3").fadeIn("slow",function(){ 	}); 
});


$("a.fancy").fancybox();
						   
			
			$("a[rel=fotos]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});	
		
		
		$("a[rel=produktion]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
			
			
			$("a[rel=gbw]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
			
			$("a[rel=bgw]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
						   
			$("a[rel=ggw]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
				$("a[rel=ggb]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				
					$("a[rel=bbw]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
					
				$("a[rel=bbb]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				
			
			$(".iframe").fancybox({
				'width'				: '80%',
				'height'			: '80%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
						   

$("a#link_home").click(function(){ 
   $(".active1").animate( { width:"0px"}, 300 );
   $(".active2").animate( { width:"0px"}, 300 );
   $(".active3").animate( { width:"0px"}, 300 );
   $(".active4").animate( { width:"0px"}, 300 );
   $(".active5").animate( { width:"0px"}, 300 );
});


$("a#link_about").click(function(){ 
   $(".active1").animate( { width:"10px"}, 300 ); 
   $(".active2").animate( { width:"0px"}, 300 );
   $(".active3").animate( { width:"0px"}, 300 );
   $(".active4").animate( { width:"0px"}, 300 );
   $(".active5").animate( { width:"0px"}, 300 );
});


$("a#link_sneaker").click(function(){ 
   $(".active1").animate( { width:"0px"}, 300 ); 
   $(".active2").animate( { width:"10px"}, 300 );
   $(".active3").animate( { width:"0px"}, 300 ); 
   $(".active4").animate( { width:"0px"}, 300 );
   $(".active5").animate( { width:"0px"}, 300 );
});

$("a#link_galerie").click(function(){ 
   $(".active1").animate( { width:"0px"}, 300 ); 
   $(".active2").animate( { width:"0px"}, 300 );
   $(".active3").animate( { width:"10px"}, 300 ); 
   $(".active4").animate( { width:"0px"}, 300 );
   $(".active5").animate( { width:"0px"}, 300 );
});


$("a#link_bestellen").click(function(){ 
   $(".active1").animate( { width:"0px"}, 300 );
   $(".active2").animate( { width:"0px"}, 300 );
   $(".active3").animate( { width:"0px"}, 300 );
   $(".active4").animate( { width:"10px"}, 300 );
   $(".active5").animate( { width:"0px"}, 300 );
});


$("a#link_kontakt").click(function(){ 
   $(".active1").animate( { width:"0px"}, 300 );
   $(".active2").animate( { width:"0px"}, 300 );
   $(".active3").animate( { width:"0px"}, 300 );
   $(".active4").animate( { width:"0px"}, 300 );
   $(".active5").animate( { width:"10px"}, 300 );
});



		
});
