﻿// JScript File
$(function() {
    loadContent('#contentDiv', './news.aspx');
    
    $( '#news' ).newsticker( 5000, "newsticker" );
    $( '#rss' ).newsticker( 10000, "rsssticker" );
    $( '#tv' ).newsticker( 10000, "rsssticker" );
});

function loadContent(elementSelector, sourceUrl) {
    $( elementSelector ).load( './' + sourceUrl );
}

function loadGallery() {
    $.ajax({
        type: "GET",
        url: "example.html",
        data: '{}',
        contentType: "application/json; charset=utf-8",
        dataType: "html",
        success: function(msg) {
            $( '#contentDiv' ).html( msg );
        },
        error: function(xhr, status, error) {
            var err = JSON.parse(xhr.responseText);
            alert(err.Message);
        }
    });
}

function loadLeagueTable() {
    $.ajax({
        type: "POST",
        url: "LeagueTable.aspx",
        data: '{}',
        contentType: "application/json; charset=utf-8",
        dataType: "html",
        success: function(msg) {
            $('#contentDiv').html( msg );
            $('#leagueTable tr').mouseover(function() { $(this).addClass('over'); }).mouseout(function() { $(this).removeClass('over'); });
            $("#leagueTable").tablesorter();
        },
        error: function(xhr, status, error) {
            var err = JSON.parse(xhr.responseText);
            alert(err.Message);
        }
    });
}

