$(document).ready(function() {
	
	// Location Menus
	$("#location-menu li").css('height', '40px');
	$("#location-menu li img").hide();
	$("#location-menu li a").hide();
	
	$("#location-menu #lunch").css('height', '180px');
	$("#location-menu #lunch img").show();
	$("#location-menu #lunch a").show();
	
	$("#location-menu li").click(function () {
		$("#location-menu li").animate({height: '40px'}, 200);
		$("#location-menu li img").fadeOut();
		$("#location-menu li a").fadeOut();
		
		$(this).animate({height: '180px'}, 200);
		$('img', this).fadeIn();
		$('a', this).fadeIn();
		
		//$(this).unbind();
	});
	
	// Slideshow
	if (document.getElementById('slideshow')) {
		$('#slides').innerfade({
			speed: 1000,
			timeout: 6000,
			type: 'sequence',
			containerheight: '262px',
			slide_timer_on: 'yes',
			slide_ui_parent: 'slides',
			slide_ui_text: 'slide-desc',
			slide_nav_id: 'slide_nav'
		});
		$.setOptionsButtonEvent();
	}
	
	// Lightbox
	$(".iframe").fancybox({
		'hideOnContentClick': true,
		'titleShow': false,
		'width': 700,
		'height': 600
	});
	
	$("a[href$='/locations/']").fancybox({
		'type': 'iframe',
		'hideOnContentClick': true,
		'titleShow': false,
		'width': 700,
		'height': 600
	});
	
	$(".modal").fancybox({
		'type': 'iframe',
		'hideOnContentClick': false,
		'hideOnOverlayClick': false,
		'enableEscapeButton': false,
		'titleShow': false,
		'width': 700,
		'height': 600
	});
	
	$(".fancybox").fancybox({
		
	});
	
	// Fade
	$('.fadeThis').append('<span class="hover"></span>').each(function () {
		var $span = $('> span.hover', this).css('opacity', 0);
		$(this).hover(function () {
			$span.stop().fadeTo(300, 1);
		}, function () {
			$span.stop().fadeTo(300, 0);
		});
	});
	
	// Input value switcher
	$('#zip').focus(function () {
		if ($('#zip').val() == 'Enter Zip Code') {
			$('#zip').val('');
			$('#zip').css({'color' : '#97260c', 'font-weight' : 'bold'}); //active
		}
	});
	
	$('#zip').blur(function () {
		if ($('#zip').val() == '') {
			$('#zip').val('Enter Zip Code');
			$('#zip').css({'color' : '#d2d2d2', 'font-weight' : 'normal'}); //inactive
		}
	});
	
	// Open external links in new Window/Tab
	$("a[href^='http:']").not("[href*='" + window.location.host + "']").attr('target','_blank');
	
});
