var y = 2025;
var selectedTab = "";
$(document).ready(function () {
$(".tipHandler").each(function () {
$(this).uitooltip({
items: ".tipHandler",
content: tip_strings[$(this).data('string')],
position: {
my: 'left bottom',
at: 'left top'
}
});
}).uitooltip("disable");
var tip_count = 0;
$('#tip_info').click(function () {
$(".tipHandler").uitooltip("open");
var tmp_tip = ++tip_count;
//auto-close after a few seconds
setTimeout(function () {
if (tmp_tip == tip_count)
$(".tipHandler").uitooltip("close");
}
, 10500);
});
});
function selYear(yr) {
y = yr;
selectedTab.parentNode.className="";
//$('#tab0').removeClass('current');
selTab(selectedTab);
}
function selTab(me) {
//console.log(me);
selectedTab = me;
if (me.parentNode.className=="current") return;
for (i=0; i < me.parentNode.parentNode.childNodes.length; i++) {
if (!me.parentNode.parentNode.childNodes[i].id) continue;
me.parentNode.parentNode.childNodes[i].style.backgroundColor = "rgb(35, 31, 32)";
var id = (me.parentNode.parentNode.childNodes[i].id);
$('#'+id+ ' a span').css('color', '#999');
$('.cont').hide();
}
me.parentNode.style.backgroundColor = "rgb(232, 102, 44)";
var id= me.parentNode.id;
$('#'+id+ ' a span').css('color', 'rgb(255, 255, 255)');
document.getElementById(me.parentNode.id+"Content" + y).style.display="block";
}
function selTab2 (mnth) {
var formToSubmit = $('#forsub');
$('#month_field').val(mnth);
$('#year_field').val($('#searchYear').val());
formToSubmit.submit();
}
function game_search() {
var formToSubmit = $('#forsub');
//$('#year_field').val($('#searchYear').val());
formToSubmit.submit();
}
function assign_event(up_id, events_id) {
var href = '/main/main.php?module=startlistMaintenance&action=addGame&ugames_id='+up_id+'&id='+events_id;
window.location.href = href;
}
function toonBuffer() {
}
function toggleHide (up_id) {
$.post('/main/overviews/startlists/toggle.php', {'upcomingGames_id': up_id}, function(feedback) {
alert ('done');
window.location.reload();
});
}
function updateSchedule() {
var id = 0;
var slug = '';
if (typeof teamNames != 'undefined'){
for (var i in teamNames) if (teamNames[i] == document.getElementById('tb').value) {
id = teamIds[i];
slug = teamSlugs[i];
}
window.location.href='/main/startlists/sportsman/'+ id + '/' + slug;
}
}
function filterYear (y) {
if (y ==0)
$('.resgame').show();
else {
$('.resgame').hide();
$('.resgame' + y ).show();
}
}
function menuToggle (id) {
$('#sub-navMain-'+id).slideToggle(null, null, function() {
if ( !$('#sub-navMain-'+id).is(":hidden") ) {
$('#navMain-'+id).css('background','#e8662c');
$('#navMain-'+id+' > a').css('color','#fff');
$('#navMain-'+id+' > a > span').css('color','#fff');
} else {
$('#navMain-'+id).css('background','#231f20');
$('#navMain-'+id+' > a').css('color','#999');
$('#navMain-'+id+' > a > span').css('color','#999');
}
});
}