/* Compiled JavaScript for Goalrilla */ var df = document.forms;google.setOnLoadCallback(function () {  setHideMails();  initMainNav();initDropMenu();  setCustomSelectors();  setLinks();  setZoom();  loadJavaScriptFile("/scripts/plugins/jquery.slide.js", initTechBits, true, true);if ($('.home-rotate').length > 0) {loadJavaScriptFile("/scripts/img-rotate.js", RotateImg, true, true);}    loadJavaScriptFile("/scripts/plugins/jquery.easing.1.3.js", jsnull, true, true);    if ($('.customScrollBox').length > 0) {    loadJavaScriptFile("/scripts/plugins/jquery.mousewheel.min.js", jsnull, true, true);    loadJavaScriptFile("/scripts/plugins/jquery.mCustomScrollbar.js", initScroll, true, true);  }    if (typeof pageOnLoad == 'function') {    pageOnLoad();  }});function setCustomSelectors() {    jQuery.extend(jQuery.expr[":"], {    external: function (obj) {      return obj.href && !obj.href.match(/^mailto\:/) && !obj.href.match(/^javascript\:/) && (obj.hostname && (obj.hostname != location.hostname));    },    mailto: function (obj) {      return obj.href && obj.href.match(/^mailto\:/);    },    pdf: function (obj) {      return obj.href && obj.href.match(/\.pdf$/);    },    zip: function (obj) {      return obj.href && obj.href.match(/\.zip$/);    }  });}function setLinks() {    $("a:external").addClass("external");  $("a:mailto").addClass("mailto");  $("a:pdf").addClass("pdf");  $("a:zip").addClass("zip");    setLinkAnalytics();}function loadJavaScriptFile(scriptName, callback, async_bool, cache_bool) {      $.ajaxSetup({    async: async_bool,    cache: cache_bool  });    $.getScript(scriptName, callback);    $.ajaxSetup({    cache: false,    async: true  });}function closeDialogsByOverlay(event) {    var closeButton = $(".ui-dialog:visible").find(".ui-dialog-titlebar-close");  closeButton.trigger("click");  $(".ui-widget-overlay").unbind("click", closeDialogsByOverlay);}function initScroll() {  if ($('#scroll-copy').length > 0) {$("#scroll-copy").mCustomScrollbar("vertical", 0, "easeOutCirc", 1.1, "fixed", "yes", "no", 18);}  if ($('#videoscroll-copy').length > 0) {$("#videoscroll-copy").mCustomScrollbar("vertical", 0, "easeOutCirc", 1.1, "fixed", "yes", "no", 18);}  if ($('#scroll-copy2').length > 0) {$("#scroll-copy2").mCustomScrollbar("vertical", 0, "easeOutCirc", 1.1, "fixed", "yes", "no", 18);}}function jsnull (){}function initPreloadPlugin() {  (function ($) {    var cache = [];        $.preLoadImages = function () {      var args_len = arguments.length;      for (var i = args_len; i--; ) {        var cacheImage = document.createElement('img');        cacheImage.src = arguments[i];        cache.push(cacheImage);      }    }  })(jQuery)}function initMainNav() {$("ul.navbar span").mouseover(function () {$(this).stop().animate({opacity: 1}, 700);});$("ul.navbar span").mouseout(function () {$(this).stop().animate({opacity: 0}, 700);}); }function initTechBits() { $(".tech-bit .tech-mouser").mouseover(function(){if(!$(this).hasClass("paused")){$(this).siblings(".tech-overlay").hide("slow");}}).mouseout(function(){if(!$(this).hasClass("paused")){$(this).siblings(".tech-overlay").show("slow");}}).click(function(){if($(this).hasClass("paused")){$(this).removeClass("paused");$(this).siblings(".tech-overlay").show("slow");}else{$(this).addClass("paused");}  });    $(".ie8 .tech-bit .tech-mouser, .ie7 .tech-bit .tech-mouser, .ie6 .tech-bit .tech-mouser").css({ background: 'url(/images/global/trans-fix.gif)' });}if($(this).hasClass("paused")){$(this).removeClass("paused");$(this).siblings(".tech-overlay").show("slow");}else{$(this).addClass("paused");}function initDropMenu() {   $(".sports-btn").mouseenter(function(){showDropMenu(".sports-btn")});   $(".equip-btn").mouseenter(function () { showDropMenu(".equip-btn") });   $(".bball-btn").mouseenter(function () { showDropMenu(".bball-btn") }); $(".warranty-btn").mouseenter(function () { showDropMenu(".warranty-btn") });   $(".sports-btn").mouseleave(function () { hideDropMenu(".sports-btn") });   $(".equip-btn").mouseleave(function () { hideDropMenu(".equip-btn") });   $(".bball-btn").mouseleave(function () { hideDropMenu(".bball-btn") }); $(".warranty-btn").mouseleave(function () { hideDropMenu(".warranty-btn") }); $(".cs-btn").click(function(){toggleMobileMenu(".cs-btn")}); $(".mobile-sports-btn").click(function(){toggleMobileMenu(".mobile-sports-btn")}); $(".mobile-equip-btn").click(function(){toggleMobileMenu(".mobile-equip-btn")}); $(".mobile-bball-btn").click(function(){toggleMobileMenu(".mobile-bball-btn")});}function toggleDropMenu(stClass){if($(stClass).hasClass("open")){hideDropMenu(stClass);}else{showDropMenu(stClass);}}function showDropMenu(stClass) {  if (!$(stClass).hasClass("open")) {    $(stClass + " .drop").stop(false, true).fadeIn("slow");$(stClass).addClass("open");}}function hideDropMenu(stClass) {  if ($(stClass).hasClass("open")) {    $(stClass).removeClass("open");    $(stClass + " .drop").stop(false, true).fadeOut("fast");}}function hasOtherOpenNav(stClass) {    if ($(stClass + ".open").length <= $(".navbar .open").length) {    return true;  } else {    return false;  }}function toggleMobileMenu(stClass){if($(stClass).hasClass("open")){    $(stClass).removeClass("open");    $(stClass + " .drop").stop(false, true).slideUp("slow");}else if (!$(stClass).hasClass("open")) {$(".open").removeClass("open").children(".drop").slideUp("slow");    $(stClass + " .drop").stop(false, true).slideDown("slow");$(stClass).addClass("open");}}var $dialog;function setZoom() {  if ($('.zoom1-lnk').length > 0) {    $dialog = $('#photo-zoom')  .dialog({    resizable: false,    draggable: false,    closeOnEscape: true,    modal: true,    autoOpen: false,    width: 544,    zIndex: 9000  });    hideAllPhotos();    $('.zoom1-lnk').attr("href", "javascript:jsnull('enlarge');").click(function () {      loadLargerImage("#zoom1");      return false;    });    $('.zoom2-lnk').attr("href", "javascript:jsnull('enlarge');").click(function () {      loadLargerImage("#zoom2");      return false;    });    $('.zoom3-lnk').attr("href", "javascript:jsnull('enlarge');").click(function () {      loadLargerImage("#zoom3");      return false;    });  }}function loadLargerImage(divID) {hideAllPhotos();$(divID).removeClass('hide');$dialog.dialog('open');$(".ui-widget-overlay").bind("click", closeDialogsByOverlay);}function hideAllPhotos(){$("#zoom1").addClass('hide');$("#zoom2").addClass('hide');$("#zoom3").addClass('hide');}function setTrainerPhotos(){if($(".gtrainer-main").length > 0){var side = "1";$(".trainer-thumb").each(function () {  $(this).mouseover(function () {    var thisNum = $(this).attr("class");    thisNum = thisNum.substr(14);    side = thisNum.substr(4, 1);    var thumb = thisNum.substr(11, 1);    changeTrainerPhoto(side, thumb);        currentImg = thumb;    pause();    removeTrainerActiveClasses();    $(this).addClass("active");  })}).mouseout(play);$(".gtrainer-main img").mouseover(pause).mouseout(play);preloadTrainerImages(side);}}function changeTrainerPhoto(side, thumb){var imageUrl = "/images/trainer/";var sideName = "dampening";if(side == "2"){ sideName = "rebound"; }var fullImageUrl = imageUrl + sideName + "-pic" + thumb + ".jpg";$(".gtrainer-main img").attr("src",fullImageUrl);}function removeTrainerActiveClasses(){$('.trainer-thumb').removeClass("active");}function preloadTrainerImages(side){    initPreloadPlugin();if(side == "2"){jQuery.preLoadImages("/images/trainer/rebound-pic2.jpg");jQuery.preLoadImages("/images/trainer/rebound-pic3.jpg");jQuery.preLoadImages("/images/trainer/rebound-pic4.jpg");jQuery.preLoadImages("/images/trainer/rebound-pic5.jpg");}else{jQuery.preLoadImages("/images/trainer/dampening-pic2.jpg");jQuery.preLoadImages("/images/trainer/dampening-pic3.jpg");jQuery.preLoadImages("/images/trainer/dampening-pic4.jpg");jQuery.preLoadImages("/images/trainer/dampening-pic5.jpg");jQuery.preLoadImages("/images/trainer/dampening-pic6.jpg");}}function setStrikerPhotos(){if($(".striker-main").length > 0){var side = "1";$(".striker-thumb").each(function () {  $(this).mouseover(function () {    var thisNum = $(this).attr("class");    thisNum = thisNum.substr(14);    side = thisNum.substr(4, 1);    var thumb = thisNum.substr(11, 1);    changeStrikerPhoto(side, thumb);        currentImg = thumb;    pause();    removeStrikerActiveClasses();    $(this).addClass("active");  })}).mouseout(play);$(".striker-main img").mouseover(pause).mouseout(play);preloadStrikerImages(side);}}function changeStrikerPhoto(side, thumb){var imageUrl = "/images/trainer/";var sideName = "striker-goal";if(side == "2"){ sideName = "striker-rebound"; }var fullImageUrl = imageUrl + sideName + "-pic" + thumb + ".jpg";$(".striker-main img").attr("src",fullImageUrl);}function removeStrikerActiveClasses(){$('.striker-thumb').removeClass("active");}function preloadStrikerImages(side){    initPreloadPlugin();if(side == "2"){jQuery.preLoadImages("/images/trainer/striker-rebound-pic2.jpg");jQuery.preLoadImages("/images/trainer/striker-rebound-pic3.jpg");}else{jQuery.preLoadImages("/images/trainer/striker-goal-pic2.jpg");jQuery.preLoadImages("/images/trainer/striker-goal-pic3.jpg");}}function setASTrainerPhotos(){if($(".allseason-main").length > 0){var side = "1";$(".allseason-thumb").each(function () {  $(this).mouseover(function () {    var thisNum = $(this).attr("class");    thisNum = thisNum.substr(16);    side = thisNum.substr(4, 1);    var thumb = thisNum.substr(11, 1);    changeASTrainerPhoto(side, thumb);        currentImg = thumb;    pause();    removeASTrainerActiveClasses();    $(this).addClass("active");  })}).mouseout(play);$(".allseason-main img").mouseover(pause).mouseout(play);preloadASTrainerImages(side);}}function changeASTrainerPhoto(side, thumb){var imageUrl = "/images/trainer/";var sideName = "as-goal";if(side == "2"){ sideName = "as-rebound"; }var fullImageUrl = imageUrl + sideName + "-pic" + thumb + ".jpg";$(".allseason-main img").attr("src",fullImageUrl);}function removeASTrainerActiveClasses(){$('.allseason-thumb').removeClass("active");}function preloadASTrainerImages(side){    initPreloadPlugin();if(side == "2"){jQuery.preLoadImages("/images/trainer/as-rebound-pic2.jpg");jQuery.preLoadImages("/images/trainer/as-rebound-pic3.jpg");jQuery.preLoadImages("/images/trainer/as-rebound-pic4.jpg");jQuery.preLoadImages("/images/trainer/as-rebound-pic5.jpg");jQuery.preLoadImages("/images/trainer/as-rebound-pic6.jpg");}else{jQuery.preLoadImages("/images/trainer/as-goal-pic2.jpg");jQuery.preLoadImages("/images/trainer/as-goal-pic3.jpg");jQuery.preLoadImages("/images/trainer/as-goal-pic4.jpg");jQuery.preLoadImages("/images/trainer/as-goal-pic5.jpg");jQuery.preLoadImages("/images/trainer/as-goal-pic6.jpg");}}function setSpringTrainerPhotos() {    if ($(".spring-trainer-main").length > 0) {    var side = "1";    $(".spring-trainer-thumb").each(function () {      $(this).mouseover(function () {        var thisNum = $(this).attr("class");        thisNum = thisNum.substr(21);        side = thisNum.substr(4, 1);        var thumb = thisNum.substr(11, 1);        changeSpringTrainerPhoto(side, thumb);                currentImg = thumb;        pause();        removeSpringTrainerActiveClasses();        $(this).addClass("active");      })    }).mouseout(play);    $(".spring-trainer-main img").mouseover(pause).mouseout(play);    preloadSpringTrainerImages(side);  }}function changeSpringTrainerPhoto(side, thumb) {  var imageUrl = "/images/spring-trainer/";  var sideName = "hitting";  if (side == "2") { sideName = "pitchback"; }  var fullImageUrl = imageUrl + sideName + "-pic" + thumb + ".jpg";  $(".spring-trainer-main img").attr("src", fullImageUrl);}function removeSpringTrainerActiveClasses() {  $('.spring-trainer-thumb').removeClass("active");}function preloadSpringTrainerImages(side) {    initPreloadPlugin();  if (side == "2") {    jQuery.preLoadImages("/images/spring-trainer/pitchback-pic2.jpg");    jQuery.preLoadImages("/images/spring-trainer/pitchback-pic3.jpg");  } else {    jQuery.preLoadImages("/images/spring-trainer/hitting-pic2.jpg");    jQuery.preLoadImages("/images/spring-trainer/hitting-pic3.jpg");    jQuery.preLoadImages("/images/spring-trainer/hitting-pic4.jpg");    jQuery.preLoadImages("/images/spring-trainer/hitting-pic5.jpg");    jQuery.preLoadImages("/images/spring-trainer/hitting-pic6.jpg");  }}function setVideoScrolls() {var vidWraps = $(".video-thumbs-wrap");var vidWrapWidth = 900;var vidWidth = 150;vidWraps.each( function() {var vidPanel = $(this).children();var vidThumbs = $(this).children().children();var totalVids = vidThumbs.length;var leftArrow = $(this).siblings(".video-arrow.back");var rightArrow = $(this).siblings(".video-arrow.forward");var currentPanel = 1;if ( totalVids > 6 ){$(rightArrow).show();vidPanel.width(totalVids * vidWidth);vidThumbs.css("display","inline-block");var vidPanelTotal = Math.ceil(vidPanel.width() / vidWrapWidth);rightArrow.click( function() {vidPanel.animate({left: "-="+vidWrapWidth}, 1000, 'easeOutExpo');leftArrow.show();currentPanel ++;if ( currentPanel == vidPanelTotal ){rightArrow.fadeOut();}});leftArrow.click( function() {vidPanel.animate({left: "+="+vidWrapWidth}, 1000, 'easeOutExpo');if (rightArrow.not(':visible')) {rightArrow.fadeIn();}currentPanel --;if ( currentPanel == 1 ){leftArrow.fadeOut();}});}});}at = '@';mailer = 'mailto:';function setHideMails() {  $('.hidemail').each(function () {    var user = $(this).attr("user");    var domain = $(this).attr("domain");    var tld = $(this).attr("tld");    var html = $(this).attr("html");     if (user && domain && tld) {      var emailLink = getmail(user, domain, tld, html);      $(this).html(emailLink);    }  });}function getmail(name, domain, suffix, text){   hiddenMail=(name + at + domain + '.' + suffix);if (! text){     text = hiddenMail;}  email = '<a href="' + mailer + hiddenMail + '" onClick="javascript:_gaq.push([\'_trackPageview\', \'/mailto/' + hiddenMail + '\']);"> [Email] </a>';return email;}var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-3400789-1']);_gaq.push(['_trackPageview']);(function () {  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();function trackIt(qstring, ignoredir) {  if (_gaq) {    if (ignoredir) {      if (qstring.length == 0) {        _gaq.push(['_trackPageview']);      }else{        _gaq.push(['_trackPageview', '/' + qstring]);      }    }else{      if (qstring.length == 0){                qs = location.search;        hash = location.hash;        path = location.pathname;        if (path.length < 2){          path = '';        }else{                    path = path.substring(1);        }                fullpath = path + qs + hash;        _gaq.push(['_trackPageview', '/' + fullpath]);      }else{        _gaq.push(['_trackPageview', '/' + qstring]);      }    }  }}function setLinkAnalytics() {    $("a:pdf, a:zip").live("click", function () {    var thisHref = $(this).attr('href');    var lp = location.pathname;    var lastSlash = location.pathname.lastIndexOf('/');    if (thisHref.substr(0, 1) != '/') {            thisHref = location.pathname.substr(1, lastSlash) + thisHref;    }    trackIt(thisHref, false);  });  $("a:external").live("click", function () {    trackIt('linkout/' + this.href.replace('http://', '').replace('https://', ''), true);  });  $("a:mailto").live("click", function () {    trackIt('mailto/' + this.href.replace('mailto:', ''), true);  });}
