/* scripts/common.js

Script that initializes the slideshow. Here you can further expand what the slideshow does. Check
http://malsup.com/jquery/cycle/options.html for more options

*/

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

	$("#siteNav > li").hover(function(){$(this).addClass("hover");},function(){$(this).removeClass("hover");});

	var height = 0;
	
	$('ul#lafuente_updates li').each(function() {
			
			var cur_height = $(this).height();

			if(cur_height > height)
				height = cur_height;
		});
		

	$('ul#lafuente_updates').cycle({ 
    	fx:     'fade',   /* the type of transition you want */
    	timeout: 12000,    /* milliseconds between slide transitions */
    	speed:  1000,     /* speed of transition */
    	pager: '#pages',  /* id of element that the navigation will be created under (only the page numbers) */
    	next:   '#next',  /* id of element to use as click trigger for next slide */
    	prev:   '#prev',   /* id of element to use as click trigger for previous slide */
    	height: height
	});
	
	if( $('#homelink').length ) {
		$('#homelink').click(function (){
			location.href = "http://www.lafuenteinc.org/en/" ;
		});
	}

	
});
	
})(jQuery);

