$(document).ready(function(){

	// Animate neon bar on homepge
	if($('#content-home').length) {
		$("div#neon-bar").animate( { width:"100%" }, 3000, function(){
			$("div#neon-bar").fadeOut("normal");
		});
	}
    
	// Animate content buttons on mouseover
	$("div.tx-jbbuttons-pi1 img").mouseover(function(){
		$(this).stop();
	  	$(this).animate( {marginTop : '0px'}, 200);
	});

	$("div.tx-jbbuttons-pi1 input").mouseover(function(){
	    $(this).stop();
	    $(this).animate( {marginTop : '0px'}, 200);
	});

	// Animate content buttons on mouseout
	$("div.tx-jbbuttons-pi1 img").mouseout(function(){
		$(this).stop();
	  	$(this).animate( {marginTop : '-24px'}, 200);
	});

	$("div.tx-jbbuttons-pi1 input").mouseout(function(){
	   $(this).stop();
	   $(this).animate( {marginTop : '-24px'}, 200);
	});
	
	// smooth sliding at TO-TOP-LINKS
	$('.csc-linkToTop a').click(function(e){
		e.preventDefault();
		$('html,body').stop(true,true).animate({scrollTop: 0});
	});
	
	// Mouseover for chapter images on cases
	$('#tx-jbcases-pi1 .chapter .thumb').mouseenter(function() {
		$(this).stop();
		$(this).find('.over').animate( {top: '0'}, 200);
		$(this).find('.over-inner').animate( {top: '0'}, 200);
	});
	
	// Mouseout for chapter images on cases
	$('#tx-jbcases-pi1 .chapter .thumb').mouseleave(function(){
		$(this).stop();
		$chapter = $(this).parent();
		$chapter.find('.over').animate( {top: '120'}, 200);
		$chapter.find('.over-inner').animate( {top: '120'}, 200);
	});
	
	$('#tx-jbcases-pi1 .chapter .over-inner').live('click', function(){
		document.location.href = $(this).parent().find('a').attr('href');
	});
	
});
