var curtab = -1; var navon = false; var navov = false; var navextov = false; $(document).ready(function () { if(navigator.userAgent && navigator.userAgent.indexOf('iPad') != -1){ _isipad = true; } _promourl = window.location.href; if(_promourl.indexOf('/wgbh/pages/frontline/') != -1){ var workstring = _promourl.substring(_promourl.indexOf('/wgbh/pages/frontline/') + 22, _promourl.length); var ws = workstring.split("/"); _promourl = 'http://www.pbs.org/wgbh/pages/frontline/' + ws[0]; } $('li#_pgelatest').click(function() { $('div._pgmostouter').hide(); $('div._pglatestouter').fadeIn('fast'); $(this).removeClass('_pgactive'); $('li#_pgemost').addClass('_pgactive'); }); $('li#_pgemost').click(function() { $('div._pglatestouter').hide(); $('div._pgmostouter').fadeIn('fast'); $(this).removeClass('_pgactive'); $('li#_pgelatest').addClass('_pgactive'); }); }); function nav_in () { navon = true; $("#_next").stop(); $("#_next").css({ 'opacity':1 }); $("#_next").fadeIn(); $("#_next").mouseenter(function () { navextov = true; }); $("#_t"+curtab).removeClass('non').addClass('non'); $("#_next").mouseleave(function () { navextov = false; nav_out_decide(); }); $("#extscl").click(function () { navov = false; navextov = false; nav_out(); }); } function nav_tab (idx){ curtab = idx; $(".tab").hide(); $("#tab"+idx).show(); } function nav_out_decide () { ival = setTimeout("nav_out()",800); } function nav_out () { if(!navov && !navextov){ $("#extscl").unbind('click'); $("#_next").unbind('mouseenter'); $("#_next").unbind('mouseleave'); $("#_next").stop(); $("#_next").fadeOut(); $(".non").removeClass('non'); navon = false; } } var pp_playercnt = 0; var loaders = new Array(); function partnerplayer (inarray) { this.server = Object.beget(flp_comm); this.video = Object.beget(flp_video); this.w = (inarray.w != undefined)? inarray.w:512; this.h = (inarray.h != undefined)? inarray.h:288; this.autoplay = (inarray.autoplay != undefined)? inarray.autoplay:false; this.targetdiv = inarray.targetdiv; this.playercount = pp_playercnt; this.partnerplayer_loader = pp_loader; if(navigator.userAgent && (navigator.userAgent.indexOf('iPad') != -1 || navigator.userAgent.indexOf('iPhone') != -1) && inarray.npaid != undefined){ this.video.parse_video_id(inarray.npaid).get_data_from_server(this.server); loaders[this.playercount] = setInterval(this.partnerplayer_loader,500,this.video,this.targetdiv,this.playercount,this.autoplay); } else { var chapterbar = (inarray.chapterbar != undefined)? inarray.chapterbar:false; document.getElementById(this.targetdiv).innerHTML = ''; } pp_playercnt++; } function pp_loader (v,td,pc,ap) { if(v.loaded){ clearInterval(loaders[pc]); var output = ''; document.getElementById(td).innerHTML = output; } } function doccloud (target,wid,yesno){ if(yesno == undefined){ yesno = true; } DV.load('http://www.documentcloud.org/documents/' + target + '.js', { width: wid, height: $(window).height() - 120, container: "#viewer-" + target, sidebar: yesno }); } function hasstarted () { }