jQuery(document).ready(function() {
	function mycarousel_initCallback(carousel) 
	{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

/////////////////////////////////////////////// Scroll Trang Chu
jQuery(document).ready(function() {
	//vertical scroll
	jQuery('#logo-partner-ver').jcarousel({
        vertical: true,
        scroll: 1,
		auto:3,
		wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});

/////////////////////////////////////////////// Scroll Trang Du An
jQuery(document).ready(function() {
	//horizone SCROLL
	jQuery('#list-pro').jcarousel({
		scroll:1,					
		auto:3,
		wrap: 'last',
        initCallback: mycarousel_initCallback
	});
});

});

////////////////////////////////////// Horizone Scroll
(function($) {
	$(function() { //on DOM ready
		$("#logo-partner").simplyScroll({
			autoMode: 'loop',
			frameRate: 30,
			speed: 1

		});
	});
})(jQuery);

///////////////////////////////////////////////
$(document).ready(function() {	

	//Show Banner
	$(".big-thumb .desc").show(); //Show Banner
	$(".big-thumb .block").animate({ opacity: 0.6 }, 1 ); //Set Opacity

	//Click and Hover events for thumbnail list
	$("#ppro ul li:first").addClass('active'); 
	$("#ppro ul li").click(function(){ 
		//Set Variables
		var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
		var imgDesc = $(this).find('.block').html(); 	//Get HTML of block
		var imgDescHeight = $(".big-thumb").find('.block').height();	//Calculate height of block	
		
		if ($(this).is(".active")) {  //If it's already active, then...
			return false; // Don't click through
		} else {
			//Animate the Teaser				
			$(".big-thumb .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
				$(".big-thumb .block").html(imgDesc).animate({ opacity: 0.6,	marginBottom: "0" }, 250 );
				$(".big-thumb img").attr({ src: imgTitle , alt: imgAlt});
			});
		}
		
		$("#ppro ul li").removeClass('active'); //Remove class of 'active' on all lists
		$(this).addClass('active');  //add class of 'active' on this list only
		return false;
		
	}) .hover(function(){
		$(this).addClass('hover');
		}, function() {
		$(this).removeClass('hover');
	});
			
	//Toggle Teaser
	$("a.collapse").click(function(){
		$(".big-thumb .block").slideToggle();
		$("a.collapse").toggleClass("show");
	});
	
});//Close Function

//LIGHT BOX
