var lightBoxSettings = {
	imageBtnClose: '/d/sites/default/themes/mh/images/lightbox-btn-close.gif',
	imageLoading: '/d/sites/default/themes/mh/images/lightbox-ico-loading.gif',
	imageBtnPrev: '/d/sites/default/themes/mh/images/lightbox-btn-prev.gif',
	imageBtnNext: '/d/sites/default/themes/mh/images/lightbox-btn-next.gif'
};

var jPlayerPath = '/d/sites/default/themes/mh';

$(document).ready(function() {
	// Force the player to appear
	/* if(typeof window.parent.player == "undefined") {
		var prefix = 'http://' + window.location.host + '/d/';
		window.location.href = 'http://' + window.location.hostname + '/?q=' + window.location.href.substring(prefix.length);
	} */

	if($(document.body).hasClass('section-date-browser')) {
		$('.month-view td.has-events').each(function() {
			var when = this.id.substring(13).split('-');
			var d = new Date();
			d.setFullYear(when[0], when[1] - 1, when[2]);
			$('a', this)
				.attr('class', 'thickbox')
				.attr('title', d.toLocaleDateString())
				.attr('href', 'index.php?q=event_detail/' + when.join('/') + '&height=550&width=500')
				.text(parseFloat(when[2]));
		});
	}	// hasClass('page-date-browser')
	if($(document.body).hasClass('front')) {
		$.get('index.php', { q: 'current_ad' }, function(d) {
			if(d) {
				$(document.body).append('<a href="' + d + '" id="front-ad"><img src="' + d + '" /></a>');
				$('#front-ad').lightBox(lightBoxSettings).click();
			} // if
		}); // get()
	} // hasClass('front')

	// Enable LightBox globally
	$i = $('.imagecache-lightbox_thumbnail');
	if($i.length) {
		$i.lightBox(lightBoxSettings);
	}
	
	// Set rounded corners
	/* $('.panel-pane').corner('tr bl 15px');
	$('.panel-pane .view-content').corner('tr bl 15px');
	$('.item-list .pager').corner('15px');
*/
	// Undo a few of the rounded corners
	$('#fbTwit .jquery-corner, #gAds .jquery-corner').remove();
	
	//$('#random_video').height($('#topMusic').height());
});
