var curtab = -1; var _gcurtab = -1; var navon = false; var navov = false; var navextov = false; var ival = new Number(); var ison = false; var pp_playercnt = 0; var loaders = new Array(); var awesomepowa = false; var cat_has = new Array(); var videotab_notyet = true; var _isipad = false; var _isiphone = false; var newsletter_enable = true; var newsletter_up = false; var _localgaq = []; var newsletter_items = new Array('Find out what\'s happening first. Connect with FRONTLINE for exclusive news, updates, and information.','Connect with FRONTLINE. Join our email list for exclusive insider access, film previews, and program reminders.'); var newsletter_choice = new String(); $(document).ready(function () { try { _localgaq = _gaq || []; _localgaq.push(['_setAccount', 'UA-3988874-2']); } catch (e){} $("#gsb3").click(function () { evtlogger('sidebar','a',$(this).attr('href')); }); $("#gsb2").click(function () { evtlogger('sidebar','b',$(this).attr('href')); }); $("#gsb1").click(function () { evtlogger('sidebar','c',$(this).attr('href')); }); if(navigator.userAgent){ if(navigator.userAgent.indexOf('iPad') != -1){ _isipad = true; } if(navigator.userAgent.indexOf('iPhone') != -1){ _isiphone = true; } } $("#_gnav").find("a").each(function () { $(this).mouseenter(function () { $(".non").removeClass('non'); $(this).addClass('non'); nav_tab($(this).attr('tab')); if(!navon){ nav_in_decide(); ison = true; } }); }); $("#_gnav").mouseenter(function () { navov = true; }); $("#_gnav").mouseleave(function () { navov = false; ison = false; nav_out_decide(); }); if(newsletter_enable && !_isiphone && !_isipad){ if(!(cookie_get('frontline_newsletter') == 1)){ setTimeout("newsletter_decider()",2000); } } }); function email_verify (email) { var ret = false; var val = $("#"+email).val(); if(val.length > 4 && val != 'Enter e-mail address' && val.indexOf('@') != -1 && val.indexOf('.') != -1){ ret = true; } else { alert('Please double-check your e-mail address - it should look like "frontline@pbs.org"'); } var google_conversion_id = 1071718161; var google_conversion_language = "en"; var google_conversion_format = "2"; var google_conversion_color = "ffffff"; var google_conversion_label = "Y5waCIO4tgIQkb6E_wM"; var google_conversion_value = 0; return ret; } function evtlogger (eventname,attrib,target){ if(target){ _localgaq.push(['_trackEvent', eventname, attrib, target]); } else { _localgaq.push(['_trackEvent', eventname, attrib]); } } function nav_in () { if(navov){ navon = true; $("#_gnext").stop(); $("#_gnext").css({ 'opacity':1 }); $("#_gnext").fadeIn(); $("#_gnext").mouseenter(function () { navextov = true; }); $("#t"+_gcurtab).removeClass('non').addClass('non'); $("#_gnext").mouseleave(function () { navextov = false; nav_out_decide(); }); $("#extscl").click(function () { navov = false; navextov = false; nav_out(); }); } } function nav_in_decide () { oval = setTimeout("nav_in()",400); } function nav_tab (idx){ _gcurtab = idx; $(".tab").hide(); $("#_gtab"+idx).show(); } function nav_out_decide () { ival = setTimeout("nav_out()",400); } function nav_out () { if(!navov && !navextov){ $("#extscl").unbind('click'); $("#_gnext").unbind('mouseenter'); $("#_gnext").unbind('mouseleave'); $("#_gnext").stop(); $("#_gnext").fadeOut(); $(".non").removeClass('non'); navon = false; } } function partnerplayer (inarray) { this.pserver = Object.beget(flp_comm); this.pvideo = Object.beget(flp_video); this.pw = (inarray.w != undefined)? inarray.w:512; this.ph = (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; var chapterbar = (inarray.chapterbar != undefined)? inarray.chapterbar:false; var output = '' document.getElementById(this.targetdiv).innerHTML = output; pp_playercnt++; } function pp_loader (v,td,pc,ap) { if(v.loaded){ clearInterval(loaders[pc]); var output = ''; document.getElementById(td).innerHTML = output; } } function morevideo_toggle () { if(awesomepowa){ $("#morevideo").hide(); $("#morevideo_tag").html('+ MORE PROGRAMS'); awesomepowa = false; } else { $("#morevideo").show(); $("#morevideo_tag").html('- LESS PROGRAMS'); awesomepowa = true; } } function cat_tabcheck() { if(cat_has.length > 2){ $("#cat_selecta").remove(); } } function videotab (targetvideo){ var thistab = $('div.videotab[dtab="'+targetvideo+'"]:first'); var finalvideo = thistab.attr('vid'); if(currentvideo != finalvideo){ currentvideo = finalvideo; if(videotab_notyet){ v_fp({ 'videoid': finalvideo, 'related':true, 'autoplay':true, 'mode': 2, 'w': 666, 'h': 375, 'divtarget': 'videoembed' }); videotab_notyet = false; $("#videoselecta").animate({'height':34},300); $("div.videotab").each(function (){ $(this).html(''); if($(this).hasClass('videotablarge_disabled')){ $(this).html($(this).attr('vtitle')) } else { $(this).html('' + $(this).attr('vtitle')) } $(this).css({'height':30}); }); $("#videoembed").show(); $(".videotablarge_off").removeClass("videotablarge_off").addClass("videotab_off"); $(".videotablarge_on").removeClass("videotablarge_on").addClass("videotab_on"); $(".videotablarge_disabled").removeClass("videotablarge_disabled").addClass("videotab_disabled"); } else { v_embplay(finalvideo); } $('.videotab_on').removeClass('videotab_on').addClass('videotab_off'); $(thistab).removeClass('videotab_off').addClass('videotab_on'); } window.location.hash = "#" + targetvideo; } function hasstarted () { } function newsletter_resp(){ var go = true; $("#frontline_newsletter_sub_send").attr("disabled","disabled"); if($("#frontline_newsletter_sub_e").val() == ""){ alert("Please check your email address"); go = false; } if(go){ cookie_set('frontline_newsletter',1,999); _localgaq.push(['_trackEvent', 'Newsletter lightbox', 'Subscribed', newsletter_choice]); $("#frontline_newsletter_sub_send").attr("disabled","disabled"); $("#frontline_newsletter_sub_send").animate({ 'opacity' : .6 }); $.ajax({ type: 'POST', url: '/wgbh/frontline/eloquabridge.php', data: 'e='+$("#frontline_newsletter_sub_e").val(), success: function () { $("#frontline_newsletter_sub_bar").html('Thank you for subscribing'); setTimeout("newsletter_closer()",3000); }, error: function (obj, txt){ console.log(txt); } }); } else { _localgaq.push(['_trackEvent', 'Newsletter lightbox', 'Botched Subscribe', newsletter_choice]); } return false; } function newsletter_decider () { var go = true; var x = Math.random() * 40; newsletter_choice = (x > 19)? newsletter_items[0]:newsletter_items[1]; var finalstr = ''; finalstr += '