<var C = GLOBAL.Def.Style.color>
$(document).ready(function() {
$('##tv_main').cycle({
fx: 'scrollHorz',
sync: true,
timeout: 0,
speed: 300,
prev: '.tv_prev_btn',
next: '.tv_next_btn',
before: beforeTvSlide,
after: afterTvSlide
});
// make sure "next" arrow is lit when any next action is taken
$('.tv_next_btn').click(function() {
$('.tv_next_btn').css('opacity','1');
setTimeout("$('.tv_next_btn').css('opacity','')", 350);
});
});
beforeTvSlide = function(outEl, inEl, options) {
$('##tv_head').html( $(inEl).children('.info_head:first').html() );
$('##tv_guide').html( $(inEl).children('.info:first').html() );
$('##tv_guide').find('.accordionContainer').each(function() {
jquery_simple_accordion(this);
});
// unload video
if ( $(outEl).children('.tv_video_player').length > 0) {
var _elId = $(outEl).children('.tv_video_player:first')[0].id;
var el = document.getElementById(_elId);
var player = $f(_elId);
// player.unload();
setTimeout(" $f('" + _elId + "').unload() ", 500);
}
// hide nav for a few seconds if this is an ad slide
if ( $(inEl).hasClass('ads') ) {
$('.tv_nav_btn').fadeOut(500);
setTimeout(" $('.tv_nav_btn').fadeIn(500) ", 3000);
}
else if ( $(inEl).children('.tv_video_player').length > 0 ) {
var _elId = $(inEl).children('.tv_video_player:first')[0].id;
var el = document.getElementById(_elId);
make_video_player(el);
}
}
afterTvSlide = function(outEl, inEl, options) {
// play video
if ( $(inEl).children('.tv_video_player').length > 0 ) {
var _elId = $(inEl).children('.tv_video_player:first')[0].id;
var el = document.getElementById(_elId);
var player = $f(_elId);
// player.play();
}
}