var extra_calendar_options = {
    theme: true,
    header: {
        left: '',
        center: 'title',
        right: 'prev,next today'
    }
};

// Customize rendering of calendar
var fc_load_event_bubble_callback = function(calEventObj,bubbleDiv) {
	var title =
	    (calEventObj.thumbnail_html == null ? '&nbsp;' : calEventObj.thumbnail_html ) +
	    '<span class="event_subtitle">' +
		(calEventObj.post.meta.subtitle == null ? '&nbsp;' : calEventObj.post.meta.subtitle ) +
	    '</span>';

	if( calEventObj.url.length > 0 )
	    title = '<a href="' + calEventObj.url + '" class="event_link">' + title + '</a>';
	bubbleDiv.html(
	    title +
	    '<span class="event_price">' +
		(calEventObj.post.meta.price == null ? '&nbsp;' : calEventObj.post.meta.price ) +
		(calEventObj.post.meta.doors_date.timestamp == false ? '' : ', Doors: ' + calEventObj.post.meta.doors_date.time) +
	    '</span>' +
	    '<span class="event_notes">' +
		(calEventObj.post.meta.venue_notes == null ? '&nbsp;' : calEventObj.post.meta.venue_notes ) +
	    '</span>'
	);
};

jQuery(document).ready(function($) {
	$("#footer li:first-child").addClass("first-item");
	$("#footer li:last-child").addClass("last-item");
	$("#access .menu li:last-child").addClass("last-item");

	$('.gallery-item a').addClass('thickbox');

	$(".event_wrap:odd").addClass("odd-event");


	$('li.menu-item').children('ul.sub-menu').parent().addClass('hasSubMenu');


	$('#tabs a#onsale_link').click(function() {
		$('#news_tab').css('z-index', '5');
		$('#onsale_tab').css('z-index', '10');
		$(this).removeClass('off_tab');
		$(this).siblings().addClass('off_tab');
		return false;
	});

	$('#tabs a#news_link').click(function() {
		$('#onsale_tab').css('z-index', '5');
		$('#news_tab').css('z-index', '10');
		$(this).removeClass('off_tab');
		$(this).siblings().addClass('off_tab');
		return false;
	});


	// rollovers for search and email signup

	$('#mc_signup_submit').mouseover(function() {
		$('#email_signup_nav form').css('background-position', '-247px -129px');
	});

	$('#mc_signup_submit').mouseout(function() {
		$('#email_signup_nav form').css('background-position', '-247px -88px');
	});



	$("#mc_mv_EMAIL").val('signup for email love');
	// for form fields clear on focus...  
	$("#mc_mv_EMAIL").focus(function() {
		if( this.value == 'signup for email love' ) {
			this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = 'signup for email love';
			}
	});

			

	// for equal height columns (anything wrapped in  <div class="equal_height">
	function setEqualHeight(columns)
	 {
	 var tallestcolumn = 0;
	 columns.each(
	 function()
	 {
	 currentHeight = $(this).height();
	 if(currentHeight > tallestcolumn)
	 {
	 tallestcolumn  = currentHeight;
	 }
	 }
	 );
	 columns.height(tallestcolumn);
	 }
	$(document).ready(function() {
	 setEqualHeight($(".equal_height  > div"));
	});

	var tabHeight = $('#news_tab').height() + $('#tabs').height() + 170;
	$('#sidebar_tabs').height(tabHeight);

	// stop equal height columns

        // Click to play jukebox
        jQuery('#header').delegate('#jukebox','click',
            function() {
                if( jQuery(this).find('object').size() == 0) {
			if( typeof gs_embed !== 'undefined' )
			    jQuery(this).html(gs_embed);
			else
	                    jQuery(this).html('<object width="236" height="40"> <param name="movie" value="http://listen.grooveshark.com/songWidget.swf" /> <param name="wmode" value="transparent" /> <param name="allowScriptAccess" value="always" /> <param name="flashvars" value="hostname=cowbell.grooveshark.com&widgetID=25075281&style=metal&p=1" /> <embed src="http://listen.grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" width="236" height="40" flashvars="hostname=cowbell.grooveshark.com&widgetID=25075281&style=metal&p=1" allowScriptAccess="always" wmode="transparent" /></object>');
		}
            }
        );
        jQuery('#jukebox').hover(
            function(){$(this).css('background-position','0 -40px')},
            function(){$(this).css('background-position','0 0')}
        );

}); // STOP JQUERY

