$(document).ready(function() {

  // Add pdf icons to pdf links
  $("a[href$='.pdf']").addClass("pdf");
 
  // Add txt icons to document links (doc)
  $("a[href$='.doc'], a[href$='.docx']").addClass("doc");
  
  $("a[href$='.txt'], a[href$='.rft']").addClass("txt");
 
  // Add zip icons to Zip file links (zip, rar)
  $("a[href$='.zip'], a[href$='.rar']").addClass("zip"); 
 
  // Add email icons to email links
  $("a[href$='.xls'], a[href$='.xlsx']").addClass("excel");

  $("#news-fading-image").hover(function() {
     $(".next").animate({opacity: "show"}, "fast");
   }, function() {
     $(".next").animate({opacity: "hide"});
   });
  
  $(".next").hide();
  
  $(".prev").hide();
  
  $("#news-fading-image").hover(function() {
        $(".prev").animate({opacity: "show"}, "fast");
    }, function() {
      $(".prev").animate({opacity: "hide"});
   });

        $("a.next-btn").hover(function() {
          $(".next").animate({opacity: "show"}, "fast");
       });

        $("a.prev-btn").hover(function() {
          $(".prev").animate({opacity: "show"}, "fast");
       });
});

$(function(){
    $('#news-fading-image').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 5000,
      prev:   '#prev',
        next:   '#next',
        cleartype: 1,
        pager:  '#news-fading-list',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#news-fading-list li:eq(' + (idx) + ') a';
        },
        pagerEvent: 'mouseover'
    });
});

$(document).ready(
        function(){
          $('.sponsrotate').cycle({
            fx:    'fade',
            random: true,
            speed:  2000     
          });
          $('#ladders').cycle({
            fx:    'fade',
            random: true,
            speed:  2000     
          });                         
      });
function submitForm() {
  window.open ("https://reg.sportingpulse.com/v5/locator/locator.cgi?r=2", "NewWindow","menubar=0,location=no,resizable=1,scrollbars=1,width=650,height=400");
  document.search_postcode.submit();
}

$(document).ready(function(){
$("#news-wrap").each(function(){
      $(this).removeClass("loadingcycle");
});
$(".loadingbox").each(function(){
      $(this).removeClass("loadingimage");
});
});

$(window).load(function(){autoScroller('vmarquee', 2)});

