jQuery(document).ready(function($){

	// Sidebar contact form.
	$('.labelify').labelify(); 
	$('#contact').validate({
		ignoreTitle: true,
		errorElement: 'div',
		errorPlacement: function(error, element) {
			error.insertBefore(element);
			$('.labelify').labelify();
 		},
		submitHandler: function(form) {
			$(form).ajaxSubmit({
 				success: function(){
					$(form).slideUp(function(){
						$('.notification.success').slideDown();
 					});
				}
			});
 		}
	});
	
	//Home Page Header Banner Cycle
	$('ul.banner').cycle({
		fx: 'scrollLeft',
		speed: 1000,
		timeout: 5000,
		pause: true
	});
	
	//Footer Bar TEstimonials Slideshow
	$('ul.testimonials').cycle({
		speed: 1000,
		timeout: 4000,
		random: 1
	});
	
	// Home Page Features Scrollable
	$("#features").scrollable({
		vertical: true,
		keyboard: 'static'
	}).navigator("#feattab");
	//Click on first tab on load and add 'active' class
	$(".feattab li:first a").click();
	
	// Portfolio Page Scrollable
	$("#portfolio").scrollable({ circular: true }).navigator("#porttab");

	//Click on first tab on load and add 'active' class
	$(".tabwrap > ul > li:first a").click();
	
	$('#porttab #t1').click(function() {$('#portfolio').css({'height': '1500px'});});
	$('#porttab #t2').click(function() {$('#portfolio').css({'height': '650px'});});
	$('#porttab #t3').click(function() {$('#portfolio').css({'height': '920px'});});
	$('#porttab #t4').click(function() {$('#portfolio').css({'height': '280px'});});
});
