$(document).ready(function(){


$('.box').hover(function() {

		$(this).css('background-position', '152px top');

	},
	function() {
	$(this).css('background-position', 'left top');

});


$('.link-box').hover(function() {

		$(this).css('background-position', '152px top');

	},
	function() {
	$(this).css('background-position', 'left top');

});


$('#click-box').click(function() {
		$('body,html').animate({scrollTop:0},500);
});


$('.filter-box a').click(function() { 

$('.filter-box a.current').removeClass('current');
$(this).addClass('current');


	
	var filterVal = $(this).text().toLowerCase().replace(' ','-');
	
	if(filterVal == 'all') {
		
			$('.box-wrapper').stop().fadeTo(500, 1);
			
		} else {
				
		$('.box-wrapper').each(function() {
				
				if($('.link li', this).hasClass(filterVal)) {
					
					$(this).stop().fadeTo(500, 1);

				} else {
					
					$(this).stop().fadeTo(500, 0.1);
			

				}
			});
		
		}// Closes if(filterVal == 'all') {
		
	return false;
	
});// Closes $('.filter-box a').click(function() {
	
	
$('.box a').click(function(event){
						   
$('#loader').remove();
var location=$(this).attr('href');

event.preventDefault();

	$('body,html').animate({scrollTop:0},300, function() {
		
		$('#content-loader').append('<div id="loader"></div>');
		$('#loader').empty().html('<img src="wp-content/themes/simplicitybright_en/images/ajax-loader2.gif" />');
		$('#loader').load(location);
		$('#exit-btn').css('height', '22px');
	});
});

$('#exit-btn').click(function(){
		
$('#loader').remove();
$(this).css('height', '0px');

return false;

});



$('#list-box a').click(function(event){
var location=$(this).attr('href'); 

event.preventDefault();

	$('body,html').animate({scrollTop:0},300, function() {
		
		$('#content-loader').append('<div id="loader"></div>');
		$('#loader').empty().html('<img src="images/ajax-loader2.gif" />');
		$('#loader').load(location);
		$('#exit-btn').css('height', '22px');
	});
});

$('#exit-btn').click(function(){
		
$('#loader').remove();
$(this).css('height', '0px');

return false;

});

});
