jQuery(document).ready(function($){

	// NAVBAR
	var check;
	var i;
	for(i=0;i<20;i++){
		if($(".a"+i+"").attr("id")){
		check=$(".a"+i+"").attr("id").slice(1,2);
		}
	}
	
	var selected=check*($("#b0").outerWidth());
	var position;

	$("#sprite").css({backgroundPosition:''+selected+'px 4px'});

	$("#b0,#b1,#b2,#b3,#b4,#b5,#b6,#b7").css({backgroundPosition:'0px 0px'}).mouseover(function(){
	position=$(this).attr("id").slice(1,2)*($("#b0").outerWidth());/*width of your list item*/
	$("#sprite").stop().animate({backgroundPosition:''+position+'px 4px'},{duration:300});
	});

	$("#b0,#b1,#b2,#b3,#b4,#b5,#b6,#b7").css({backgroundPosition:'0px 0px'}).mouseout(function(){
	$("#sprite").stop().animate({backgroundPosition:''+selected+'px 4px'},{duration:300});
	});
	
	
	/*
	// GALLERY ZOOM THING
$("ul.thumbREMOVE li").hover(function() {
	$(this).css({'z-index' : '10'}); // Add a higher z-index value so this image stays on top
	$(this).find('img').addClass("hover").stop() // Add class of "hover", then stop animation queue buildup
		.animate({
			marginTop: '-110px', // The next 4 lines will vertically align this image 
			marginLeft: '-110px',
			top: '50%',
			left: '50%',
			width: '174px', // Set new width 
			height: '174px', // Set new height 
			padding: '20px'
		}, 200); // this value of "200" is the speed of how fast/slow this hover animates 

	} , function() {
	$(this).css({'z-index' : '1'}); /* Set z-index back to 0 
	$(this).find('img').removeClass("hover").stop()  // Remove the "hover" class , then stop animation queue buildup
		.animate({
			marginTop: '0', // Set alignment back to default 
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '100px', // Set width back to default 
			height: '100px', // Set height back to default 
			padding: '5px'
		}, 400);
});
	*/


	// FANCYBOX'S
	
	/* This is basic - uses default settings */
	
	$("a.single_image").fancybox({
	});
	

	// onmouseover img hover
	
	$(function() {
	  $(".thumb img").hover(function() {
	    $(this).attr("src", $(this).attr("src").split(".").join("-hover."));
	  }, function() {
	    $(this).attr("src", $(this).attr("src").split("-hover.").join("."));
	  });
	});
	
});

