
function addLoadEvent (func) {
  jQuery(document).ready(
    function() {
      func();
    }
  );
}

var currentNavId;

function navOn() {
  $('#' + currentNavId + ' a').css('text-shadow', '0 0 5px #FFFFFF')
  $('#' + currentNavId + ' a').css('text-shadow', '0 0 5px #FFFFFF')
  $('#' + currentNavId + ' a').textShadow();
}

jQuery(document).ready(
  function() {
    if (jQuery('ul.jcarousel-skin-ddb').length > 0) {
      jQuery('#content').css("float", "left");
      jQuery('#content').css("width", "540px");
      jQuery('#content h2').css("text-align", "center");
      jQuery('#content h2').css("font-size", "120%");
      jQuery('#content h2').css("margin-bottom", "10px");
      jQuery('ul.jcarousel-skin-ddb').jcarousel();
    }
  }
);

jQuery(document).ready(
  function() {
    for (g=1;g<=10;g++) {
      if (jQuery('#gallery' + g + ' a').length > 0) {
        jQuery('#gallery' + g + ' a').lightBox({fixedNavigation:true});
      }
    }
  }
);

jQuery(document).ready(
  function() {
    if ($("#content p.main_image img").length > 0){
      myHeight = $("#content p.main_image img").height();

      myHeight = myHeight - 55 + 7;

      $("#content p.main_image span").css("top", "-" + myHeight + "px");
    }
  }
);

var scrollPane;
var scrollPaneAPI;
var scrolling = 0;

function scrollY () {
  scrollPaneAPI.scrollByY(3);

  if (scrolling == 1) {
    var t = setTimeout("scrollY()", 30);
  }
}

jQuery(document).ready(
  function() {
    my_href = window.location.href;

    if ((!my_href.match(/gallery\.htm$/)) && (!my_href.match(/video\.htm$/)) && (!my_href.match(/video_new\.htm$/))) {
      scrollPane = $('#content')
        .bind(
          'jsp-initialised',
          function(event, isScrollable) {
            if (isScrollable) {
              $('#content').after('<div class="jspDown"><a href=""><img src="/images/down.png" border="0" /></a></div>');
            }
          }
        )
        .jScrollPane();

      scrollPaneAPI = scrollPane.data('jsp');

      $('.jspDown a').hover(
        function() {
          scrolling = 1;
          scrollY();
        },
        function() {
          scrolling = 0;
        }
      );
    } else {
      $('#content').css('height', 'auto');
      $('#content').css('overflow', 'visible');
    }
  }
);

jQuery(document).ready(
  function() {
    my_href = window.location.href;

    if (my_href == "http://www.cobraboxing.com/") {
      $('body').css("background-image", "url(/images/main/backgrounds/stone_bg.jpg)");
    }
  }
)

jQuery(window).load(
  function() {
    my_href = window.location.href;

    if (my_href == "http://www.cobraboxing.com/") {
      $('#main_container').before('<div id="flash_home_outer"><div id="flash_home"></div></div>\n');

      windowWidth = $(window).width();

      if (windowWidth < 1284) {
        myWidth = windowWidth - (windowWidth/2 - 508);

        if (myWidth < 960) {
          myWidth = 960;
        }

        $('#flash_home_outer').width(myWidth);
      }

      var flashvars = {};
      var params = { wmode:'transparent', allowFullScreen:'true' };
      var attributes = {};
      swfobject.embedSWF("swf/cobra_boxing.swf", "flash_home", "1150", "700", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
    }
  }
)


