$=jQuery;(function(f){var c={pause:function(h){h.data("paused",true)},resume:function(h){h.data("paused",false)}};f.fn.jCarouselLite=function(h){if(typeof h=="object"){h=f.extend({btnPrev:null,btnNext:null,btnGo:null,btnGoSelectClass:"selected",hoverE:null,mouseWheel:false,auto:null,autoTimer:false,enableTitles:false,titleE:null,titleClass:null,enableParagraphs:false,paragraphsE:null,paragraphClass:null,carouselE:"ul",carouselNavE:"ul.nav",speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},h||{})}return this.each(function(){var x=f(this);x.data("paused",false);if(typeof h=="string"){if(h in c){c[h].call(this,x);return}}var n=false,k=h.vertical?"top":"left",l=h.vertical?"height":"width";var u=f(h.carouselE),A=f("li",u),o=A.size(),r=h.visible;if(h.circular){u.prepend(A.slice(o-r-1+1).clone()).append(A.slice(0,r).clone());h.start+=r}var t=f("li",u),q=t.size(),B=h.start;x.css("visibility","visible");var D=h.vertical?a(t):e(t);var C=D*q;var w=D*r-1;t.css({overflow:"hidden","float":h.vertical?"none":"left"});u.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});x.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});t.css({width:t.width(),height:t.height()});u.css(l,C+"px").css(k,-(B*D));x.css(l,w+"px");if(h.enableTitles){var s=f(h.titleClass)}if(h.enableParagraphs){var j=f(h.paragraphClass)}if(h.enableTitles||h.enableParagraphs){var p=false}if(h.hoverE){f(h.hoverE).hover(function(){clearInterval(h.carouselInterval)},function(){if(h.autoTimer){h.carouselInterval=setInterval(function(){z(B+h.scroll)},h.auto+h.speed)}})}if(h.btnPrev){f(h.btnPrev).click(function(){return z(B-h.scroll)})}if(h.btnNext){f(h.btnNext).click(function(){return z(B+h.scroll)})}if(h.btnGo){f.each(h.btnGo,function(v,E){f(E).click(function(){return z(h.circular?h.visible+v:v)})})}if(h.mouseWheel&&x.mousewheel){x.mousewheel(function(v,E){return E>0?z(B-h.scroll):z(B+h.scroll)})}if(h.auto){h.carouselInterval=setInterval(function(){z(B+h.scroll)},h.auto+h.speed)}function y(){return t.slice(B).slice(0,r)}function z(v){if(x.data("paused")){return false}if(!n){if(h.beforeStart){h.beforeStart.call(this,y())}if(h.circular){if(v<=h.start-r-1){u.css(k,-((q-(r*2))*D)+"px");B=v==h.start-r-1?q-(r*2)-1:q-(r*2)-h.scroll;if(h.enableTitles){f(h.titleE).fadeOut(h.speed/2,function(){f(this).html(f(s[B]).html()).fadeIn(h.speed/2,function(){h.titleEHeight=f(this).height()})})}if(h.enableParagraphs){f(h.paragraphsE).fadeOut(h.speed/2,function(){f(this).html(f(j[B]).html()).fadeIn(h.speed/2,function(){h.paragraphEHeight=f(this).height()})})}if(h.btnGo!=null){f(h.btnGo[B-1]).addClass(h.btnGoSelectClass);removeUnderlay(f(h.btnGo[B-1]));p=false}}else{if(v>=q-r+1){u.css(k,-((r)*D)+"px");B=v==q-r+1?r+1:r+h.scroll;if(h.enableTitles){f(h.titleE).fadeOut(h.speed/2,function(){f(this).html(f(s[B]).html()).fadeIn(h.speed/2,function(){h.titleEHeight=f(this).height()})})}if(h.enableParagraphs){f(h.paragraphsE).fadeOut(h.speed/2,function(){f(this).html(f(j[B]).html()).fadeIn(h.speed/2,function(){h.paragraphEHeight=f(this).height()})})}if(h.btnGo!=null){f(h.btnGo[B-1]).addClass(h.btnGoSelectClass);removeUnderlay(f(h.btnGo[B-1]));p=false}}else{B=v;if(h.enableTitles){f(h.titleE).fadeOut(h.speed/2,function(){f(this).html(f(s[B]).html()).fadeIn(h.speed/2,function(){h.titleEHeight=f(this).height()})})}if(h.enableParagraphs){f(h.paragraphsE).fadeOut(h.speed/2,function(){f(this).html(f(j[B]).html()).fadeIn(h.speed/2,function(){h.paragraphEHeight=f(this).height();g(h)})})}if(h.btnGo!=null){if(B==0){removeUnderlay(f(h.btnGo[q-3]));f(h.btnGo[q-3]).addClass(h.btnGoSelectClass);f(h.btnGo[0]).removeClass(h.btnGoSelectClass);createUnderlay(f(h.btnGo[0]));p=false}else{if(B+1==q){removeUnderlay(f(h.btnGo[0]));f(h.btnGo[0]).addClass(h.btnGoSelectClass);f(h.btnGo[q-3]).removeClass(h.btnGoSelectClass);createUnderlay(f(h.btnGo[q-3]));p=true}else{f(f(h.btnGo[B-1])).addClass(h.btnGoSelectClass);removeUnderlay(f(h.btnGo[B-1]));p=false}}}}}}else{if(v<0||v>q-r){return false}else{B=v}}n=true;u.animate(k=="left"?{left:-(B*D)}:{top:-(B*D)},h.speed,h.easing,function(){if(h.afterEnd){h.afterEnd.call(this,y())}n=false});if(!h.circular){f(h.btnPrev+","+h.btnNext).removeClass("disabled");f((B-h.scroll<0&&h.btnPrev)||(B+h.scroll>q-r&&h.btnNext)||[]).addClass("disabled")}if(h.btnGo!=null){f.each(h.btnGo,function(E,F){if(E+1!=B&&B!=0&&!p){f(F).removeClass(h.btnGoSelectClass);createUnderlay(f(F))}})}}return false}})};function g(h){if(h.enableParagraphs&&h.enableTitles){f(h.carouselNavE).children("div.wrap").children("div.underlay-active").css({height:h.titleEHeight+h.paragraphEHeight+12})}}function d(h,j){return parseInt(f.css(h[0],j))||0}function e(h){return f(h[0]).outerWidth()+d(h,"marginLeft")+d(h,"marginRight")}function a(h){return f(h[0]).outerHeight()+d(h,"marginTop")+d(h,"marginBottom")}})(jQuery);(function(a){a.fn.hoverIntent=function(n,l){var o={sensitivity:7,interval:100,timeout:0};o=a.extend(o,l?{over:n,out:l}:n);var q,p,j,e;var h=function(f){q=f.pageX;p=f.pageY};var d=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(j-q)+Math.abs(e-p))<o.sensitivity){a(f).unbind("mousemove",h);f.hoverIntent_s=1;return o.over.apply(f,[g])}else{j=q;e=p;f.hoverIntent_t=setTimeout(function(){d(g,f)},o.interval);return null}};var k=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return o.out.apply(f,[g])};var c=function(t){var s=(t.type=="mouseover"?t.fromElement:t.toElement)||t.relatedTarget;while(s&&s!=this){try{s=s.parentNode}catch(g){s=this}}if(s==this){return false}var r=jQuery.extend({},t);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(t.type=="mouseover"){j=r.pageX;e=r.pageY;a(f).bind("mousemove",h);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){d(r,f)},o.interval)}}else{a(f).unbind("mousemove",h);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){k(r,f)},o.timeout)}}return false};return this.mouseover(c).mouseout(c)}})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f===0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f===0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,n,l){var j=1.70158;var k=0;var g=n;if(h==0){return e}if((h/=l)==1){return e+n}if(!k){k=l*0.3}if(g<Math.abs(n)){g=n;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(n/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k))+e},easeOutElastic:function(f,h,e,n,l){var j=1.70158;var k=0;var g=n;if(h===0){return e}if((h/=l)==1){return e+n}if(!k){k=l*0.3}if(g<Math.abs(n)){g=n;j=k/4}else{j=k/(2*Math.PI)*Math.asin(n/g)}return g*Math.pow(2,-10*h)*Math.sin((h*l-j)*(2*Math.PI)/k)+n+e},easeInOutElastic:function(f,h,e,n,l){var j=1.70158;var k=0;var g=n;if(h==0){return e}if((h/=l/2)==2){return e+n}if(!k){k=l*(0.3*1.5)}if(g<Math.abs(n)){g=n;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(n/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*l-j)*(2*Math.PI)/k)*0.5+n+e},easeInBack:function(e,f,a,j,h,g){if(g==undefined){g=1.70158}return j*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,j,h,g){if(g==undefined){g=1.70158}return j*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,j,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return j/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return j/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});$.extend({URLEncode:function(l){var k="";var e=0;l=l.toString();var g=/(^[a-zA-Z0-9_.]*)/;while(e<l.length){var a=g.exec(l.substr(e));if(a!=null&&a.length>1&&a[1]!=""){k+=a[1];e+=a[1].length}else{if(l[e]==" "){k+="+"}else{var j=l.charCodeAt(e);var f=j.toString(16);k+="%"+(f.length<2?"0":"")+f.toUpperCase()}e++}}return k},URLDecode:function(d){var f=d;var a,c;var e=/(%[^%]{2})/;while((m=e.exec(f))!=null&&m.length>1&&m[1]!=""){b=parseInt(m[1].substr(1),16);c=String.fromCharCode(b);f=f.replace(m[1],c)}return f}});
/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.3
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */
(function(a){a.extend(a.fn,{livequery:function(g,f,e){var d=this,h;if(a.isFunction(g)){e=f,f=g,g=undefined}a.each(a.livequery.queries,function(j,k){if(d.selector==k.selector&&d.context==k.context&&g==k.type&&(!f||f.$lqguid==k.fn.$lqguid)&&(!e||e.$lqguid==k.fn2.$lqguid)){return(h=k)&&false}return true});h=h||new a.livequery(this.selector,this.context,g,f,e);h.stopped=false;h.run();return this},expire:function(g,f,e){var d=this;if(a.isFunction(g)){e=f,f=g,g=undefined}a.each(a.livequery.queries,function(h,j){if(d.selector==j.selector&&d.context==j.context&&(!g||g==j.type)&&(!f||f.$lqguid==j.fn.$lqguid)&&(!e||e.$lqguid==j.fn2.$lqguid)&&!this.stopped){a.livequery.stop(j.id)}});return this}});a.livequery=function(d,f,h,g,e){this.selector=d;this.context=f||document;this.type=h;this.fn=g;this.fn2=e;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;g.$lqguid=g.$lqguid||a.livequery.guid++;if(e){e.$lqguid=e.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var d=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(e,f){d.fn2.apply(f)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var f=this;var g=this.elements,e=a(this.selector,this.context),d=e.not(g);this.elements=e;if(this.type){d.bind(this.type,this.fn);if(g.length>0){a.each(g,function(h,j){if(a.inArray(j,e)<0){a.event.remove(j,f.type,f.fn)}})}}else{d.each(function(){f.fn.apply(this)});if(this.fn2&&g.length>0){a.each(g,function(h,j){if(a.inArray(j,e)<0){f.fn2.apply(j)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var d=a.livequery.queue.length;while(d--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(e,f){if(!a.fn[f]){return}var d=a.fn[f];a.fn[f]=function(){var g=d.apply(this,arguments);a.livequery.run();return g}})},run:function(d){if(d!=undefined){if(a.inArray(d,a.livequery.queue)<0){a.livequery.queue.push(d)}}else{a.each(a.livequery.queries,function(e){if(a.inArray(e,a.livequery.queue)<0){a.livequery.queue.push(e)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(d){if(d!=undefined){a.livequery.queries[d].stop()}else{a.each(a.livequery.queries,function(e){a.livequery.queries[e].stop()})}}});var c=a.prototype.init;a.prototype.init=function(d,f){var e=c.apply(this,arguments);if(d&&d.selector){e.context=d.context,e.selector=d.selector}if(typeof d=="string"){e.context=f||document,e.selector=d}return e};a.prototype.init.prototype=a.prototype})(jQuery);String.prototype.score=function(c,a){score=0;obj=this.substring(this.indexOf('">')+1,this.lastIndexOf("<"));if(c.length==0){return 0.9}if(c.length>obj.length){return 0}if(obj.indexOf(c)>=0){score=obj.indexOf(c)}return(score/1000)};jQuery.fn.liveUpdate=function(f){function d(){var n=jQuery.trim(jQuery(this).val().toLowerCase());var q=[];if(!n||n=="find pbs programs"){e.show();g.show();c.show()}else{e.hide();a.each(function(j){var k=this.score(n);if(k>0){q.push([k,j])}});jQuery.each(q.sort(function(k,j){return j[0]-k[0]}),function(){jQuery(e[this[1]]).show()});for(var h=0;h<g.length;h++){var r=$(g[h]);var o=$(c[h]);var p=r.next().children().children();r.hide();o.hide();for(var l=0;l<p.length;l++){if(p[l].style.display=="list-item"){r.show();o.show()}}}}}f=jQuery(f);if(f.length){var e=f.children("li");var g=$("#div_programs_list").children("div.tabrule");var c=$("#div_programs_list").children("p.backtotop"),a=e.map(function(){return this.innerHTML.toLowerCase()});this.keyup(d).keyup();this.parents("form").submit(function(){return false})}return this};jQuery.fn.fadeSliderToggle=function(a){a=jQuery.extend({speed:500,easing:"swing"},a);caller=this;if($(caller).css("display")=="none"){$(caller).animate({opacity:1,height:"toggle"},a.speed,a.easing)}else{$(caller).animate({opacity:0,height:"toggle"},a.speed,a.easing)}};if(jQuery.proxy==undefined){jQuery.extend({proxy:function(d,c,a){if(arguments.length===2){if(typeof c==="string"){a=d;d=a[c];c=undefined}else{if(c&&!jQuery.isFunction(c)){a=c;c=undefined}}}if(!c&&d){c=function(){return d.apply(a||this,arguments)}}if(d){c.guid=d.guid=d.guid||c.guid||jQuery.guid++}return c}})}if(jQuery.curry==undefined){jQuery.extend({curry:function(f,e){var c=[];for(var d=2,a=arguments.length;d<a;d++){c.push(arguments[d])}return function(){var h=[];for(var j=0,g=arguments.length;j<g;j++){h.push(arguments[j])}h=c.concat(h);return f.apply(e||this,h)}}})}if(typeof PBS=="undefined"||!PBS){var PBS={}}PBS.namespace=function(){var c=arguments,h=null,f,e,g;for(f=0;f<c.length;f=f+1){g=c[f].split(".");h=PBS;for(e=(g[0]=="PBS")?1:0;e<g.length;e=e+1){h[g[e]]=h[g[e]]||{};h=h[g[e]]}}return h};PBS.namespace("thirdparty");PBS.thirdparty.gygia=(function(g){var e={APIKey:"2_txlUPhIBhbjs_VzFJKeb-9yGNWwBonozzx8Jnfb7vy-UMeF8QsS6fAYVHA-XPZC5",userMessage:"Check out this information from PBS.",title:"Incredible PBS Pages",description:"Alternate description...",linkBack:"http://www.pbs.org",actionLink:"Read More",logo:"http://profile.ak.fbcdn.net/object3/195/102/q19013582168_1298.jpg"};var j=null,h={httpEquiv:[],name:[]},d=gigya.services.socialize;var f=function(){g("meta").each(function(){try{if(this.httpEquiv){if(h.httpEquiv[this.httpEquiv]){h.httpEquiv[this.httpEquiv].push(this.content)}else{h.httpEquiv[this.httpEquiv]=[this.content]}}if(this.name){if(h.name[this.name]){h.name[this.name].push(this.content)}else{h.name[this.name]=[this.content]}}}catch(k){}})};var c=function(){j=new d.UserAction();j.setUserMessage(e.userMessage);j.setTitle(document.title?document.title:e.title);j.setLinkBack(window.location.href);j.setDescription(h.name.description?h.name.description.toString():e.description.toString());var k=e.linkBack;j.addActionLink(e.actionLink,(h.name.linkBack.length>1)?h.name.linkBack[1]:e.linkBack);j.addMediaItem({type:"image",src:e.logo,href:h.name.linkBack?h.name.linkBack[0]:e.linkBack})};var a=function(){d.showShareUI(e,{userAction:j,showMoreButton:true,showEmailButton:true})};return{init:function(l,k){g.extend(e,k||{});f();c();g(l).click(a)},share:a}}(jQuery));PBS.utils=(function(a){return{isInteger:function(c){return/^-?\d+$/.test(c)},isZipCode:function(d){var c=a(d).val()||d;if(c===""){return false}else{if(!this.isInteger(c)){a(d).parents("fieldset.zipcode").append('<p class="error">Zipcode is not numeric</p>');return false}else{if(c.length<=4){a(d).parents("fieldset.zipcode").append('<p class="error">Zipcode to short</p>');return false}else{return true}}}},trim:function(c){return c.replace(/^\s+|\s+$/g,"")},ltrim:function(c){return c.replace(/^\s+/,"")},rtrim:function(c){return c.replace(/\s+$/,"")},isEmail:function(d){var c=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(this.trim(d).match(c)){return true}else{return false}}}}(jQuery));PBS.namespace("widget");(function(){var d=jQuery;var a={};var c=function(e){this.init.apply(this,arguments)};c.prototype={_id:null,_width:0,_stepper:100,_initAttributes:function(e){this._slider=d("#"+e+"-content-slider");if(this._slider.length===0){return}this._scroll=d("#"+e+"-content-scroll");this._scroll_wrap=d("#"+e+"-content-scroll-wrap");this._handle=d("div."+e+"-content-slider-handle");this._container=d("#"+e+"-content-holder");this._id=e},_initButtons:function(){d("#prev").click(d.proxy(function(){this._slider.slider("down")},this));d("#next").click(d.proxy(function(){this._slider.slider("up")},this))},_initContainer:function(){var e=0;this._container.children("li").each(function(){e+=d(this).width()});this._width=e;var f=d("#"+this._id+"-slider-block");this._container.css("width",this._width+"px");this._container.css("margin-left","-"+this._width+"px");this._onResize();this._stepper=(d("body").width()/this._container.children("li").width())*2;d("ul li div",this._scroll).livequery("mouseenter",function(){var h=d(this).children("h3.underlay").find("a").children("span.desc");var g=d(h).height();d(this).children("h3.underlay").animate({bottom:g+"px"},100)}).livequery("mouseleave",function(){d(this).children("h3.underlay").animate({bottom:"0"},100)});d(window).resize(d.proxy(this._onResize,this))},_slideUp:function(e){e.value(e.value()+e.options.step*this._stepper)},_slideDown:function(e){e.value(e.value()-e.options.step*this._stepper)},_onSliderChange:function(h,g){var f=this._scroll.attr("scrollWidth")-this._scroll.width();this._scroll.animate({scrollLeft:g.value*(f/100)},200)},_onSliderSlide:function(h,g){var f=this._scroll.attr("scrollWidth")-this._scroll.width();this._scroll.attr({scrollLeft:g.value*(f/100)})},_onResize:function(){var f=d("body").width();var j=d("#"+this._id+"-slider-block");var h=100;var e=184;if(this._container.hasClass("not-visible")){this._container.removeClass("not-visible");h=1500}if(f>30+this._width){e=this._container.height();this._scroll_wrap.css({height:e});var g=this._slider;this._container.animate({marginLeft:(f-30-this._width)/2},h,"easeOutExpo",function(){g.slider("value",0);j.fadeOut(100)})}else{e=this._container.height()+this._slider.height();this._scroll_wrap.css({height:e});this._container.animate({marginLeft:"0"},h,"easeOutExpo",function(){j.fadeIn(100)})}this._stepper=(f/this._container.children("li").width())*2},init:function(g){this._initAttributes.call(this,g);if(this._id==null){return}a[this._id]=this;this._initButtons();var e=this._slider.slider({animate:true,handle:this._handle,change:d.proxy(this._onSliderChange,this),slide:d.proxy(this._onSliderSlide,this)});var f=this;d.extend(d.ui.slider.prototype,{up:function(){f._slideUp.call(f,this)},down:function(){f._slideDown.call(f,this)}});this._initContainer()}};PBS.widget.Slider=c})();PBS.whatson_expanded=false;function initSchedule(){var a=0;$("#sub-navigation .swidth").each(function(c){a=a+$(this).width()}).ready(function(){$("#schedule div.shadow").css("width",a);$("#schedule #tabs").css("width",a);$("#schedule p.schedule-links").css("width",a);$("#schedule #tabs li ol.air-time").css("width",a)});$("li.whats-on, li.show-schedule").live("click",function(){if($("li.show-schedule a").hasClass("open")){$("#whats_on_sta_id").html($("#tabs li a.tab, ul.tabs li a.tab").children(".meta_common_name").html());$("li.show-schedule a").removeClass("open").text("Close").addClass("close");$("li.border-left").css("background-color","#fff");$("#ticker").fadeOut(100,function(){$("#ticker").jCarouselLite("pause")});$("#schedule-date").fadeIn(100);$("#schedule").slideDown(100);resizeAirTime()}else{$("li.show-schedule a").removeClass("close").text("More").addClass("open");$("li.border-left").css("background-color","transparent");$("#schedule-date").fadeOut(50);$("#ticker").fadeIn(300,function(){$("#ticker").jCarouselLite("resume")});$("#schedule").slideUp(100)}compute_available_tab_space()})}function compute_available_tab_space(){var f=parseInt($("#schedule > ul").css("width"))-15;var a=0;var g=false;var d=105;var c="More Stations";if(single_station!="False"){c="More Channels"}var e='<li><a class="tab" href="http://pbs.org/cgi-registry/whatson/index.cgir"><span>'+c+"</span></a></li>";$("#tabs>li").each(function(h){current_element_width=parseInt($(this).width());if((a+current_element_width+d)<=f){a+=current_element_width}else{$(this).css({display:"none"});g=true}});if(g){$("#tabs").append(e)}}function resizeAirTime(){var a=0;$("#schedule #tabs li.selected ol.air-time li").each(function(){a=a+$(this).height()});$("#schedule").animate({height:a+60+"px"},100);$("#tabs li.selected").show()}function initTabs(){$("ul.tabs li.content-type div.wrap ol li a").click(function(a){a.stopPropagation();a.preventDefault();$(this).parent().parent().children("li").removeClass("selected");$(this).parent().addClass("selected");$(this).parents("ul.tabs").children("li").removeClass("active-content-type").removeClass("selected");$(this).parents("li.content-type").children("a.content-types").children("span").children("em").text($(this).text());$(this).parents("li.content-type").addClass("active-content-type");$(this).parents("li.content-type").children("div.wrap").slideUp(200)});$("ul.tabs li a.tab:not([class='.ajax-tab'])").click(function(a){a.stopPropagation();a.preventDefault();$("#pbs-main-content div.leftcol > div[class*='tab-content-']").addClass("hide");if($(this).attr("id")!=""){$("#pbs-main-content div.leftcol div."+$(this).attr("id")+"").removeClass("hide");if(!$(this).parent().hasClass("content-type")){$(this).parent().siblings("li.content-type").children("a.content-types").children("span").children("em").text("More Content Types");$(this).parent().siblings("li.content-type").children("div.wrap").children("div.center").children("ol").children("li").each(function(){$(this).removeClass("selected")})}}});$("#tabs li a.tab, ul.tabs li a.tab").click(function(a){$("#whats_on_sta_id").html($(this).children(".meta_common_name").html());$("#schedule .schedule-links .whats_on_timezone").html($(this).children(".meta_timezone").html());a.stopPropagation();a.preventDefault();if(!$(this).parent().hasClass("selected")){$(this).parent().parent().children("li.selected").children(".content").addClass("hide");$(this).parent().parent().children("li.selected,li.active-content-type").removeClass("selected").removeClass("active-content-type");$(this).parent().addClass("selected");$(this).siblings(".content").removeClass("hide");if($(this).siblings(".air-time").size()>0){resizeAirTime()}}})}function attatchFlipEvent(){$("div.bottom a.more, div.bottom a.less, div.bottom-last a.more, div.bottom-last a.less").live("click",function(a){a.stopPropagation();a.preventDefault();if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)<=7){$(this).parents("li:first").toggleClass("on");if($(this).parents("li:first").hasClass("on")){$(this).parents("li:first").children("div.back").show();$(this).parents("li:first").children("div.front").hide()}else{$(this).parents("li:first").children("div.back").hide();$(this).parents("li:first").children("div.front").show()}}else{$(this).parents("li:first").queue(function(){$(this).hide("clip",{direction:"horizontal"},72);$(this).queue(function(){$(this).toggleClass("on");$(this).dequeue()});$(this).show("clip",{direction:"horizontal"},72);$(this).dequeue()})}})}function initCarousels(){if($("#ticker ol li").size()>0){$("#ticker").jCarouselLite({vertical:true,auto:5000,autoTimer:true,speed:500,visible:1,start:0,carouselE:"#ticker ol",hoverE:"#ticker",easing:"easeInOutExpo",circular:true,afterEnd:function(a){$("#whats_on_sta_id").text(a.attr("title"))}})}if($("#feature div.carousel").size()>0){$("#feature div.carousel").jCarouselLite({vertical:false,speed:500,visible:1,start:0,auto:11000,autoTimer:true,hoverE:"#feature div.carousel",carouselE:"#feature div.carousel ul",carouselNavE:"#feature div.carousel-nav",btnPrev:"#feature div.carousel-nav ul li a.prev",btnNext:"#feature div.carousel-nav ul li a.next",btnGo:$("#feature div.carousel-nav ul li a.goto"),enableTitles:true,titleE:"#feature div.carousel-nav div.wrap h3",titleClass:"#feature div.carousel ul h3.title",enableParagraphs:true,paragraphsE:"#feature div.carousel-nav div.wrap p",paragraphClass:"#feature div.carousel ul p.desc",easing:"easeInOutExpo",circular:true})}if($("#pbs-community-carousel ul li").size()>0){$("#pbs-community-carousel").jCarouselLite({vertical:false,speed:500,visible:4,start:0,carouselE:"#pbs-community-carousel ul",btnPrev:"#pbs-community-carousel a.prev",btnNext:"#pbs-community-carousel a.next",easing:"easeInOutExpo",circular:true});$("#pbs-community-carousel").css({width:"904px"})}}function attatchDropDownEvents(){$("li.region").hoverIntent({sensitivity:1,interval:50,over:function(){$("div.local_wrap").slideDown(200)},timeout:0,out:function(){$("div.local_wrap").slideUp(200)}});$("li.kids").hoverIntent({sensitivity:10,interval:50,over:function(){$(this).children("div.kids_wrap").slideDown(200)},timeout:0,out:function(){$(this).children("div.kids_wrap").slideUp(200)}});$("#pbs-main-content ul.subtopics > li").hoverIntent({sensitivity:1,interval:50,over:function(){$(this).children("div.wrap").slideDown(100);$(this).addClass("over")},timeout:0,out:function(){$(this).children("div.wrap").slideUp(100);$(this).removeClass("over")}});$("#pbs-navigation li.topic-dropdown").hoverIntent({sensitivity:1,interval:50,over:function(){$(this).children("div.topic-wrap").slideDown(200)},timeout:0,out:function(){$(this).children("div.topic-wrap").slideUp(200)}});$("ul.tabs li.content-type").hoverIntent({sensitivity:1,interval:50,over:function(){$(this).children("div.wrap").slideDown(200);$(this).addClass("selected")},timeout:0,out:function(){$(this).children("div.wrap").slideUp(200);if(!$(this).hasClass("active-content-type")){$(this).removeClass("selected")}}});$("#pbs-main-content ol li.topic div a.wrap").hoverIntent({sensitivity:1,interval:50,over:function(){$(this).children("div.inner-wrap").animate({bottom:"0px"},120)},timeout:0,out:function(){$(this).children("div.inner-wrap").animate({bottom:"-30px"},120)}})}function attatchPopupEvents(){$("#share-popup").click(function(a){a.stopPropagation();a.preventDefault();handleAjaxPopups("share-popup-container",site_url+"share/",520,660,true)});$("#region-popup, a.change-region, a.pbs-region-popup").live("click",function(a){a.stopPropagation();a.preventDefault();handleAjaxPopups("region-popup-container",site_url+"pbs-ajax/regionPopup/ajax/",520,455,true)});$("#tv_schedules_localization").live("click",function(a){a.stopPropagation();a.preventDefault();handleAjaxPopups("region-popup-container",site_url+"pbs-ajax/regionPopup/ajax/",520,455,true)});$("#member-station-popup, a.change-member-station").live("click",function(a){a.stopPropagation();a.preventDefault();handleAjaxPopups("member-station-popup-container",site_url+"pbs-ajax/memberPopup/ajax/",520,385,true)});$("#support-pbs-popup").live("click",function(a){a.stopPropagation();a.preventDefault();handleAjaxPopups("region-popup-container",site_url+"pbs-ajax/support-pbs/",520,385,true)});$("#right_rail_donate").live("click",function(a){a.stopPropagation();a.preventDefault();handleAjaxPopups("region-popup-container",site_url+"pbs-ajax/support-pbs/",520,385,true)})}function handleAjaxPopups(e,f,d,c,a){if($("#popup-overlay").size()==0){$("body").append('<div id="popup-overlay" class="'+e+'"></div>');if(a){$("#popup-overlay").load(f,null,function(){showMainAjaxOverlay();cufonEnableAjaxPopups();createShareLinks();createCaptcha()})}else{$("#popup-overlay").html(f);cufonEnableAjaxPopups()}}else{$("#popup-overlay").removeClass();$("#popup-overlay").addClass(e);if(a){$("#popup-overlay").load(f,null,function(){animateAjaxPopupContainer(d,c,$("#popup-overlay"));cufonEnableAjaxPopups();createShareLinks();createCaptcha()})}else{$("#popup-overlay").html(f);cufonEnableAjaxPopups();animateAjaxPopupContainer(d,c,$("#popup-overlay"))}}centerAjaxPopups($("#popup-overlay"))}function redrawCaptcha(){if($("fieldset.recaptcha").size()>0){Recaptcha.reload()}}function createCaptcha(){if($("fieldset.recaptcha").size()>0){Recaptcha.create("6LcUYAoAAAAAAG5J8TqtxPJ1XFlwwAFbPS87oSyM","recaptcha_create",{theme:"clean",tabindex:0,callback:Recaptcha.focus_response_field})}}function cufonEnableAjaxPopups(){}function centerAjaxPopups(a){$(a).css({left:(($("body").width()-$(a).width())/2)+"px"})}function showMainAjaxOverlay(){$("#pbs-main-overlay").css({height:$(document).height()+"px",opacity:0.7}).fadeIn(500,function(){$("#popup-overlay").fadeIn(200)})}function animateAjaxPopupContainer(c,a,d){$(d).animate({width:c+"px",height:a+"px"},0)}function closeAjaxPopups(){$("#pbs-main-overlay").click(function(){$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})});first_time=false})}function initPlayIcons(){$("a.play").each(function(){$(this).removeClass("play").addClass("play-active");$(this).prepend("<span><!-- --></span>");$(this).children("span").css({height:$(this).children("img").height(),width:$(this).children("img").width(),backgroundPosition:(($(this).children("img").width()-52)/2)+"px "+(($(this).children("img").height()-52)/2)+"px"});$(this).children("img").css({position:"relative",zIndex:10})})}function createUnderlay(c){if($(c).children("div.underlay-active").size()<=0){$(c).css({height:$(c).css("height")});$(".dl_underlay").css({width:$(c).parent().css("width")});var a=$('<div class="underlay-active"></div>');if($(c).closest(".carousel-nav").attr("class")=="carousel-nav"){$(c).prepend(a);$(c).children("div.underlay-active").css({height:$(c).parent().height(),width:$(c).width(),margin:0,top:-$(c).children("a").children("span.title").height()});$(c).children("a").children("span.title").css({top:-$(c).children("a").children("span.title").height()-5});if($(c).children("a").children("span.desc").html()){$(c).children("a").children("span.desc").css({top:-$(c).children("a").children("span.title").height()})}}else{a.html($(c).html());$(c).html(a);a.css({height:$(c).parent().height(),width:$(c).width(),margin:0,top:-a.children("a").children("span.title").height()-3})}}}function displayFeatureCopy(){$("#feature div.carousel-nav div.wrap").css("height",$("#feature div.carousel-nav h3").height());$("#carousel-content-holder li, #feature div.carousel-nav div.wrap").hoverIntent({sensitivity:1,interval:50,over:function(){var a=$("#feature div.carousel-nav div.wrap");$(a).animate({height:$(a).children("div.underlay-active").height()},200,"easeInOutExpo");$("#feature div.carousel").jCarouselLite("pause")},timeout:0,out:function(){var a=$("#feature div.carousel-nav div.wrap");$(a).animate({height:$("#feature div.carousel-nav h3").height()},200,"easeInOutExpo");$("#feature div.carousel").jCarouselLite("resume")}})}function adjustFeatureCarouselFiller(){var c=0;$("#feature div.carousel-nav ul li").each(function(){c=c+$(this).width()});$("#feature div.carousel-nav ul").css("width",c);var a=$("#feature div.carousel-nav").width();var d=$("#feature div.carousel-nav ul").width();var e=new Array();e[0]=Math.ceil((a-d)/2);e[1]=Math.floor((a-d)/2);$("#feature div.carousel-nav div.filler-right, #feature div.carousel-nav div.filler-left").each(function(f){$(this).css("width",e[f])})}function removeUnderlay(a){$(a).children("div.underlay-active").remove()}function initInputs(){var c=new Array();var a=false;c[0]={selector:"#q",defaultText:"Search Programs, Topics, Blogs and more on PBS"};c[1]={selector:"#pbs-main-content div.rightcol ol li.newsletter form input",defaultText:"Sign Up"};c[2]={selector:"#pbs-main-content div div.program-box form input",defaultText:"Search PBS Programs"};c[3]={selector:"#q-result",defaultText:$("#q-result").defaultValue};for(i=0;i<c.length;i++){$(c[i].selector).bind("blur",function(){if($(this).val()==""){$(this).val(this.defaultValue)}}).bind("focus",function(){if($(this).val()==this.defaultValue){$(this).val("")}})}$("fieldset input[type='submit']").click(function(){for(i=0;i<c.length;i++){if($(this).siblings(c[i].selector).size()>0){if($(this).siblings(c[i].selector).val()==""||$(this).siblings(c[i].selector).val()==c[i].defaultText){a=false}else{a=true}}}if(a){return true}else{return false}})}function initFF2WordWrapFix(){if(jQuery.browser.version.substr(0,3)==1.8&&jQuery.browser.mozilla){if($("ol.search-results").size()>0){$("ol.search-results li p a:nth-child(2n)").addClass("wordwrap")}}}function drawOverlay(a){$(a).addClass("clearfix").prepend('<div class="overlay"><img src="'+media_path+'/images/loading.gif" alt="Loading ..."/></div>');var c=($(a).height()<32)?2:Math.floor($(a).height()-32)/2;var d=($(a).height()<36)?36:$(a).height();$("div.overlay img").css({marginTop:c+"px",marginLeft:"auto",marginRight:"auto"});$("div.overlay").css({height:d+"px",opacity:0.7}).fadeIn(200)}function removeOverlay(a,c){$(c).removeClass("clearfix");$("div.overlay").fadeOut(300).remove();$("#pbs-main-content div.leftcol > div[class*='tab-content-']").addClass("hide");$("#pbs-main-content div.leftcol div."+$(a).attr("id")+"").removeClass("hide");if(!$(a).parent().hasClass("content-type")){$(a).parent().siblings("li.content-type").children("a.content-types").children("span").children("em").text("More Content Types");$(a).parent().siblings("li.content-type").children("div.wrap").children("div.center").children("ol").children("li").each(function(){$(this).removeClass("selected")})}}function attatchFormValidation(){$("input.cancel").live("click",function(){$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})})});if($("#region form").size()>0){$("#region form input[name='zipcode']").change(function(){$("#region form p.error").remove();PBS.utils.isZipCode(this)})}$("#region form").live("submit",function(event){event.stopPropagation();event.preventDefault();return false});$("#region form input[type='submit']").live("click",function(event){event.stopPropagation();event.preventDefault();var submitEl=$(this);$("#region form p.error").remove();if($("#region form input[name='state-id']:checked").size()<=0&&PBS.utils.isZipCode($("#region form input[name='zipcode']"))){$("#region form input[type='submit']").attr("disable",true);request_url=site_url+"pbs-ajax/memberPopup/ajax/?zipcode="+$("#region form input[name='zipcode']").val();if($("#from_donate").val()==1){request_url+="&donation=fromdonate"}$.get(request_url,function(htmlData){if($(submitEl).hasClass("next-step")){handleAjaxPopups("member-station-popup-container",htmlData,520,385,false)}else{$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})});document.location.reload()}})}else{if($("#region form input[name='state-id']:checked").size()>0){$("#region form input[type='submit']").attr("disable",true);if($(submitEl).hasClass("next-step")){request_url=site_url+"pbs-ajax/memberPopup/ajax/?state="+$("#region form input[name='state-id']:checked").val();if($("#from_donate").val()==1){request_url=request_url+"&donation=fromdonate"}$.get(request_url,function(htmlData){handleAjaxPopups("member-station-popup-container",htmlData,520,385,false)})}else{$.ajax({type:"GET",url:site_url+"pbs-ajax/regionalize/"+$("#region form input[name='state-id']:checked").val()+"/",async:false});$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})});document.location.reload()}}else{$("#region form fieldset.action").prepend('<p class="error">Please either enter a valid zipcode or select a state.</p>')}}return false});$("#member-station form").live("submit",function(event){event.stopPropagation();event.preventDefault();return false});$("#member-station form input[type='submit']").live("click",function(event){event.stopPropagation();event.preventDefault();$("#member-station form p.error").remove();if($("#member-station form input[name='member-station-id']:checked").size()<=0){$("#member-station fieldset.action").prepend('<p class="error">Please select your member station.</p>')}else{var state_slug=$("#member-station form input[name='state']").val()||"";var member_slug=$("#member-station form input[name='member-station-id']:checked").val()||"";var zip_code=$("#zipcode").val()||"";var request_url=site_url+"pbs-ajax/localize/";var request_data={state:state_slug,station:member_slug,zipcode:zip_code};if($("#from_donate_station").val()==1){request_data.donation="fromdonate"}$.get(request_url,request_data,function(){$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})});if(request_data.donation=="fromdonate"){window.location=site_url+"pbs-ajax/support-pbs/ajax/"}else{window.location=g_current_url}})}return false});$("#share form").live("submit",function(){$("#share form p.error").remove();var toEmailArray=$("#to").val().split(",");var fromEmail=$("#from").val();var message=$("#message").val();var i=0;var hasError=false;if(toEmailArray==""){$("#to").parent().append('<p class="error">Please add email address to share to.</p>');hasError=true}else{if(toEmailArray.length>10){$("#to").parent().append('<p class="error">You entered too many email addresses.</p>');hasError=true}else{while(toEmailArray.length>i){if(!PBS.utils.isEmail(toEmailArray[i])){$("#to").parent().append('<p class="error">Please check the email address(es)</p>');hasError=true;break}i++}}}if(fromEmail==""){$("#from").parent().append('<p class="error">Please add your email address.</p>');hasError=true}else{if(!PBS.utils.isEmail(fromEmail)){$("#from").parent().append('<p class="error">Your email address is not valid.</p>');hasError=true}}if(message==""){$("#message").parent().append('<p class="error">Please enter a message.</p>');hasError=true}if(captcha_status=="on"){var response=$("#recaptcha_response_field").val();var challenge=$("#recaptcha_challenge_field").val();var requestUrl="http://localhost/pbsorg/pbsorg_svn/pbs_media/templates/php/recaptcha-ajax.php";var data="challenge="+challenge+"&response="+response;$.ajax({type:"POST",url:requestUrl,data:data,contentType:"application/x-www-form-urlencoded",async:false,dataType:"json",error:function(){hasError=true;redrawCaptcha()},success:function(data,textStatus){if(data==""){hasError=true;$("fieldset.recaptcha").append('<p class="error" id="recaptcha-error">reCaptcha failed, please try again.</p>')}else{var dataObj=eval(data);if(!dataObj.is_valid){$("fieldset.recaptcha").append('<p class="error" id="recaptcha-error">reCaptcha failed, please try again.</p>')}hasError=(dataObj.is_valid)?true:hasError}},complete:function(XMLHttpRequest,dataStatus){redrawCaptcha()}})}else{if(hasError){return false}else{return true}}return false})}function createShareLinks(){var a=window.location.href;var c=window.document.title;$("#message").val($("#message").val()+"\n\n"+a);$("div.share ul li ul a").each(function(){switch($(this).attr("class")){case"google":$(this).attr("href","http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+encodeURIComponent(a)+"&title="+encodeURIComponent(c));break;case"facebook":$(this).attr("href","http://www.facebook.com/share.php?u="+encodeURIComponent(a)+"&t="+encodeURIComponent(c));break;case"delicious":$(this).attr("href","http://del.icio.us/post?v=4&noui&jump=close&url="+encodeURIComponent(a)+"&title="+encodeURIComponent(c));break;case"digg":$(this).attr("href","http://digg.com/submit?phase=2&url="+encodeURIComponent(a)+"&title="+encodeURIComponent(c));break;case"mixx":$(this).attr("href","http://www.mixx.com/submit?page_url="+encodeURIComponent(a));break;case"stumbleupon":$(this).attr("href","http://www.stumbleupon.com/submit?url="+encodeURIComponent(a)+"&title="+encodeURIComponent(c));break;case"newsvine":$(this).attr("href","http://www.newsvine.com/_wine/save?aff=pbs&u="+encodeURIComponent(a)+"&h="+encodeURIComponent(c));break;case"newstrust":$(this).attr("href","http://newstrust.net/submit?ref=pbs&url="+encodeURIComponent(a)+"&title="+encodeURIComponent(c));break;case"vodpod":$(this).attr("href","http://vodpod.com/account/add_video_page?p="+encodeURIComponent(a));break}})}function PBSMultichannelEpisodeWindowPopUp(f){this.name="pbsparentwindow";var d="http://www.pbs.org/tvschedules/programinfopopup.html?display_format=ep_description&";d=d+f;var c="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=450";if(navigator.appName.indexOf("Microsoft")>=0){c+=",left=50,top=50"}else{c+=",screenX=50,screenY=50"}if(e!=null){if(e.closed==false){e.close()}}var e=null;e=window.open(d,"ProgramInformation",c);e.focus()}function popitup(d,f,a,c){var e=(screen.width/2)-(f/2);newwindow=window.open(d,c,"height="+a+",width="+f+",screenX="+e+",screenY=150,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0",true);if(window.focus){newwindow.focus(c)}if(window.opener){window.opener.location.href="/"}window.close();return false}function handle_search(a){a=$.trim(a);if(a.length>0){document.location=site_url+"search/"+encodeURIComponent(a)+"/"}}$.extend({getUrlVars:function(c){var f=[],e;var a=c.slice(c.indexOf("?")+1).split("&");for(var d=0;d<a.length;d++){e=a[d].split("=");f.push(e[0]);f[e[0]]=e[1]}return f},getUrlVar:function(c,a){return $.getUrlVars(c)[a]}});function beautify_search_results(){$("#div_search_results").find("img").hide();$("#results_tabs").show();$('[name="gs"]').attr("action","").find("table:first").css("margin-bottom","10px");$('[name="gs"]').bind("submit",function(){handle_search($('[name="q"]').val());return false});if($("#div_search_results").find("input")[1]){$("#div_search_results").find("input")[1].src=media_path+"images/button_go.jpg";$("#div_search_results").find("input:first").addClass("search-input");$("#div_search_results").children("table").addClass("search-results-paging-table");$(".search-results-paging-table").find("td:second").addClass("numbering-td");if($(".numbering-td").find("a")){count=$(".numbering-td").find("a").length;if(count==0){count=$(".search-results-paging-table").find("a").length}for(i=0;i<count;i++){el=$(".search-results-paging-table").find("a")[i];var g=$.getUrlVars(el.href);el.href=$("#search_url").val()+g.q+"/"+g.start+"/"+g.num+"/"}}}if($(".search-results-container").length>0){$(".search-results-container").find("table").addClass("hide");$(".search-results-container").children()[0].classList.add("hide")}if($("#results_tabs").length==0){$('[name="gs"]').css({height:"40px"})}$('[name="btnG"]').addClass("search-button");$("#station_results").addClass("station-search-results");$("#station_results").find("table").hide();var d=$("#station_results").children("div");var e=[];d.find("p").each(function(){if(e.length<5){e.push($(this))}});d.html("");for(var f=0;f<e.length;f++){d.append(e[f])}if($("#div_search_results").children("div")[0]){if($("#div_search_results>#adsense")[0]){var a=$("#div_search_results").children("div")[1];$(a).addClass("main")}else{var a=$("#div_search_results").children("div")[0];$(a).addClass("main")}$(".main").children("a").prepend('<div class="search-results-wrapper"></div>');$(".results_a_more").click(function(){caller=$(".station_results_main");$(".results_a_less").show();$(this).hide();if($(caller).css("display")=="none"){$(caller).animate({opacity:1,height:"toggle"},500,"linear")}else{$(caller).animate({opacity:0,height:"toggle"},500,"linear")}});$(".results_a_less").click(function(){caller=$(".station_results_main");$(".results_a_more").show();$(this).hide();if($(caller).css("display")=="none"){$(caller).animate({opacity:1,height:"toggle"},500,"linear")}else{$(caller).animate({opacity:0,height:"toggle"},500,"linear")}});$("#station_results").find("br:last").hide();$("#station_results").find("p").find("a:last").addClass("link");$("#station_results > div:last").addClass("station_results_main");var c=$(".main").find("table");c.attr({cellpadding:"0",height:"100%",width:"98%",border:"0"}).css({"background-color":"#cccccc"});c.each(function(){var j=$(this);var h=j.find("td");h.attr({height:"100%"}).css({"vertical-align":"middle","padding-left":"10px","padding-right":"10px"});j.find("span.searchresultstitle").text("Featured Program")});$(".station_results_main > p").each(function(){var h=$(this).html();var j=h.substring(h.indexOf("["),h.indexOf("]")+1);$(this).html(h.replace(j,""))})}if($("#div_search_results").children("p")[0]){$("#div_search_results").children("p")[0].className="did_you_mean";el=$(".did_you_mean").children("a")[0];el.href=$("#search_url").val()+$.getUrlVars(el.href)["q"]}$('[name="gs"]').append($("#results_tabs"));$('[name="gs"] ~ br').hide();$(".main ~ br").show();$("#div_search_results").append($("#station_results"));$(".main").after($(".station_results_main"));$("#search_all_tab").click(function(){$("#station_results_tab").removeClass("title-tab-active");$("#station_results_tab").addClass("title-tab-inactive");$("#search_all_tab").removeClass("title-tab-inactive");$("#search_all_tab").addClass("title-tab-active");$("#search_title_tab_selector").removeClass("search_tab_local_selected");$("#search_title_tab_selector").addClass("search_tab_selected");$(".station_results_main").hide();$(".main").show();$("#div_search_results").find("#adsense").show();$(".search-results-paging-table").show();$("#div_search_results > br").show();$('[name="gs"] ~ br').hide()});$("#station_results_tab").click(function(){$("#station_results_tab").removeClass("title-tab-inactive");$("#station_results_tab").addClass("title-tab-active");$("#search_all_tab").removeClass("title-tab-active");$("#search_all_tab").addClass("title-tab-inactive");$("#search_title_tab_selector").removeClass("search_tab_selected");$("#search_title_tab_selector").addClass("search_tab_local_selected");$('[name="gs"] ~ br').hide();$("#station_results").show();$(".main").hide();$(".station_results_main").show();$("#div_search_results").find("#adsense").show();$(".search-results-paging-table").hide()});$("#div_search_results .adsense_header").each(function(){var h=$(this).parent().find(".adsense_whatsthis");$(this).after(h)})}jQuery(function($){if($("#quick_search").liveUpdate){$("#quick_search").liveUpdate("#div_programs_list ul").focus();$("#quick_search").value="Find PBS Programs";$("#quick_search").blur()}$("#programs-tab").click(function(){$("#primetime-tab").removeClass("title-tab-active");$("#primetime-tab").addClass("title-tab-inactive");$("#programs-tab").removeClass("title-tab-inactive");$("#programs-tab").addClass("title-tab-active");$("#title-tab-selector").removeClass("primetime-selected");$("#title-tab-selector").addClass("programs-selected");$("#primetime-container").removeClass("show");$("#primetime-container").addClass("hide");$("#programs-container").removeClass("hide");$("#programs-container").addClass("show")});$("#primetime-tab").click(function(){$("#programs-tab").removeClass("title-tab-active");$("#programs-tab").addClass("title-tab-inactive");$("#primetime-tab").removeClass("title-tab-inactive");$("#primetime-tab").addClass("title-tab-active");$("#title-tab-selector").removeClass("programs-selected");$("#title-tab-selector").addClass("primetime-selected");$("#primetime-container").removeClass("hide");$("#primetime-container").addClass("show");$("#programs-container").removeClass("show");$("#programs-container").addClass("hide");$.ajax({url:site_url+"pbs-ajax/primetime/",success:function(data){$("#primetime-container").html(data)}});$("#loading").bind("ajaxSend",function(){$(this).show()}).bind("ajaxComplete",function(){$(this).hide()})});$(".a_more").click(function(){caller=$(this).parent().next();$(this).hide();if($(caller).css("display")=="none"){$(caller).animate({opacity:1,height:"toggle"},500,"linear")}else{$(caller).animate({opacity:0,height:"toggle"},500,"linear")}});$(".a_less").click(function(){caller=$(this).parent().parent();$(".a_more").show();if($(caller).css("display")=="none"){$(caller).animate({opacity:1,height:"toggle"},500,"linear")}else{$(caller).animate({opacity:0,height:"toggle"},500,"linear")}});beautify_search_results();$("#subtopic_selection").hover(function(){$(".select_subtopic_ul").css({display:"block"})},function(){$(".select_subtopic_ul").css({display:"none"})});$(".select_subtopic").click(function(){return false});PBS.thirdparty.gygia.init("#sharing-button");var homepageDL=new PBS.widget.Slider("dl");var programsDL=new PBS.widget.Slider("programs-dl");var on_item_click=function(location){var webobject_title=$(this).attr("title")||$(this).attr("rel");var index=$(this).attr("ref");_gaq.push(["_trackEvent",location,"Position "+index,webobject_title])};$("#carousel_first_video a").live("click",$.curry(on_item_click,null,"homepage_carousel"));$("ul#carousel-content-holder > li a").live("click",$.curry(on_item_click,null,"homepage_carousel"));$("#dl-content-holder li").each(function(index){$(this).find("a").each(function(){$(this).attr("ref",index+1)})});$("#dl-content-holder li a").live("click",$.curry(on_item_click,null,"homepage_dl"));$("#programs-container .a_program").live("click",$.curry(on_item_click,null,"homepage_programs"));initCarousels();attatchPopupEvents();attatchDropDownEvents();adjustFeatureCarouselFiller();$(".underlay").each(function(){createUnderlay($(this))});$("div.rightcol ol li:nth-child(2)").addClass("li-margin-bottom");initInputs();displayFeatureCopy();initSchedule();initTabs();closeAjaxPopups();attatchFormValidation();$("#search_input").bind("keyup",function(e){var code=(e.keyCode?e.keyCode:e.wich);if(code==13){handle_search($("#search_input").val())}});$("#search_btn").bind("click",function(){handle_search($("#search_input").val())});$("input.cancel").click(function(){window.close()});if($("#region form").size()>0){$("#region form input[name='zipcode']").change(function(){$("#region form p.error").remove();PBS.utils.isZipCode(this)})}$("#region form").live("submit",function(event){event.stopPropagation();event.preventDefault();return false});$("#region form input[type='submit']").live("click",function(event){event.stopPropagation();event.preventDefault();var submitEl=$(this);$("#region form p.error").remove();if(PBS.utils.isZipCode($("#region form input[name='zipcode']"))){$("#region form input[type='submit']").attr("disable",true);$.ajax({type:"GET",url:site_url+"pbs-ajax/memberPopup/ajax/"+$("#region form input[name='zipcode']").val()+"/",async:false,complete:function(){if($(submitEl).hasClass("next-step")){popitup(site_url+"pbs-ajax/memberPopup/ajax/"+$("#region form input[name='zipcode']").val()+"/",495,375,"memberstation")}else{window.opener.location.href="/";window.close()}}})}else{if($("#region form input[name='state-id']:checked").size()>0){$("#region form input[type='submit']").attr("disable",true);if($(submitEl).hasClass("next-step")){$.ajax({type:"GET",url:site_url+"pbs-ajax/memberPopup/ajax/"+$("#region form input[name='state-id']:checked").val()+"/",async:false,complete:function(){if($("#region form input[name='zipcode']").val()!=""){popitup(site_url+"pbs-ajax/memberPopup/ajax/"+$("#region form input[name='zipcode']").val()+"/",495,375,"memberstation")}else{popitup(site_url+"pbs-ajax/memberPopup/ajax/"+$("#region form input[name='state-id']:checked").val()+"/",495,375,"memberstation")}}})}else{$.ajax({type:"GET",url:site_url+"pbs-ajax/regionalize/"+$("#region form input[name='state-id']:checked").val()+"/",async:false,complete:function(){if(window.opener){window.opener.location.href="/"}else{window.parent.location.href="/"}window.close()}})}}else{$("#region form fieldset.action").prepend('<p class="error">Please either enter a valid zipcode or select a state.</p>')}}return false});$("#member-station form").submit(function(event){event.stopPropagation();event.preventDefault();$("#member-station form p.error").remove();if($("#member-station form input[name='member-station-id']:checked").size()<=0){$("#member-station fieldset.action").prepend('<p class="error">Please select your member station.</p>')}else{$.ajax({type:"GET",url:site_url+"pbs-ajax/localize/"+$("#member-station form input[name='state']").val()+"/"+$("#member-station form input[name='member-station-id']:checked").val()+"/",async:false,complete:function(){if(window.opener){window.opener.location.href="/"}else{window.parent.location.href="/"}window.close()}})}return false});$("#region-popup-focus").click(function(event){event.stopPropagation();event.preventDefault();popitup($(this).attr("href"),495,442,"region");return false});if($("#share").size()>0){if(!window.opener){var parentHref=window.location.href;var parentTitle=window.document.title}else{var parentHref=window.opener.location.href;var parentTitle=window.opener.document.title}$("#message").val($("#message").val()+"\n\n"+parentHref);$("div.share ul li ul a").each(function(){switch($(this).attr("class")){case"google":$(this).attr("href","http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+encodeURIComponent(parentHref)+"&title="+encodeURIComponent(parentTitle));break;case"facebook":$(this).attr("href","http://www.facebook.com/share.php?u="+encodeURIComponent(parentHref)+"&t="+encodeURIComponent(parentTitle));break;case"delicious":$(this).attr("href","http://del.icio.us/post?v=4&noui&jump=close&url="+encodeURIComponent(parentHref)+"&title="+encodeURIComponent(parentTitle));break;case"digg":$(this).attr("href","http://digg.com/submit?phase=2&url="+encodeURIComponent(parentHref)+"&title="+encodeURIComponent(parentTitle));break;case"mixx":$(this).attr("href","http://www.mixx.com/submit?page_url="+encodeURIComponent(parentHref));break;case"stumbleupon":$(this).attr("href","http://www.stumbleupon.com/submit?url="+encodeURIComponent(parentHref)+"&title="+encodeURIComponent(parentTitle));break;case"newsvine":$(this).attr("href","http://www.newsvine.com/_wine/save?aff=pbs&u="+encodeURIComponent(parentHref)+"&h="+encodeURIComponent(parentTitle));break;case"newstrust":$(this).attr("href","http://newstrust.net/submit?ref=pbs&url="+encodeURIComponent(parentHref)+"&title="+encodeURIComponent(parentTitle));break;case"vodpod":$(this).attr("href","http://vodpod.com/account/add_video_page?p="+encodeURIComponent(parentHref));break}})}$("#share form").submit(function(){$("#share form p.error").remove();var toEmailArray=$("#to").val().split(",");var fromEmail=$("#from").val();var message=$("#message").val();var i=0;var hasError=false;if(toEmailArray==""){$("#to").parent().append('<p class="error">Please add email address to share to.</p>');hasError=true}else{if(toEmailArray.length>10){$("#to").parent().append('<p class="error">You entered too many email addresses.</p>');hasError=true}else{while(toEmailArray.length>i){if(!PBS.utils.isEmail(toEmailArray[i])){$("#to").parent().append('<p class="error">Please check the email address(es)</p>');hasError=true;break}i++}}}if(fromEmail==""){$("#from").parent().append('<p class="error">Please add your email address.</p>');hasError=true}else{if(!PBS.utils.isEmail(fromEmail)){$("#from").parent().append('<p class="error">Your email address is not valid.</p>');hasError=true}}if(message==""){$("#message").parent().append('<p class="error">Please enter a message.</p>');hasError=true}if(captcha_status=="on"){var response=$("#recaptcha_response_field").val();var challenge=$("#recaptcha_challenge_field").val();var requestUrl="http://localhost/pbsorg/pbsorg_svn/pbs_media/templates/php/recaptcha-ajax.php";var data="challenge="+challenge+"&response="+response;$.ajax({type:"POST",url:requestUrl,data:data,contentType:"application/x-www-form-urlencoded",async:false,dataType:"json",error:function(){hasError=true;redrawCaptcha()},success:function(data,textStatus){if(data==""){hasError=true;$("fieldset.recaptcha").append('<p class="error" id="recaptcha-error">reCaptcha failed, please try again.</p>')}else{var dataObj=eval(data);if(!dataObj.is_valid){$("fieldset.recaptcha").append('<p class="error" id="recaptcha-error">reCaptcha failed, please try again.</p>')}hasError=(dataObj.is_valid)?true:hasError}},complete:function(XMLHttpRequest,dataStatus){redrawCaptcha()}});return false}else{if(hasError){return false}else{return true}}});$("#explore_topics_menu_item").click(function(){return false});$("#custom_popup_close").live("click",function(){$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})});first_time=false});$("#custom_popup_dont_show").live("click",function(){$("#popup-overlay").fadeOut(200,function(){$("#pbs-main-overlay").fadeOut(500,function(){$("#popup-overlay").remove()})});$.ajax({url:site_url+"pbs-ajax/custom_popup/?write_cookie=True",success:function(data){}})});if(first_time=="True"){handleAjaxPopups("first-time-container",site_url+"pbs-ajax/first_time/",480,510,true)}if(stations_replace=="True"){handleAjaxPopups("stations-replace-container",site_url+"pbs-ajax/stations_replace/",480,510,true)}if(user_agent_key=="ipad"){handleAjaxPopups("ipad-detected-container",site_url+"pbs-ajax/custom_popup/",480,510,true)}if(user_agent_key=="ipod"||user_agent_key=="iphone"){handleAjaxPopups("ios-detected-container",site_url+"pbs-ajax/custom_popup/",480,510,true)}if($("#div_programs_list").text()!=""){var list_items=$("#div_programs_list").find("li");for(var i=0;i<list_items.length;i++){var item=$(list_items[i]);var text=item.html();item.html("<h4>"+text+"</h4>")}}$(".menu_item").click(function(){var el=$(this);var par=$(el).parent();var sel=$(".menu_item_selector");var parent=$("#parent").attr("value");var curent=$("#curent").attr("value");var current_tab=$(this).attr("title");var display_container_id="topic_content_"+current_tab;var topics_url="topics/filter/";if(parent!=""){topics_url+=parent+"/"}topics_url+=curent+"/"+current_tab+"/";$(".menu_item").removeClass("menu_item_selected");$(el).addClass("menu_item_selected");$(sel).css({"margin-left":33+$(el)[0].offsetLeft});$(".topic_content_holder").addClass("hidden_topic");$("#"+display_container_id).removeClass("hidden_topic");var tab_has_content=$("#"+display_container_id).html();if(tab_has_content.length<1){$("#filter_topics").bind("ajaxSend",function(){$(".filter_loader_wraper").show()}).bind("ajaxComplete",function(){$(".filter_loader_wraper").hide()});$.ajax({url:site_url+topics_url,success:function(data){$("#"+display_container_id).append(data)}})}return false})});function topics_paging(e,a){for(var c=0;c<e.length;c++){var d=$(e[c]);d.css({opacity:0,display:"none"});a.append(d);a.children("div:last").animate({opacity:1,height:"toggle"},500,"linear")}}function topics_filter(e,a){a.html("");for(var c=0;c<e.length;c++){var d=$(e[c]);d.css({opacity:0,display:"none"});a.append(d);a.children("div:last").animate({opacity:1,height:"toggle"},500,"linear")}}function show_more_objects(d,e){var g=$("#curent").val();var c=$("#parent").val();var f=$(d).attr("page");var a="pbs-ajax/topic_content_ajax/?page="+f;if(c!=""){a+="&parent="+c}a+="&current_topic="+g+"&tab="+e;$.ajax({url:site_url+a,dataType:"json",beforeSend:function(){$("#show_more_topics_"+e).show();$("#topics_more_href_"+e).html("")},success:function(j){var h=j.show_next;if(!h){$(".topics_more_wraper").hide()}else{$("#show_more_topics_"+e).hide();$("#topics_more_"+e).attr("page",1+parseInt(f));$("#topics_more_href_"+e).html("more")}topics_paging(j.alfa,$("#topics_alpha_"+e));topics_paging(j.omega,$("#topics_omega_"+e))}});return false};
