
	$(document).ready( function() {

		$('ul.playtab li').mouseover( function() {
			$(this).addClass('on');
		}).mouseout( function() {
			$(this).removeClass('on');
		});


		// setup the lightbox.
		$(".lightbox").lightbox();

	        $("a.returnsvoid").mouseover(function () {window.status = " ";});


		$('#goleft').hide();

		if($('#subnav li ul li.on').length)
			$('#subnav li ul li.on').parent().show();


		$("a.buytickets").click( function() {
			var link = $(this).attr('href');
			buyTicketsLink(link);
			return false;
		});

		
		// $('ul#sliderview').children().eq(0).append('<img id="now-playing" alt="Now Playing" src="img/tmp/nowplaying.gif" />');
		
	});


	function buyTicketsLink(link) {
		dynamItLinkOnConfirm(link,'<p><strong>Buy Tickets Now</strong><br />Call the CATCO box office at (614) 469-0939,<br /> or order tickets online by clicking \'ok\' to continue to Ticketmaster.</p><script>styleBox();</script>');
	}



	var carouselImgWidth = 873;
	var carouselOffset = 0;
	var carouselPosition = 0;
	var carouselIndex = 0;

	function slideCarousel(direction) {
		carouselIndex += direction;
		if( carouselIndex < 0 ) {
			carouselIndex = 0;
			return;
		}

		var max = $('#slider ul#sliderview').children('li').length - 1;
		if( carouselIndex > max ) {
			carouselIndex = max;
			return;
		}

		doSlideCarousel(carouselPosition + (direction * carouselImgWidth))


		if( carouselIndex == 0 ) {
			$('#goleft').hide();
		} else {
			$('#goleft').show();
		}

		if( carouselIndex == max ) {
			$('#goright').hide();
		} else {
			$('#goright').show();
		}


	}

    function styleTicketmasterBox() {

    }

	function doSlideCarousel(val) {
		val = -1 * val;
		$('ul#sliderview').stop().animate(
			{ left: val + 'px' },
			750,
			'swing' );
		carouselPosition = -1 * val;
	}

    // styles the default dynamItDialog for use with the ticketmaster linkonconfirm.
    function styleBox()
    {
        $('#dynamItPopUpWin p').css({
            fontFamily: "arial, sans-serif",
            fontStyle: "normal",
            fontVariant: "normal",
            fontWeight: "normal",
            letterSpacing: "normal",
            textAlign: "center",
            textIndent: "0",
            textTransform: "none",
            whiteSpace: "normal",
            wordSpacing: "normal",
            textdecoration: "none",
            fontSize: "14px",
            lineHeight: "24px",
            marginBottom: "0",
            color: "#191919"
        });
        $("#dynamItPopUpWin div div div div div").css("background-image", "url(img/tmp/ticket_dialog.png)").css("height", "175px");
        $("#dynamItPopUpWin div div div div div div").css("background", "transparent none").css("height", "84px");
    }



function showCalendar() {
	dynamItLoad('/actions/calendar/load', null, 732, 'auto', null);
}

function showPatronMail() {
	dynamItLoad('/actions/mail/form', null, 732, 'auto', null);
}