/* ------------------------------------------------*/
/* Blue Jelly - js
/* Revision: 2.1
/* Date: 17-11-2011
/* Author: Clear Signal
---------------------------------------------------*/
$(document).ready(function(){
	// banner slider home
	$('#home-banners').cycle({
		fx:     'scrollLeft',
		timeout: 10000,
		speed:   'slow'
	});
	// gallery slider home
	$('#vertical-images').cycle({
		fx:     'scrollVert',
		speed:   'slow',
		timeout: 0,
		after:   onAfter,
		next:   '#next',
		prev:   '#prev'
	 });

	function onAfter() {
		$('#caption').html('<h4><a href="'+this.href+'">'+this.title+'</a></h4><p>' + this.name + '</p>');
	}

	$('#prev').click(function() {
			$(this).blur();
	});
	$('#next').click(function() {
		$(this).blur();
	});
	// sub-pages image fader
	$('#banner-items-wrap').cycle({
			fx:    'fade',
			pause: 0,
			timeout: 8000,
			delay:  0,
			speed: 500, 
			cleartype: !$.support.opacity, 
			cleartypeNoBg: true
	});
	$('.expander').expander({
		slicePoint:       160,
		expandPrefix:     ' ... ',
		expandText:       '<br/><br/>&rsaquo;&nbsp;more',
		expandEffect:     'fadeIn',
		expandSpeed:      'slow',
		userCollapseText: '^ close',
		hijackInternalLinks: true,
		afterExpand: function($thisElement) {
			$('#text-scroll').jScrollPane({showArrows:false, scrollbarWidth: 9, scrollbarMargin:3, reinitialiseOnImageLoad: true });
		},
		onCollapse: function($thisElement) {
			$('#text-scroll').jScrollPane({showArrows:false, scrollbarWidth: 9, scrollbarMargin:3, reinitialiseOnImageLoad: true });
		}
	});
// Text scroll
$('#text-scroll').jScrollPane({showArrows:false, scrollbarWidth:9, scrollbarMargin:3 });
$('#client-scroll').jScrollPane({showArrows:false, scrollbarWidth:9, scrollbarMargin:3 });
$('#inspire-scroll').jScrollPane({showArrows:false, scrollbarWidth:9, scrollbarMargin:3 });
$('#team-scroll').jScrollPane({showArrows:false, scrollbarWidth:9, scrollbarMargin:3 });
// Gallery
	$('#gallery-wrap').cycle({
		fx:     'scrollHorz',
		timeout: 10000,
		speed:   1500,
		next:   '#next2',
		prev:   '#prev2'
	
	});
// gallery fader
$('.gall-row1 .row1-img1').cycle({
		fx:    'fade',
		pause: 0,
		timeout: 1500,
		delay:  0,
		speed: 1000, 
		cleartype: !$.support.opacity, 
		cleartypeNoBg: true
});
// gallery fader
$('.gall-row1 .row1-img2').cycle({
		fx:    'fade',
		pause: 0,
		timeout: 2500,
		delay:  0,
		speed: 1000, 
		cleartype: !$.support.opacity, 
		cleartypeNoBg: true
});
// gallery fader
$('.gall-row2 .row2-img1').cycle({
		fx:    'fade',
		pause: 0,
		timeout: 2800,
		delay:  0,
		speed: 1000, 
		cleartype: !$.support.opacity, 
		cleartypeNoBg: true
});
// gallery fader
$('.gall-row2 .row2-img2').cycle({
		fx:    'fade',
		pause: 0,
		timeout: 4000,
		delay:  0,
		speed: 1000, 
		cleartype: !$.support.opacity, 
		cleartypeNoBg: true
});
// gallery fader
$('.gall-row2 .row2-img3').cycle({
		fx:    'fade',
		pause: 0,
		timeout: 4000,
		delay:  0,
		speed: 1000, 
		cleartype: !$.support.opacity, 
		cleartypeNoBg: true
});
// gallery fader
$('.col2 .col2-img1').cycle({
		fx:    'fade',
		pause: 0,
		timeout: 3000,
		delay:  0,
		speed: 1000, 
		cleartype: !$.support.opacity, 
		cleartypeNoBg: true
});
});
