$(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");
         });
  
    $(".right-vid").append("<div id ='first-vid'></div>");
  $.getJSON("http://gdata.youtube.com/feeds/api/users/footballfedvic/uploads?max-results=1&orderby=published&q=soccer&v=2&alt=jsonc&callback=?", function(data) {
    var dataContainer = $("#first-vid");
    $.each(data.data.items, function(i, val) {
      if (typeof(val.player) !== 'undefined' && typeof(val.title) !== 'undefined') {
        dataContainer.append("<iframe width='322' height='180' src='http://www.youtube.com/embed/"+val.id+"?rel=0&autohide=1' frameborder='0' name='vid-frame' allowfullscreen></iframe>");
      }
    });
  });
  
});

$(function () {
            var tabContainers = $('div.statstabs > div');
                        
            $('div.statstabs ul.statstabNavigation a').click(function () {
                tabContainers.hide().filter(this.hash).show();
                    $('div.statstabs ul.statstabNavigation a').removeClass('selected');
                $(this).addClass('selected');
                       return false;
            }).filter(':first').click();
});

$(function(){
    $('#news-fading-image').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 5000,
        prev:   '#prev',
        next:   '#next',
        cleartype: 1,
        pager:  '#news-fading-list',
      pauseOnPagerHover: 1,
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#news-fading-list li:eq(' + (idx) + ') a';
        },
        pagerEvent: 'mouseover'
    });
});

function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}

function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}
