//
//    
//   Bridged version of action.js for stadiums.football.co.uk
//
//

$(document).ready(function() {
  /* ----------------------------------------------------------------- Scrollers / News Ticker */
    $('ul#footballTickerOne').cycle({
			fx:			'scrollDown',
			delay:		-10000,
			speed:		600,
			pause:      1, 
			cleartype:  1 // enable cleartype corrections 
		});
	$('ul#resultsTicker').cycle({ 
		fx:      	'scrollUp', 
		speed:    	600, 
		timeout:	1,
		pause:      1,
		cleartype:  1 // enable cleartype corrections  
	});

  /* ----------------------------------------------------------------- Main Navigation Menu*/
  $('#nM ul ul li a').bgiframe({ width: '148px' });
  
  /* ----------------------------------------------------------------- External Links */
  $('A[rel="external"]').click(function() {
    window.open($(this).attr('href'));
    return false;
  });
  
  /* ----------------------------------------------------------------- No Follow Links */
  /* generic */
  $("a[@rel='nofollow'][href=' ']").click(function() {
    var href = $(this).attr("title");
    $(this).attr({
      href: href
    });
  });
  /* ----------------------------------------------------------------- Light Box */
  /* media tabbed content */
  $('#gallery a, #stadiumThumbs a').lightBox({
    imageLoading: '/Images/Static/LightBox/lightbox-ico-loading.gif',
    imageBtnClose: '/Images/Static/LightBox/lightbox-btn-close.gif',
    imageBtnPrev: '/Images/Static/LightBox/lightbox-btn-prev.gif',
    imageBtnNext: '/Images/Static/LightBox/lightbox-btn-next.gif'
  },
        { fixedNavigation: true });
  /* enlarge image in new article */
  $('#newsArticleLinks dl dt a.pic, #newsArticleLinks dl dd a.pic').lightBox({
    imageLoading: '/Images/Static/LightBox/lightbox-ico-loading.gif',
    imageBtnClose: '/Images/Static/LightBox/lightbox-btn-close.gif'
  });
  
    $('#newsArticleLinks dl dt a.link, #newsArticleLinks dl dd a.link').lightBox({
    imageLoading: '/Images/Static/LightBox/lightbox-ico-loading.gif',
    imageBtnClose: '/Images/Static/LightBox/lightbox-btn-close.gif'
  });
  /* ----------------------------------------------------------------- Hide/Show USE of image terms - news article */
  $("#newsArticleLinks ul.embed li.imgTerms").hide();
  $("#newsArticleLinks ul.embed small.imgTermsLink").click(function() {
    $("#newsArticleLinks ul.embed li.imgTerms").toggle("fast");
  });
});

