var holdfast;
holdfast = holdfast || {
	/* init:function(){
		//alert('yo face');	
	}, */
	features:function(){
		$(window).load(function() {
			$('#prev').animate({opacity:.5}, 500);
			$('#next').animate({opacity:.5}, 500);
		
			$('#hf-slides').animate({opacity:1}, function(){ }).cycle({ 
				fx:      'fade', 
				easeOut: 'backin',
				timeout: 7000, 
				delay:   1000, 				
				next:   '#next', 
				prev:   '#prev' 
			});
		});
	},
	createGallery:function(el){
		$(window).load(function() {
			var gallery = $(el);

			console.log(gallery.children().length);

			if(gallery.children().length >= 1){
				gallery.animate({opacity:1}, 500, function(){
					$('#prev').animate({opacity:.5}, 500);
					$('#next').animate({opacity:.5}, 500);
				});
				gallery.cycle({ 
					fx:      'fade', 
					easeOut: 'backin',
					timeout: 7000, 
					delay:   1000, 				
					next:   '#next', 
					prev:   '#prev',
					pager:  '#nav',
					pagerAnchorBuilder: function(idx, slide) { 
						var src = $(slide).children('img').attr('src');
						return '<li><a href="#"><img src="' + src + '" width="75" height="75"/></a></li>'; 
					},
					containerResize:1,
					after:holdfast.fixContainerHeight
				});
			} else {
				$('#prev').hide();
				$('#next').hide();
			}
		});
	},
	fixContainerHeight:function(){
		var $ht = $(this).height();
		//set the container's height to that of the current slide
		$(this).parent().css("height", $ht);
	},
	faq:function(){
		$('#hf-faqs h4').click(function(){
			$(this).next().slideToggle('fast', function() { /* animation complete */ });
		});
	}
}
