var chaps = new Array(); var currentchapter = 1; var infoon = false; var embedon = false; var firstchapter = 'frol02s47afq104a'; function chd (chdar){ chaps.length = 0; var outp = ''; $("#vidchapters").html(outp); videvts(); } function vidinfo (chidx, top){ $("#vidinfo").stop(); $("#vidinfobg").stop(); $("#vidinfo").css({ 'opacity':1, 'margin-top':top + 'px' }); $("#vidinfobg").css({ 'opacity':.9, 'margin-top':top + 'px' }); var vidinf = chaps[chidx]; $("#vidinfo").html('' + vidinf.pki + ': ' + vidinf.tit + ' ' + vidinf.dsc + ' (' + vidtime(vidinf.len) + ')'); $("#vidinfobg").fadeIn('fast'); $("#vidinfo").fadeIn('fast'); infoon = true; } function videvts () { $(".vidunsel").mouseenter(function () { $(this).stop(); $(this).animate({'height': '90px', 'opacity':1}, function () { var pos = $(this).position(); vidinfo($(this).attr('vidc'), pos.top); }); }); $(".vidunsel").mouseleave(function () { $(this).stop(); vidinfo_off(); $(this).animate({'height': '25px', 'opacity':.7}); }); $(".vidunsel").click(function () { v_chapter(parseInt($(this).attr('vidc')) - 1); }); } function vidtime (timein){ var ret = parseInt(parseInt(timein) / 60); var sec = parseInt(parseInt(timein) % 60); if(sec < 10){ ret += ":0" + sec; } else { ret += ":" + sec; } return ret; } function videoembedcode (siz) { if(siz == -1){ if(embedon){ embedon = false; $("#embedcode").fadeOut(); } else { embedon = true; $("#embedcode").fadeIn(); } } if(embedon){ var h = 333; var w = 512; if(siz == 1){ h = 250; w = 384; } if(siz == 2){ h = 208; w = 320; } var fval = '

Watch the full episode. See more FRONTLINE.

'; $("#emc").val(fval); $(".erad").unbind('click'); $(".erad").click(function () { videoembedcode($(this).val()); }); } } function vidinfo_off () { infoon = false; $("#vidinfo").stop(); $("#vidinfobg").stop(); $("#vidinfo").fadeOut('fast'); $("#vidinfobg").fadeOut('fast'); } function chu (chidx){ $(".vidunsel").unbind('mouseenter'); $(".vidunsel").unbind('mouseleave'); $(".vidunsel").unbind('click'); $(".vidsel").unbind('click'); if(infoon){ vidinfo_off() } currentchapter = (chidx + 1); $(".vidsel").removeClass('vidsel').addClass('vidunsel'); $("#vchap"+currentchapter).stop(); $("#vchap"+currentchapter).removeClass('vidunsel').addClass('vidsel'); $(".vidunsel").animate({ 'height':'25px', 'opacity':.7 }); $("#vchap"+currentchapter).css({ 'opacity': 1, 'height': '50px' }); videvts(); } function starts () { $("#mainouter").css({ 'height':'440px' }); }