var alamo = {

	carousels: [],
	
	addCarousel: function(options)
	{
		var settings = $.extend({
			fx: 'scrollHorz',
			ease: 'easeInOutExpo',
			pause: true,
			speed: 1500,
			timeout: 6000
		}, options||{});
		
		if (settings.id) this.carousels.push(settings);
	},
	
	initCarousels: function()
	{
		$.each(this.carousels, function(index, settings){
			
			$(settings.id).cycle(
			{
				containerResize: 0,
			    easing: settings.ease,
			    fx: settings.fx,
			    pager: settings.nav,
			    pause: settings.pause,
			    pauseOnPagerHover: 1,
			    speed: settings.speed,
			    timeout: settings.timeout
			});
			
			if (settings.pause) 
			{
				$(settings.id).cycle('pause');
			}
			
			if ($(settings.id).children().size() < 2) $(settings.nav).hide();
		});
	}
};

$(document).ready(function(){
	
	alamo.initCarousels();
	
	$('nav#main li:first-child').addClass('first rounded-left');
	$('nav#main li:last-child').addClass('last rounded-right');
	$('nav#main .dropdown').parent().addClass('drop');
	$("nav#main li.drop").hoverIntent( { over: dropDown, out: dropUp, timeout: 150 } );
	
	//$("input, textarea, select, button").uniform();
	
	$('#keywords').focus(function()
	{
		if($(this).val() == 'Search Drafthouse.com') $(this).val('');
	});
	
	$('.tip').tipsy({fade: true});
});

function dropDown(){ $(this).addClass("hover"); }
function dropUp(){ $(this).removeClass("hover"); }

function checkFlags()
{
	$("#movie-showtimes div:visible h6").each(function()
	{
		//do something
	});
}
