$(function() {

/*
// assign nav hooks
$('#nav-reservations').click(function(event){
	var w = window.location;
	if (w.pathname != '/960/') { window.location = '/960/'; }
	$('#col-center').load('portal.php');
	$('#col-right').load('includes/maui-theatre-sidebar.php');
//	event.preventDefault();
});
$('#nav-story').click(function(event){
	var w = window.location;
	if (w.pathname != '/960/') { window.location = '/960/#story'; }
	$('#col-center').load('includes/story-center.php');
	$('#col-right').load('includes/story-right.php');
//	event.preventDefault();
});
$('#nav-packages').click(function(event){
	var w = window.location;
	if (w.pathname != '/960/') { window.location = '/960/#packages'; }
	$('#col-center').load('includes/packages-center.php');
	$('#col-right').load('includes/packages-right.php');
//	event.preventDefault();
});
$('#nav-theatre').click(function(event){
	var w = window.location;
	if (w.pathname == '/960/maui-theatre.php') {
	$('#col-center').load('includes/theatre-center.php');
	$('#col-left').load('includes/theatre-left.php');
	$('#col-right').load('includes/theatre-right.php');
//	event.preventDefault();
	}
});
$('#nav-events').click(function(event){
	var w = window.location;
	if (w.pathname != '/960/maui-theatre.php') { window.location = '/960/maui-theatre.php#events'; }
	$('#col-center').load('includes/events-center.php');
//	event.preventDefault();
});
$('#nav-contact').click(function(event){
	$('#col-center').load('includes/contact-center.php');
	$('#col-right').load('includes/contact-right.php');
	event.preventDefault();
});
*/
/*
$('#nav-theatre').click(function(event){
	$('#col-left').load('includes/theatre-left.php');
	$('#col-center').load('includes/theatre-center.php');
	$('#col-right').load('includes/theatre-right.php');
	event.preventDefault();
});
*/
// end assign nav hooks

// show proper content
/*
var w = window.location;
if (w.hash == '#story') {$('#nav-story').click();}
else if (w.hash == '#packages') {$('#nav-packages').click();}
else if (w.hash == '#events') {$('#nav-events').click();}
else if (w.hash == '#contact') {$('#nav-contact').click();}
else if (w.pathname == '/960/') {$('#col-center').load('portal.php');}
*/

// reviews rotator
$('div.tabs').tabs('#critic-reviews > div', {
effect: 'fade',
fadeOutSpeed: 'slow',
rotate: true
}).slideshow({autoplay:true});

// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$('a[rel~="overlay"]').overlay({
	expose:'#000',
	effect:'apple',
	opacity:0.65,
	onBeforeLoad: function() {
		// grab wrapper element inside content
		var wrap = this.getContent().find('.contentWrap');
		// load the page specified in the trigger
		wrap.load(this.getTrigger().attr('href'));
	}
});

// fix for target="_blank"
$('a[rel~="external"]').click(function(){
window.open($(this).attr('href'));
return false;
});

});

