function changeLeague()
{
   leagueForm=document.getElementById('toggleLeagueForm');
   if (leagueForm)
   {
      leagueForm.submit();
   }
}


$(function()
{

   if ($('#blockPromotion').is(':visible') )
   {
      $('body').css({height:'100%', overflow:'hidden'});
      var redirectLink=$('#blockPromotion>div>span>a').attr('href');
      $('#topFlash').html('');
      $('#topFlash').text('');

      setTimeout( function() {window.location=redirectLink} , 4000);
   }

   var ilosc=$("div.newsItem>div.newsContent").length;
   var iloscArticle=$("div.newsItem.article>div.newsContent").length;

   if(ilosc>0)
   {//main page create extra links
      var newUlr;

      $("div.newsItem>div.newsContent").each(function()
      {
	 var parentNode=$(this);

	 newUrl=$(this).find('.newsLink').attr('href');
	 $(this).find('img').wrap('<a style="float:left" href="'+newUrl+'"></a>');
      });
   }
   
   if(iloscArticle>0)
   {//article list create extra links
      var newUrl;
      var newText;

      $("div.newsItem.article>div.newsContent").each(function()
      {
	 var parentNode=$(this);

	 newUrl=$(this).parent('.newsItem').find('.newsTitle>a').attr('href');
	 newHtml=$(this).children('p').html();
	 $(this).children('p').html('').html('<a style="float:left" href="'+newUrl+'">'+newHtml+'</a>');
      });
   }
});

$(function()
{
   $('div.uitabs').tabs();

   $(".roundInfo.scroll").next('table.games').hide();
   $(".roundInfo.scroll a").click(function(event)
   {
      event.preventDefault();
      $(this).parent().next('table.games').toggle();
      if ($(this).text()=='-') $(this).text('+');
      else  $(this).text('-');
   });
   
   Cufon.replace('div.specialBanner a',  {
	color: '-linear-gradient(#b9b9b9, black)',
	textShadow: '1px 1px 7px black'
   }); // Works without a selector engine
   
//    $("div.specialBanner a").FontEffect(
//    {
//       shadow:true,
//     shadowColor:"blue",
//     shadowOffsetTop:1,
//     shadowOffsetLeft:2,
//     shadowOpacity:0.2,
//     shadowBlur      :2,
//   outline         :true, // Apply the outline effect
//     outlineColor1   :"white",    // [find contrasting] The upper left  outline color
//     outlineColor2   :"",    // [outlineColor1] the lower right outline color
//     outlineWeight   :1,     // 1=light,2=normal,3=bold
// 
//    });
});


