/*!	Standard js function library - general functions */
	$(document).ready(function() {
		/* Image Rotators */
		$(".menu-img").rotate({
   			bind: { 
        		"mouseover":function() {$(this).rotate({animateTo:-5})},
    	    	"mouseout":function() {$(this).rotate({animateTo:0})}
			}
		});
		
		$(".menu-img-alt").rotate({
   			bind: { 
        		"mouseover":function() {$(this).rotate({animateTo:5})},
    	    	"mouseout":function() {$(this).rotate({animateTo:0})}
			}
		});
		/* Image Rotators */
		
		/* Page loaders */
		$("#news-loader").live("click",function(event){
			var $page = $(this);
			
			$(".news-text-blok-holder").animate({opacity:0}, function(){
				$(this).load("loaders/news-loader.php?page="+$page.attr("rel"), function(){
					$(this).animate({opacity:1})
				 });
		    });

			event.preventDefault();
		});

		$("#colleagues-loader").live("click",function(event){
			var $colleague = $(this);
			
			$(".who-are-we-text-blok-holder").animate({opacity:0}, function(){
				$(this).load("loaders/who-are-we-loader.php?person="+$colleague.attr("rel"), function(){
					$(this).animate({opacity:1})
				 });
		    });
			$("#colleagues-loader-back").toggleClass("elem-hidden", false);
			
			event.preventDefault();
		});
		$("#colleagues-loader-back-link").live("click",function(event){
			$(".who-are-we-text-blok-holder").animate({opacity:0}, function(){
				$(this).load("loaders/who-are-we-loader.php?person=0", function(){
					$(this).animate({opacity:1})
				 });
		    });
			$("#colleagues-loader-back").toggleClass("elem-hidden", true);
			
			event.preventDefault();
		});
		
		$("#contact-reservation").fancybox({"padding":"20px"});
		/* Page loaders */
		
		/* Website Scrollers */
		$("#scrollmenu a, a.home-button, a.webshop-button, a.arrow-buttons").bind("click",function(event){
			var $anchor = $(this);

			$("html, body").stop().animate({
				scrollLeft: $($anchor.attr("href")).offset().left
			}, 1500, "easeInOutExpo");
			
			switch ($anchor.attr("href")) {
			case "#content-box-home":
				$("#prev-frame").attr("href", "#content-box-links");
				$("#next-frame").attr("href", "#content-box-news");
				break;
			case "#content-box-news":
				$("#prev-frame").attr("href", "#content-box-home");
				$("#next-frame").attr("href", "#content-box-menu");
				break;
			case "#content-box-menu":
				$("#prev-frame").attr("href", "#content-box-news");
				$("#next-frame").attr("href", "#content-box-who-are-we");
				break;
			case "#content-box-who-are-we":
				$("#prev-frame").attr("href", "#content-box-menu");
				$("#next-frame").attr("href", "#content-box-contact");
				break;
			case "#content-box-contact":
				$("#prev-frame").attr("href", "#content-box-who-are-we");
				$("#next-frame").attr("href", "#content-box-atmosphere");
				break;
			case "#content-box-atmosphere":
				$("#prev-frame").attr("href", "#content-box-contact");
				$("#next-frame").attr("href", "#content-box-links");
				break;
			case "#content-box-links":
				$("#prev-frame").attr("href", "#content-box-atmosphere");
				$("#next-frame").attr("href", "#content-box-home");
				break;
			}

			event.preventDefault();
		});
		/* Website Scrollers */
		
		/* Fancy Box Constructor */
		$("a.image_gallery, a.image_gallery_album").fancybox({
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'titlePosition' 	: 'over',
			'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
			}
		});
		/* Fancy Box Constructor */
		
		/* Tweeter jQuery */
		$(".tweet").tweet({
            username: "Lindenhofsoest",
            avatar_size: 32,
            count: 3,
			query: "lindenhofsoest",
            loading_text: "tweets aan het ophalen ..."
        });
		/* Tweeter jQuery */
		
		/* Lion Bar Scroll */
		$('.news-text-blok-holder').lionbars(); 
	});
	
	function PersonHover(mouseid, mousehover) {
		$("#colleagues-image-"+mouseid).attr("src",mousehover);
	}
	
