$(document).ready(
	function(){
		if ($("#introvideo").length > 0){
			$("html").click(
				function() {
					$("#introvideo").hide();
					$("#introvideo").html('');
				});
			$("#introvideoClose").click(
				function() {
					$("#introvideo").hide();
					$("#introvideo").html('');
				});
		}
		
		$("#frontcontent_images").innerfade({
			speed: 4000,
			timeout: 8000,
			type: 'random_start',
			containerheight: '315px'
			});
		
		$.fn.supersized.options = {
			startwidth: 1024,
			startheight: 768,
			vertical_center: 0,
			slideshow: 0,
			navigation: 0,
			transition: 0,
			pause_hover: 0,
			slide_counter: 0,
			slide_captions: 0,
			slide_interval: 0
		};
		
		$("#supersize").supersized();
		
		$("#footercontent").hide();
		
		$("#showfooter").click(
			function() {
				$("#footercontent").slideDown(500, "easeInQuint");
				$("#showfooter").hide();
				$("#hidefooter").show();
			});
			
		$("#hidefooter").click(
			function() {
				$("#footercontent").slideUp(500, "easeOutQuint");
				$("#hidefooter").hide();
				$("#showfooter").show();
			});
		
		$("a[rel='external']").addClass("external").click(
			function() {
        		window.open( $(this).attr('href') );
        		return false;
    		});
		
		$("a.store").fancybox({
			'padding': 0,
			'frameWidth': 468,
			'frameHeight': 590,
			'hideOnContentClick': false
			});
		
		$("a.vidlink").fancybox({
			'padding': 0,
			'frameWidth': 368,
			'frameHeight': 207,
			'hideOnContentClick': false
			});
		
		$("a.newsletter").fancybox({
			'padding': 10,
			'frameWidth': 280,
			'frameHeight': 145,
			'hideOnContentClick': false
			});
		
		$(".promoitem a, .promoitemlast a").children('img').fadeTo(1, 0.8);
  
  		$(".promoitem, .promoitemlast").hover(
    		function () {
    			$(this).children('a').children('img').fadeTo("fast", 1);
    		},
    		function () {
      			$(this).children('a').children('img').fadeTo("normal", 0.8);
    		});
		
		$(".button").hover(
    		function () {
    			$(this).css({'background' : '#061835'});
    		},
    		function () {
      			$(this).css({'background' : '#667794'});
    		});
		
		$("#brands li a").children('img').fadeTo(1, 0.8);
  
  		$("#brands li a").hover(
    		function () {
    			$(this).children('img').fadeTo("fast", 1);
    		},
    		function () {
      			$(this).children('img').fadeTo("normal", 0.8);
    		});
		
		$.fn.qtip.styles.brandtip = {
					width: 270,
					tip: 'topMiddle',
					background: '#667794',
					padding: 5,
					border: {
						radius: 10,
						color: '#667794'
						}
					};		
					
		$("li#aggressive").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/aggressive.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
		
		$("li#buffalo").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/buffalo.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
		
		$("li#first").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/first.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
						
		$("li#girlsport").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/girlsport.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#hockey").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/hockey.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#icestyle").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/icestyle.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#kids").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/kids.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#ml").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/ml.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#sportstyle").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/sportstyle.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#touche").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/touche.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
							
		$("li#wild").qtip({
					content: {
						prerender: 'true',
						url: 'brandinfo/wildlife.html'
						},
					show: {
						solo: 'true',
						effect: {
							length: 0
							}
						},
					style: 'brandtip',
					position: {
						corner: {
							target: 'bottomMiddle',
							tooltip: 'topMiddle'
						}
					}
					});
		
		$("div.scrollable").scrollable({
			size: 3,
			items: '#thumbs',
			clickable: false,
			prev: '#scrollprev',
			next: '#scrollnext',
			navi: '#scrollnavi'
		});
		
		$.fn.clearDefault = function(){
			return this.each(function(){
				var default_value = $(this).val();
				$(this).focus(function(){
					if ($(this).val() == default_value) $(this).val("");
				});
				$(this).blur(function(){
					if ($(this).val() == "") $(this).val(default_value);
				});
			});
		};
		
		$('input.clear-default').clearDefault();
		
	});
