
$(document).ready(function(){		
		$(function() {
						
			$('#author-content').jScrollPane({showArrows:true,scrollbarWidth:3, scrollbarMargin:8,arrowSize:2,animateStep:8,reinitialiseOnImageLoad: true});
			$('#content').jScrollPane({showArrows:true,scrollbarWidth:3, scrollbarMargin:12,arrowSize:2,animateStep:8,reinitialiseOnImageLoad: true});
			$('.box-text-1').jScrollPane({showArrows:true,scrollbarWidth:3, scrollbarMargin:8,arrowSize:2,animateStep:8});
			
			$('#author-list-ul li a,#newreleases li a').bind('click',function(event){
				event.stopPropagation();
				event.preventDefault();
				var targetElementSelectorString = $(this).attr('href');				
				var temp = targetElementSelectorString.substring(1,targetElementSelectorString.length-21);				
				//console.log(temp);
				var url="authors.php?a=" + temp;
				window.location.href=url;
			});
		});
		$('.bookmark').live('click', function() {
				var targetElementSelectorString = $(this).attr('href');
				console.log(targetElementSelectorString);
				$('.scroll-pane')[0].scrollTo(targetElementSelectorString);
				console.log('scrolled did it?');
			return false;			
			});	
		
		
		/*Custom Slide Down Menu
		$(document).ready(function() {*/

			$("#menu li").hover(function() {
					$("#menu li").removeClass("hover");
					$(this).addClass("hover");
				$(this).find("span").show();
			} , function() { 
					$(this).removeClass("hover");
					$(this).find("span").hide();
			});
	
		//});

		/*accordian
			
$(document).ready(function () {*/
		
	$('#accordion li').click(function () {

		/* FIRST SECTION */

		//slideup or hide all the Submenu
		$('#accordion li').children('ul').slideUp('fast');	
			
		//remove all the "Over" class, so that the arrow reset to default
		$('#accordion li > a').each(function () {
			if ($(this).attr('rel')!='') {
				$(this).removeClass($(this).attr('rel') + 'Over');	
			}
		});
			
		/* SECOND SECTION */	
			
		//show the selected submenu
		$(this).children('ul').slideDown('fast');
			
		//add "Over" class, so that the arrow pointing down
		$(this).children('a').addClass($(this).children('li a').attr('rel') + 'Over');			

		return false;
	});
//});
});
