/* <![CDATA[ */
  $(document).ready(function (){
  
	/*navi tabs*/

	$('#navi li a').ready(function() {
		if ($('#navi li a').is('.active')) {
			$(this).css('z-index', '10');
		} else {
			$(this).css('z-index', '0');
		}
	});
	
	$(function() {
		
		var startSlide = 0;
			// Get slide number if it exists
			if (window.location.hash) {
				startSlide = window.location.hash.replace('#','');
			}
		
		var autoPlay = 0;
		var currentPage = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1, window.location.pathname.length);
		
		if(currentPage != 'index.php') {
			autoPlay = 4000;
		} else {
			autoPlay = 2000;
		}
		
		if((currentPage == 'how-to.php') || (currentPage == 'about.php') ) {
			autoPlay = 0;
		}

			
		$('.slides').slides({
			preload: true,
			preloadImage: '../images/common/loading.gif',
			hoverPause: false,
			effect: 'fade',
			play: autoPlay,
			fadeSpeed: 350,
			fadeEasing: "easeOutQuad",
			start: startSlide,
			animationComplete: function(current) {
				// Set the slide number as a hash
					window.location.hash = '#' + current;
				/*calls scripts of mcs_container after animation...
					(not a good logic though (needs revision...))
				*/
				$("#mcs_container").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15); 
				$("#mcs_container-faq").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15);
			}
		});
	});
	
	$(window).load(function() {
		$("#mcs_container-about").mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","yes",15);
	});
  
	/*jcarousel*/
		$('#bottom-carousel').jcarousel({
			wrap: 'circular'
		});

	/*body on refresh fadein/fadeout effect*/
	
  	$("body").ready(function(){
	
			$("body").animate({opacity:"0.2",speed:"fast"});
			$("body").animate({opacity:"1",speed:"fast"});
				
		});

    });
/* ]]> */
