$(document).ready(function(){
	
	Shadowbox.init();

	$('.contact').hide();
	$('.events').hide();
	$('.links').hide();
	$('.bible').hide();
	$('.services').show();
	$('.pastor').hide();
	$('.news').hide();
	$('.book').val('nothing');
	
	$('.eventsbtn').click(function(){
		$('.events').slideDown('slow');
		$('.contact').slideUp('slow');
		$('.services').slideUp('slow');
		$('.links').slideUp('slow');
		$('.bible').slideUp('slow');
		$('.pastor').slideUp('slow');
		$('.news').slideUp('slow');
	});
	
	$('.contactbtn').click(function(){
		$('.contact').slideDown('slow');
		$('.events').slideUp('slow');
		$('.services').slideUp('slow');
		$('.links').slideUp('slow');
		$('.bible').slideUp('slow');
		$('.pastor').slideUp('slow');
		$('.news').slideUp('slow');
	});
	
	$('.biblebtn').click(function(){
		$('.bible').slideDown('slow');
		$('.contact').slideUp('slow');
		$('.events').slideUp('slow');
		$('.services').slideUp('slow');
		$('.links').slideUp('slow');
		$('.pastor').slideUp('slow');
		$('.news').slideUp('slow');
	})
	
	$('.servicesbtn').click(function(){
		$('.services').slideDown('slow');
		$('.contact').slideUp('slow');
		$('.events').slideUp('slow');
		$('.links').slideUp('slow');
		$('.bible').slideUp('slow');
		$('.pastor').slideUp('slow');
		$('.news').slideUp('slow');
	});
	
	$('.linksbtn').click(function(){
		$('.links').slideDown('slow');
		$('.services').slideUp('slow');
		$('.contact').slideUp('slow');
		$('.events').slideUp('slow');
		$('.bible').slideUp('slow');
		$('.pastor').slideUp('slow');
		$('.news').slideUp('slow');
	});
	$('.pastorbtn').click(function(){
		$('.links').slideUp('slow');
		$('.services').slideUp('slow');
		$('.contact').slideUp('slow');
		$('.events').slideUp('slow');
		$('.bible').slideUp('slow');
		$('.pastor').slideDown('slow');
		$('.news').slideUp('slow');
	});
	$('.newsbtn').click(function(){
		$('.links').slideUp('slow');
		$('.services').slideUp('slow');
		$('.contact').slideUp('slow');
		$('.events').slideUp('slow');
		$('.bible').slideUp('slow');
		$('.pastor').slideUp('slow');
		$('.news').slideDown('slow');
	});
	
	$('.servicesbtn').hover(function(){
		$(this).stop().animate({'paddingLeft' : "15px"})
		},
		function(){
		$(this).stop().animate({'paddingLeft' : "8px"});
		});

	$('.newsbtn').hover(function(){
		$(this).stop().animate({'paddingLeft' : "15px"})
		},
		function(){
		$(this).stop().animate({'paddingLeft' : "8px"});
		});

	$('.pastorbtn').hover(function(){
		$(this).stop().animate({'paddingLeft' : "15px"})
		},
		function(){
		$(this).stop().animate({'paddingLeft' : "8px"});
		});
	
	$('.linksbtn').hover(function(){
		$(this).stop().animate({'paddingLeft' : "15px"})
		},
		function(){
		$(this).stop().animate({'paddingLeft' : "8px"});
		});
	
	$('.eventsbtn').hover(function(){
		$(this).stop().animate({'paddingLeft' : "15px"})
		},
		function(){
		$(this).stop().animate({'paddingLeft' : "8px"});
		});
	
	$('.contactbtn').hover(function(){
			$(this).stop().animate({'paddingLeft' : "15px"})
			},
			function(){
			$(this).stop().animate({'paddingLeft' : "8px"});
			});
	
	$('.biblebtn').hover(function(){
			$(this).stop().animate({'paddingLeft' : "15px"})
			},
			function(){
			$(this).stop().animate({'paddingLeft' : "8px"});
			});
	
//sidebar Bible Query stuff
///////////////////////////
	$('.book').change(function(){
		$.post("common/scripts/php/getChapters.php", { book: $('.book').val() }, function(data){
			$('.chapter').html("<option value='nothing'>Select a Chapter</option>" + data);
			$('.verse').html("<option value='nothing'>Select a Verse</option>");
			$('#verses').html("");
		});
		$('.chapter').change(function(){
			$.post("common/scripts/php/getVerses.php", {book: $('.book').val(), chapter: $('.chapter').val() }, function(data2){
				$('.verse').html("<option value='nothing'>Select a Verse</option>" + data2);
				$('#verses').html("");
			});
		});
		$('.verse').change(function(){
			$.post("common/scripts/php/getVerse.php", {book: $('.book').val(), chapter: $('.chapter').val(), verse: $('.verse').val() }, function(data3){
				$('#verses').html(data3);
			});
		});
	});


});
