// JavaScript Document

$(function() {
		
	$('.concert_listing .buy .details').hover(
		function() {
			$(this).css('color', '#FFFFFF');	
			$(this).children('.detailsCopy').css('display', 'block');
		}, 
		function() {
			$(this).css('color', '#6FC9FB');	
			$(this).children('.detailsCopy').css('display', 'none');
		}
	)
	
	
	$('a.emaillink').nospam({ filterLevel: 'low', replaceText: true });
	
	//$('.scroll-pane').jScrollPane({showArrows:true, reinitialiseOnImageLoad:true, dragMinHeight:50, scrollbarWidth:12, arrowSize:12 });	 
		
	setfeatured(theFeatured);
	
// END THE ON LOAD FUNCTION
});

function setfeatured(features) {
	
	var featnum = 1;
	
	// SET INTIAL FEATURE
	showfeatured(features['events'][0]);
	
	if(features['count'] > 1) {
		// LOOP THROUGH FEATURES
		$('body').everyTime(5000, function(i) {
			if(featnum + 1 > features['count']) featnum = 0;
			showfeatured(features['events'][featnum]);
			featnum++;
		});
		
	} 
}

function showfeatured(featured) {
	$('#featday').html(featured['featday']);
	$('#featdate').html(featured['featdate']);
	$('#feattitle').html(featured['feattitle']);
	$('#featsupport').html(featured['featsupport']);
	$('#feattime').html(featured['feattime']);
	$('#feattimespec').html(featured['feattimespec']);
	$('#featbuy').html(featured['featbuy']);
	$('#featprice').html(featured['featprice']);
	$('#featimg').html(featured['featimg']);
	$('#featsettimes').html(featured['featsettimes']);
	$('#featadditional .text').html(featured['featadditional']);
}