/// jquery
jQuery.noConflict();

/// header
jQuery(document).ready(function(){
//	jQuery("#search-input").hide();
	jQuery("#teaser h1").fadeIn(1000);
	jQuery("#teaser span").fadeIn(1000);
	jQuery("#contentContainer").fadeIn(1000);
	jQuery("#footer").fadeIn(1000);
	jQuery("#showImage a").fadeIn(1000);
});

// jQuery SmoothScroll | Version 10-04-30
jQuery(document).ready(function(){
	    jQuery(".scroll").click(function(event){
	        //prevent the default action for the click event
	        event.preventDefault();

	        //get the full url
	        var full_url = this.href;

	        //split the url by # and get the anchor target name
	        var parts = full_url.split("#");
	        var trgt = parts[1];

	        //get the top offset of the target anchor
	        var target_offset = $("#"+trgt).offset();
	        var target_top = target_offset.top;

	        //goto that anchor by setting the body scroll top to anchor top
	        jQuery('html, body').animate({scrollTop:target_top}, 'slow');
	    });
	});

/// show bg image
jQuery(window).load(function() {
	jQuery(function() {
	 	jQuery("#showImage a").click(
	 		function() {
	 			jQuery("#logo").slideToggle("medium");
	 			jQuery("#navigationContainer").delay(300).slideToggle("fast");
	 			jQuery("#contentContainer").delay(600).slideToggle("medium");
	 			jQuery("#showImage a span").toggleClass("hidden-text");
	 		}
		);
	});
});

/// search field
// jQuery(window).load(function() {
//	jQuery(function() {
//	 	jQuery("#search a").click(
//	 		function() {
//	 			jQuery("#search a").toggleClass("active");
//	 			jQuery("#search-input").slideToggle("fast");
//	 		}
//		);
//	});
//});

/// easing search field
jQuery(document).ready(function() {
    jQuery('#search a').click(function(event) {
        jQuery("#search-input")
            .animate(
                { left: 130 }, {
                    duration: 1000,
                    easing: 'easeOutBack'
                });
        jQuery(".out")
            .animate(
                { left: -250 }, {
                    duration: 400,
                    easing: 'easeInBack'
                });
    	jQuery("#search-input").toggleClass("out");
    	jQuery('#search a').toggleClass("active");
    });
});

//// special content
jQuery(document).ready(function() {
    jQuery('#special-content').stop().delay(3000).animate(
		{ top: 20 }, {
		    duration: 3000,
		    easing: 'easeOutElastic'
		}
	);
});

jQuery(document).ready(function() {
    jQuery('.close-special').click(function(event) {
        jQuery("#special-content")
            .animate(
                { top: -300 }, {
                    duration: 1000,
                    easing: 'easeInBack'
                });
		});
});

//fade gallery images
jQuery(document).ready(function() {
	//area 1
	jQuery('.imageGallery').children('a').hover(function() {
		jQuery(this).siblings('a').children('img').stop().fadeTo(200,0.5);
	}, function() {
		jQuery(this).siblings('a').children('img').stop().fadeTo(400,1);
	});
});

//Shadowbox
Shadowbox.init({
	overlayColor: "#000",
	overlayOpacity: 0.5,
	continuous: true,
	slideshowDelay: 5
});
