// Gallery fade
$(document).ready(function() {
	$("div.gallery ul li a").fadeTo('fast', 0.5);
	$("div.gallery ul li a").hover(function() {
		$(this).fadeTo('fast', 1.0);
	},
	function() {
	  $(this).fadeTo('fast', 0.5);
	});
});

//Event Flyer fade
  //on index.php
function slideSwitch() {
	var $active = $('.event .eventImage a.active');
	  if ( $active.length == 0 ) $active = $('.event .eventImage a:last');
		var $next =  $active.next().length ? $active.next() : $('.event .eventImage a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {setInterval( "slideSwitch()", 8000 );});
  //on single.php
function slideSwitch2() {
	var $active = $('.event-header .eventImage a.active');
	  if ( $active.length == 0 ) $active = $('.event-header .eventImage a:last');
		var $next =  $active.next().length ? $active.next() : $('.event-header .eventImage a:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {setInterval( "slideSwitch2()", 8000 );});

//Event listing fade
// Gallery fade
$(document).ready(function() {
	$(".eventList img").fadeTo('fast', 0.5);
	$(".eventList li").hover(function() {
		$("img", this).fadeTo('fast', 1.0);
	},
	function() {
	  $("img", this).fadeTo('fast', 0.5);
	});
});

// Download MP3 files
function getmp3(x){
getittemp = window.open(x,'','left=10000,screenX=10000');
getittemp.document.execCommand('SaveAs','null','download.pdf');
getittemp.close();
}

// Popup player
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=0,resizable=0,width=240,height=240,left = 600,top = 360');");
}

