
$(document).ready(function() {
		//main site slider
		 $('.fullsize').cycle({ 
			  fx:'fade', 
			  timeout:0, 
			  speed: 500,
			  pager:  '#navi',
			  pagerAnchorBuilder: function(idx, slide) { 
			    var stadium = jQuery(slide).attr('data-team');
			    var title = jQuery(slide).attr('title');
			    return '<a href="#/'+stadium+'">' + title + '</a>';
			  },
			before:  onBefore, 
			after:   onAfter  
			});
			function onBefore() { 
				$('.fulldesc .desc-item').fadeOut('fast');
			} 
			function onAfter() {
				var logo = $(this).attr('data-team');
				$('.fulldesc .desc-item[data-team='+ logo+']').fadeIn('fast');
			}
			
			//slide resize
                var $winwidth = $(window).width();
			
               $(".fullsize img").attr({
                        width: $winwidth
						
                });
                $(window).bind("resize", function(){
						
                        var $winwidth = $(window).width();
						
                        $(".fullsize img").attr({
                                width: $winwidth
                       });
						
						
					
					
                });
			//colorbox 
			$("a[href$='.jpg']").colorbox({rel:'gal'});
			
			//tipTip
			$('.tip').tipTip({
                edgeOffset: 10
                });
				
			//masonry
			var $container = $('#box');

			$container.imagesLoaded( function(){
			  $container.masonry({
				itemSelector : '.size-thumbnail'
			  });
			});

			//close label
			$('.close').click(function() {
				$(this).parent().parent().fadeOut('fast');
			});
			//fade in main content
			$('#content, footer.foot, #navi, .page-grid, .fulldesc, .hideall').hide().delay(600).fadeIn(650);

			
			//hide all
			$('.hideall').click(function(){
				$(this).hide();
				$('.showall').show();
				$('footer.foot, #branding').fadeOut();
				
			});
			$('.showall').click(function(){
				$(this).hide();
				$('.hideall').show();
				$('footer.foot, #branding').fadeIn();
				
			});
			//scroll top
			$('.gotop').click(function(){
				$('html, body').animate({scrollTop : 0},'normal');
			 });
});						
						
						

//window.onresize = function(){
//    var img = document.getElementById('source-image');
//    img.style.width = "100%";
//};
	




