function show_video_tooltip() {
var vid_id = $(this).attr( 'mrvl_vid' );
var num = $(this).attr( 'mrvl_seq_num' );
var off = $(this).offset();
$('#video_tooltipm > img')
.attr( 'src', 'http://marvel.com' + videos_data[vid_id].image_url )
.attr( 'alt', videos_data[vid_id].title )
.attr( 'title', videos_data[vid_id].title ) ;
$('#video_tooltip_text').html( ''+videos_data[vid_id].title +'
'+ videos_data[vid_id].desc ) ;
var pos_l = ( num >= 11 )
? off.left - $('#video_tooltip').innerWidth() - 10
: off.left + this.clientWidth + 88 ;
// reset to default the left and right box sides
$('#tooltipL').attr('class','video_tooltipR2');
$('#tooltipR').attr('class','video_tooltipR');
// depending on num, display the box arrow
if (num >= 11 )
$('#tooltipR').attr('class','video_tooltipL2');
else
$('#tooltipL').attr('class','video_tooltipL');
var pos_t = off.top - $('#video_tooltip').innerHeight() / 2 ;
$('#video_tooltip').css( { left: pos_l, top: pos_t } ) ;
unhide( 'video_tooltip' );
}
// need a focal point to use for ajax box interactions
// using object to manage the updates of the episode description when ajax box changes content
function marvel_ajax_box() {
this.type_viewing = 'episode';
this.movietv_id = 0; // used for kids - for now
// function to update the episode descriptions
this.update_ep_desc = function() {
var mtv_id = $(this).attr( 'mrvl_mtv_id' );
var ep_id = $(this).attr( 'mrvl_ep_id' );
// swap the description
if ( mtv_id && ep_id ) {
var str = ''+ (episode_data[mtv_id][ep_id]).episode_title +' - '+ (episode_data[mtv_id][ep_id]).episode_description ;
$('#ep_description').html( str );
}
}
// main callback function
// what to do when the ajax box changes
this.onchange = function() {
marvel_ajax_box.update_ep_desc.call( $('.ajx-load-contents > .imageholder').eq(0) ) ;
}
// used to update the video list with ajaxanator
this.vidlist = function( el_id,tmpl,setsize,subset ) {
var kids_flag = ( tmpl.indexOf( 'kid' ) > -1 ),
mtv_id = (kids_flag ? ['m.movietv_id=' + this.movietv_id] : null) ;
var ml = marvel_loader.init( 'animated_episode/fetch_vidlist_for' );
ml.request = { params:[ this.type_viewing,mtv_id,kids_flag ], cparams: [ null, browser.isIE ],
setsize: setsize,
mode:'htm',
src: tmpl
};
document.getElementById(el_id).innerHTML = '
