/* 

client: Entrinsik
author: Atlantic BT - www.atlanticbt.com

Bootup Site Javascript.

==================================================================================================================*/

$(document).ready(function() {	
	// keep my anchors on the same eye level
	$(".secondary-content > div").equalizeBottoms();
	
	// big showcase for home page
	$("#informer-rotator .pics").before('<div class="rotator-controller">').cycle({
		fx:		"fade",
		speed:	'fast',
		pause:	true,
		pager:	'.rotator-controller',
		after:	paginate
	});
		function paginate(currSlideElement, nextSlideElement, options, forwardFlag) {
			$('#highlights li').removeClass('selected');
			idx = $(nextSlideElement).index();
			if (idx == 0) return;
			$('#highlights li').eq(idx - 1).addClass('selected');
		}
	
	// let's trim the long stuff down...nice n' tidy
	/*$(".resources h3 + p").jTruncate({  
        	length: 75, 
	   	moreText: ''
    	});*/
	
	// show me a modal when my images ask for it
	$("a[rel^='prettyPhoto']").prettyPhoto();
	
	// fire up the product tour
	$("ul.tabs").tabs("div.panes > div", {
		effect: 'fade',
		rotate: true
	});	
		var api = $("ul.tabs").data("tabs");	
		// go back to previous tab
		$(".controls #prev").click(function() {api.prev();});
		// advance to the next tab
		$(".controls #next").click(function() {api.next();});	
});
