

// jQuery Functions [ BEGIN ]
$(document).ready(function(){

	// Carousel [ START ]
	
        $(function () {
            $('.carousel').anythingSlider({
                easing: "easeInOutExpo",
                autoPlay: true,
                delay: 4000,
                startStopped: false,
                animationTime: 700,
                hashTags: false,
                buildNavigation: true,
        		pauseOnHover: true,
        		startText: "Go",
		        stopText: "Stop",
		        navigationFormatter: formatText
            });
        });
	// Carousel [ STOP ]

	// Slider [ START ]
	function formatText(index, panel) {
		  return index + "";
	    }
        $(function () {
            $('.slider').anythingSlider({
                easing: "easeInOutBack",
                autoPlay: true,
                delay: 2600,
                startStopped: false,
                animationTime: 500,
                hashTags: false,
                buildNavigation: false,
        		pauseOnHover: true,
        		startText: "Go",
		        stopText: "Stop",
		        navigationFormatter: null
            });
        });
	// Slider [ STOP ]

	// Anchor Sliding [ START ]
	$('.btn-up a, .btn-down a, #end div a, #btn-contact a').smoothScroll({
		afterScroll: function() {
		}
	});
	// Anchor Sliding [ STOP ]

	
  
  // Hover Image Function
  $(document).ready(function(){
    $("img").hover(function() {
      $(this).stop().animate({opacity: "0.5"}, 'slow');
    },
    function() {
      $(this).stop().animate({opacity: "1"}, 'slow');
    });
  });
// Hover Image Function Stop
	
	
	
	// Button Fading [ START ]
	$('.fade').append('<span class="hover"></span>').each(function () {
		var $span = $('> span.hover', this).css('opacity', 0);
			$(this).hover(function () {
				$span.stop().fadeTo(600, 1);
			}, function () {
				$span.stop().fadeTo(600, 0);
		});
		$('.fade > .hover').empty();
	})
	// Button Fading [ STOP ]
	
	// Fading [ START ]
	$("#intro #btn-contact, #contact .submit").fadeTo("slow", 0.5);
	$("#intro #btn-contact, #contact .submit").hover(function(){
		$(this).fadeTo("slow", 1.0);
	},function(){
		$(this).fadeTo("slow", 0.5);
	});
	$("#text-6 li, #text-5 li").fadeTo("slow", 0.6);
	$("#text-6 li, #text-5 li").hover(function(){
		$(this).fadeTo("slow", 1.0);
	},function(){
		$(this).fadeTo("slow", 0.6);
	});
	$("#contact input, #contact textarea").fadeTo("slow", 0.7);
	$("#contact input, #contact textarea").hover(function(){
		$(this).fadeTo("slow", 1.0);
	},function(){
		$(this).fadeTo("slow", 0.7);
	});
	$("#end").fadeTo("slow", 0.4);
	$("#end").hover(function(){
		$(this).fadeTo("slow", 1.0);
	},function(){
		$(this).fadeTo("slow", 0.4);
	});
	$(".img-large a span, .thumbnails li a span").fadeTo("slow", 0.0);
	$(".img-large a span, .thumbnails li a span").hover(function(){
		$(this).fadeTo("slow", 1.0);
	},function(){
		$(this).fadeTo("slow", 0.0);
	});
	// Fading [ STOP ]
	
	
	//FancyBoxVideo [ Start ]
$(".fancyboxvideo").click(function() {
	
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'title'			: this.title,
			'width'		: 600,
			'height'		: 450,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
 
	return false;
});
    // FancyBoxVideo [ STOP ]
	
	
	// FancyBox [ START ]
	$("a.fancybox").fancybox({
		'titleShow'			: true,
		'titlePosition'		: 'over',
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'easingIn'			: 'easeOutBack',
		'easingOut'			: 'easeInBack',
		'autoScale'			: false,
		'hideOnOverlayClick' : true,
		'hideOnContentClick' : true,
		'speedIn'			: '500',
		'speedOut'			: '500',
		'opacity'			: true,
		'overlayColor'		: '#000',
		'overlayOpacity'	: '0.5'
	});
	// FancyBox [ STOP ]
	
	// Auto-Resize [ START ]
	$('textarea#msg').autoResize({
    onResize : function() {
        $(this).css({opacity:0.8});
    },
    animateCallback : function() {
        $(this).css({opacity:0.9});
    },
    animateDuration : 150,
	limit: 270,
    extraSpace : 17
	});
	// Auto-Resize [ STOP ]

});



