// JavaScript Document

// Footer nav - auto space
// Footer nav - auto space

$(function(){
		$('#footerNavUL').equalWidths({'stripPadding': 'both'});
});


// Main nav - removes last pipe
// Main nav - removes last pipe

$(function(){
	$('#MainNavUL li a').last().addClass('lastNav');
});



// Home page scroller
// Home page scroller

$(function() {
	$('#headlines').cycle({
		timeout: '7000',
		next:   '#next2', 
    	prev:   '#prev2', 
		pager:  '#controllerPag' 
	});
	
	// Pause on mouse over area with class headlinePanel
	$('.headlinePanel').mouseenter(function() { 
		$('#headlines').cycle('pause'); 
		}).mouseleave(function() { 
		$('#headlines').cycle('resume', true); 
	});
	
});




// Slideshow scroller
$(function() {
$('.slideshow').cycle({
		fx: 'fade',
		timeout: '4000',
	});
});



///Homepage counter
$(function() {
	$("#GuestBookComment").charCounter(1000, {
		container: "#counterLimit"
	});
});




// Toggle panel
// Toggle panel

$(function() {
		   
	$(".trigger").click(function(){
		$(this).next(".toggle_container").toggleClass("showPanel","slow");
		return false; //Prevent the browser jump to the link anchor
	});
	
	$(".close").click(function(){
		$(this).parents(".toggle_container").toggleClass("showPanel","slow");
		return false; //Prevent the browser jump to the link anchor
	});
	
});



// Album info reveal
// Album info reveal
$(function() {
	$('.MusicMenu').hover(function(){
		$(".boxcaption", this).stop().animate({height:'95px'},{queue:false,duration:320});
	}, function() {
		$(".boxcaption", this).stop().animate({height:'0px'},{queue:false,duration:320});
	});
});



// Music player reveal
// Music player reveal

$(function() {

	//Add the class / open the panel
	$(".Mplayer").click(function(){
		//$(".Mplayer_container").addClass("showPanelMplayer","slow");
		$(this).parent().children('.Mplayer_container').addClass("showPanelMplayer","slow");
		return false; //Prevent the browser jump to the link anchor
	});
	
	//Toggle (Remove) the class / close the panel and stop the music
	$(".jp-stop").click(function(){
		$(this).parents(".Mplayer_container").toggleClass("showPanelMplayer","slow");
		return false; //Prevent the browser jump to the link anchor

	});

});


// Lyrics reveal
// Lyrircs reveal


$(function() {
		   
	$(".LyricOpen").click(function(){
		//$(".Lyric_container").addClass("showPanelLyric","slow");
		$(this).parent().children('.Lyric_container').addClass("showPanelLyric","slow");
		return false; //Prevent the browser jump to the link anchor
	});
	
	$(".close").click(function(){
		$(this).parents(".Lyric_container").toggleClass("showPanelLyric","slow");
		return false; //Prevent the browser jump to the link anchor
	});
	
});



// email sign up validation
// email sign up validation


$(function() {

	$('input:text#mailinglist_form2').focus(function(){
		var newValue = $(this).val();
		if($(this).val() == 'Email update'){
		$(this).attr('value','');
		} else {
		$(this).val(newValue);
		}
	});
	
	$('input:text#mailinglist_form2').blur(function(){
		var newValue = $(this).val();
		if($(this).val() == ''){
		$(this).attr('value','Email update');
		} else {
		$(this).val(newValue);
		}
	});
});


