// 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); REMOVE SETTING BANDS
	
	staticRotate();
		
// 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 staticRotate() {
	
	var imgnum = 1;
	var imgtotal = 17;
	var imgpath = template_url + '/images/home/venueshots/';
	var holderlast = false;
	
	$('#homePageCenter #shows').html('<img src="' + imgpath + 'image' + imgnum + '.jpg' + '" alt="THANKS FOR A GREAT 2009 SEASON" class="static">');
	imgnum++;
		
	// LOOP THROUGH IMAGES
	var img = '';
	$('body').everyTime(3000, function(i) {
		if(imgnum > imgtotal) imgnum = 1;
		if(holderlast) imgnum--;
		holderlast = false;
		img = 'image' + imgnum + '.jpg';
		imgnum++;
		$('#homePageCenter #shows img.static').attr('src', imgpath + img);
	});
	
	// SET SIDE TEXT
	$('#feattitle').html('THANKS FOR A GREAT<br/>2009 SEASON!');
	$('#featsupport').html('We\'ll see you next year.');	
}

function showfeatured(featured) {
	$('#featstatus').html(featured['featstatus']);
	$('#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']);
}