
$(document).ready( function() {

	var IE6 = (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 6);
	if(IE6) {
		/// PNGs
		$("img[src$='.png']").not('#logoimg').each(function() {
			var src = $(this).attr('src');
			
			$(this).attr("src", "http://www.dynamit.us/img/spacer.gif").attr("style", "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "');");
		});

		document.execCommand("BackgroundImageCache",false,true);
	
	}

	if ((screen.width<=1024) ) {
		$("#footer").css("width", "1024px");
	}

	$("#nav").dynamItDrop();
	
	/// setup the lightbox.
	//$(".lightbox").lightbox();


	$("fieldset #comments").focus(function() {
		if(this.value == 'Comments or questions...') {
			this.value = '';
		}
	});
	$("fieldset #comments").blur(function() {
		if(this.value == '') {
			this.value = 'Comments or questions...';
		}
	});

	$(".feat-image").mouseover(function() {
		var index = $(".feat-image").index(this);
		if(IE6) {
			$('#featurenav-bubbles').attr('style', 'display:block;');
		} else {
			$('#featurenav-bubbles').show();
		}
		if(!$(".bubble:visible").eq(index).length) {
			var bub = $(".bubble").eq(index);
			$(".bubble").not(bub).hide();
			if(IE6) {
				bub.attr('style', 'display:block;');
			} else {
				bub.show();
			}
		}
	});

	$(".feat").mouseover(function() {
		var index = $(".feat").index(this);
		if(IE6) {
			$('#featurenav-bubbles').attr('style', 'display:block;');
		} else {
			$('#featurenav-bubbles').show();
		}
		if(!$(".bubble:visible").eq(index).length) {
			var bub = $(".bubble").eq(index);
			$(".bubble").not(bub).hide();
			if(IE6) {
				bub.attr('style', 'display:block;');
			} else {
				bub.show();
			}
		}
	});

	$(".feat").mouseout(function() {
		$(".bubble").hide();
		$('#featurenav-bubbles').hide();
	});

	// CAROUSEL -- feature squares
	$('#featurenav ul').dynamItCarousel({
		next: '#arrow-right-link',
		prev: '#arrow-left-link',
		width: 233,
		wraparound: false,
		disabled: 'disabled',
		slideshow: false
	});

	// CAROUSEL -- feature squares
	$('#featurenav-bubbles ul').dynamItCarousel({
		next: '#arrow-right-link',
		prev: '#arrow-left-link',
		width: 233,
		wraparound: false,
		disabled: 'disabled',
		slideshow: false
	});
	
	$('ul#nav li ul li.hidden').remove();

});

function featuredVenue() {
	$("#main").hide();
	$("#background").fadeOut('slow');
}

function loadFeature(id) {
	dynamItLoad('/index.php?p=' + id, 'featurecontent', 0, 0, null);
}

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

function memberTickets() {
	dynamItLoad('/actions/member-tickets', 175, 500, 'auto', null);
}

function overlay(url) {
	dynamItLoad('/'+url, null, null, null, null);
}

function trackEvent(cal_name) {
	pageTracker._trackEvent("Calendar", cal_name)
}


