jQuery(document).ready(function($) {
	
	$('#nav ul li').each(function() {
		var ul = $(this).find('ul.hover'), a = $(this).find('a:first');
		if(ul.length > 0) {
			$(this).hover(function() {
				a.addClass('active');
				ul.show();
			}, function() {
				a.removeClass('active');
				ul.hide();
			});
		}
	});
	
	$('#content .cycle').each(function() {
		var wrap = $(this), nav = wrap.find('.nav');
		wrap.find('ul').cycle({
			fx:'fade',
			timeout:6000,
			speed:700,
			pager:nav,
			pagerAnchorBuilder:function(a,b,c,d) {
				return '<a href="#"></a>';
			}
		});
	});
	
	//home cols
	$('#content .tripcols').each(function() {
		var h = $(this).find('li:last').height()-5;
		$(this).find('li').height(h);
	});
	
	$('#content input[type=text], #content textarea').each(function() {
		var d = $(this).val();
		$(this).focus(function() { if($(this).val() == d) $(this).val(''); });
		$(this).blur(function() { if($(this).val() == '') $(this).val(d); });
	});
	
	$('#content .catering-images a.lightbox, #content .fbox').fancybox();
	
	$(function() {
		var p = $('#st_popup');
		if(p.length != 0) {
			p.fancybox({
				onClosed:function() {
					p.remove();
				}
			});
			p.trigger('click');
		}
	});
	
});