$(function() {	
	// lightbox for footer youtube videos 1 of 2
	$('.footer-youtube-lightbox-01').colorbox({
		iframe: true,
		innerHeight: 410,
		innerWidth: 640,
		opacity: .7
	});
	
	// lightbox for footer youtube videos 2 of 2
	$('.footer-youtube-lightbox-02').colorbox({
		iframe: true,
		innerHeight: 530,
		innerWidth: 640,
		opacity: .7
	});
	
	// lightbox for photo gallery
	$('.lightbox-photo-gallery').colorbox({
		iframe: true,
		innerHeight: 577,
		innerWidth: 724,
		opacity: .7,
		scrolling: false
	});
	
	// tooltips for the videos
	$('.footer-youtube-lightbox-01, .footer-youtube-lightbox-02').tooltip({
			showURL: false
		});
	
	// open all external links in a new window
	$('a[href^=http]').each(function() {
		if(this.href.indexOf(location.hostname) == -1) {
			$(this).click(function(){
				window.open(this.href);
				return false;
			});
		}
	});
	
	// open all pdf links in a new window
	$('a[href$=pdf]').each(function() {
		$(this).click(function(){
			window.open(this.href);
			return false;
		});
	});
	
	// tracking the click on the header opentable link
	function openTableLinkHeader() {
		_gaq.push(['_trackEvent', 'OpenTable', 'Clicked', 'Header Link']); 
	}
	
	// tracking the click on the footer opentable link
	function openTableLinkFooter() {
		_gaq.push(['_trackEvent', 'OpenTable', 'Clicked', 'Footer Link']); 
	}
});
