google.load("webfont", "1");
google.load("jquery", "1.7.1");

google.setOnLoadCallback(function() {
	WebFont.load({
   		google: { families: [ 'Anton', 'Paytone+One', 'Bowlby+One+SC', 'Coda:800', 'Kreon', 'Oswald', 'Nova+Round', 'Francois+One', 'Days+One', 'Marvel', 'Abel', 'Hammersmith+One' ] }
	});
	$('section ul.menu li a').bind('click',function(event){
		event.preventDefault();
		var $anchor = $(this);

//		$('html, body').stop().animate({
//			scrollTop: $('#'+$anchor.attr('href')).offset().top
//			insertAfter: $('#'+$anchor.attr('href'))
//		});
		$('#'+$anchor.attr('href')).slideUp(function() {
			$('#'+$anchor.attr('href')).insertAfter("#first").slideDown();
		});
	});
	
	$('section ul.menu li select').bind('change',function(event){
		sport($('section ul.menu li select option:selected').val());
	});
	
//	$('a').addClass('available');

	$.getScript('javascripts/jquery.tinysort.js',function() {
		$("#NikeCatalogs ul li").tsort();
		$("#OtherCatalogs ul li").tsort();
	});
	
	
});

var sport = function(c) {
	if(c == 'All')
		$('article ul li a').css('color','#055590');
	else {
		$('article ul li').each(function() {  
			if($(this).hasClass(c) || $(this).hasClass('All'))
				$(this).children('a').css('color','#055590');
			else
				$(this).children('a').css('color','#ccdce9');
		});  
	}
}


