var xhr;$(document).ready(function(){var currentForm;var currentChannelInput;var currentKeywordInput;var currentNameInput;var currentYearInput;var currentGenreInput;var currentAlphabetInput;$("#n-programs, #nav_sub_programs, #n-about, #nav_sub_about, #n-news, #nav_sub_news").removeAttr("href");if($(".tabs").length!=0){tabs()}if($("#search_form").length!=0){$("#form-both").find("form").submit(function(e){e.preventDefault()});setUpSearch();loading()}if($(".credit").length!=0){dyadCredit()}noClick();navMenu();if($("#accordian").length!=0){doAccordian()}if($("#pg_home").length>0){var form=$("#middle #form-holder");var group=$("#middle .group");var link=$("section#find-a-recipient a#find-btn");var closeLink=$("section#find-a-recipient a#close-btn");var linksBG=$("section#find-a-recipient section#links");form.find("#tab-writers a").click();closeLink.fadeOut(0);form.slideUp(0);link.click(function(){form.slideDown(1000);$("#middle .group").stop(true,false).fadeTo(1000,0.3);closeLink.stop(true,false).fadeIn(300);$("#tanbkgd").fadeIn(500);link.animate({"border-color":"#ffffff"},500);return false});closeLink.click(function(){form.slideUp(1000);closeLink.stop(true,false).fadeOut(300);$("#middle .group").stop(true,false).fadeTo(1000,1);$("#tanbkgd").fadeOut(500);link.animate({"border-color":"#9e9e9e"},500);return false})}var captions=$("#middle #banner .caption");if(captions.length>0){$(captions).parent().hover(function(){$(this).find(".caption").stop(true,true).fadeIn()},function(){$(this).find(".caption").stop(false,true).fadeOut()})}});function noClick(){$(".nolink a").click(function(e){e.preventDefault()})}function doAccordian(){$("#accordian .openlink").click(function(e){e.preventDefault();$(this).parent().parent().find(".hidden").slideUp();$(this).parent().parent().find(".openlink").removeClass("black");$(this).parent().find("div:hidden").slideDown();$(this).addClass("black")})}function navMenu(){$("#n-search").click(function(e){e.preventDefault();showSearch()});if($.browser.msie&&$.browser.version=="7.0"){$(".nav_item_group > a").each(function(i){$(this).attr("href",$(this).parent().find(".subnav_dropdown a").first().attr("href"))});return}$("a#n-programs, a#n-news").siblings("ul.subnav_dropdown").css("width","300px");$(".nav_item_group").each(function(i){if(i<3){$(this).hover(function(){$(".nav_item_group > a").stop(true,false).animate({height:"100px"},500);$(this).children(".subnav_dropdown").stop(true,false).fadeIn(0)},function(){$(".nav_item_group > a").stop(true,false).animate({height:"19px"},500);$(this).children(".subnav_dropdown").stop(true,true).fadeOut(0)})}})}function showSearch(){$("#n-search").addClass("hide").removeClass("show");$("#site_search").toggleClass("hide","show").find("input").focus().select().animate({width:"175px"},200)}function hideSearch(){$("#n-search").addClass("show").removeClass("hide");$("#site_search").toggleClass("hide","show").find("input").unfocus().animate({width:"75px"},200)}function loading(){fadeLoading();if($("#total_result_count:first-child").data("total")>30){$("#loading").fadeIn(200).click(function(e){var lastID=$(".table li:last").data("id");var searchStr=siteURL+"_ajax/index/"+(lastID==""?"0":lastID)+"/";searchStr+=currentChannelInput.val()+"/";searchStr+=currentAlphabetInput.val()==""?"null/":currentAlphabetInput.val()+"/";searchStr+=currentKeywordInput.val()==""?"null/":currentKeywordInput.val()+"/";searchStr+=currentNameInput.val()==""?"null/":currentNameInput.val()+"/";searchStr+=currentYearInput.val()==""?"null/":currentYearInput.val()+"/";searchStr+=currentGenreInput.val()==""?"null/":currentGenreInput.val()+"/";$.ajax({url:searchStr,success:function(str){$(".table").append(str);fadeLoading();noClick()}})})}}function fadeLoading(){if($(".table li:last").data("id")==undefined||$(".table li:last").data("id")>=$("#total_result_count").data("total")){$("#loading").stop(true,true).fadeOut(200)}else{$("#loading").stop(true,true).fadeIn(200)}}function dyadCredit(){$("a.credit").hover(function(){$(this).animate({width:"157px",backgroundPosition:"(0 0)"},200)},function(){$(this).animate({width:"12px",backgroundPosition:"(-155px 0)"},200)})}function tabs(){if($("#pg_home").length!=0){$(".tabs li a").each(function(){$(this).click(function(e){e.preventDefault();$(".active").removeClass("active");$(this).parent().addClass("active");var box=$(this).parent().attr("id").replace("tab-","form-");$("#search_form section.show").removeClass("show").addClass("hide");$("#"+box).removeClass("hide").addClass("show");currentForm=$("#"+box+" form");setCurrentInputs(currentForm);currentKeywordInput.val("");currentNameInput.val("");currentYearInput.val("");currentGenreInput.val("");currentAlphabetInput.val(undefined);$(".alphabetical a.cur").removeClass();formSearchString()})})}}function setCurrentInputs(theForm){currentChannelInput=theForm.find(".channel");currentKeywordInput=theForm.find('input[name="keyword"]');currentNameInput=theForm.find('input[name="writers_name"]');currentYearInput=theForm.find('select[name="year"]');currentGenreInput=theForm.find('select[name="genre"]');currentAlphabetInput=theForm.find(".current_letter")}function setUpSearch(){setCurrentInputs($("#search_form section.show form"));$('input[name="writers_name"]').keyup(formSearchString);$('input[name="keyword"]').keyup(formSearchString);$('select[name="year"]').change(formSearchString);$('select[name="genre"]').change(formSearchString);$(".alphabetical a").each(function(){$(this).click(function(e){if($(this).hasClass("cur")){$(this).removeClass("cur");currentAlphabetInput.val(undefined)}else{$(".alphabetical a.cur").removeClass();$(this).addClass("cur");currentAlphabetInput.val($(this).attr("href"))}formSearchString();e.preventDefault()})});formSearchString()}function formSearchString(){var searchStr=siteURL+"_ajax/index/0/";searchStr+=currentChannelInput.val()+"/";searchStr+=currentAlphabetInput.val()==""?"null/":currentAlphabetInput.val()+"/";searchStr+=currentKeywordInput.val()==""?"null/":currentKeywordInput.val()+"/";searchStr+=currentNameInput.val()==""?"null/":currentNameInput.val()+"/";searchStr+=currentYearInput.val()==""?"null/":currentYearInput.val()+"/";searchStr+=currentGenreInput.val()==""?"null/":currentGenreInput.val()+"/";makeAjaxCall(searchStr)}function makeAjaxCall(searchURL){if(xhr){xhr.abort()}xhr=$.ajax({url:searchURL,success:function(str){$(".table").empty().append(str);fadeLoading();noClick()}})}function placeholders(){$("input:not(.submit, #submit,:hidden,:radio,:checkbox,:checked,:submit)").each(function(){if(!elementSupportAttr("input","placeholder")){$(this).val($(this).attr("placeholder")).addClass("placeholder");$(this).focus(function(){if($(this).val()==""||$(this).val()==$(this).attr("placeholder")){$(this).val("").removeClass("placeholder")}}).blur(function(){if($(this).val()==$(this).attr("placeholder")||$(this).val()==""){$(this).val($(this).attr("placeholder")).addClass("placeholder")}})}})}function elementSupportAttr(ele,attr){var check=document.createElement(ele);if(attr in check){return true}else{return false}}(function($){var ver="Lite-1.3";$.fn.cycle=function(options){return this.each(function(){options=options||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){return}var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});var meta=$.isFunction($cont.data)?$cont.data(opts.metaAttr):null;if(meta){opts=$.extend(opts,meta)}opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0});var cls=this.className;opts.width=parseInt((cls.match(/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(/t:(\d+)/)||[])[1])||opts.timeout;if($cont.css("position")=="static"){$cont.css("position","relative")}if(opts.width){$cont.width(opts.width)}if(opts.height&&opts.height!="auto"){$cont.height(opts.height)}var first=0;$slides.css({position:"absolute",top:0,left:0}).each(function(i){$(this).css("z-index",els.length-i)});$(els[first]).css("opacity",1).show();if($.browser.msie){els[first].style.removeAttribute("filter")}if(opts.fit&&opts.width){$slides.width(opts.width)}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height)}if(opts.pause){$cont.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}var txFn=$.fn.cycle.transitions[opts.fx];txFn&&txFn($cont,$slides,opts);$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width()});if(opts.cssFirst){$($slides[first]).css(opts.cssFirst)}if(opts.timeout){if(opts.speed.constructor==String){opts.speed={slow:600,fast:200}[opts.speed]||400}if(!opts.sync){opts.speed=opts.speed/2}while((opts.timeout-opts.speed)<250){opts.timeout+=opts.speed}}opts.speedIn=opts.speed;opts.speedOut=opts.speed;opts.slideCount=els.length;opts.currSlide=first;opts.nextSlide=1;var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true])}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true])}if(opts.click&&!opts.next){opts.next=opts.click}if(opts.next){$(opts.next).bind("click",function(){return advance(els,opts,opts.rev?-1:1)})}if(opts.prev){$(opts.prev).bind("click",function(){return advance(els,opts,opts.rev?1:-1)})}if(opts.timeout){this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout+(opts.delay||0))}})};function go(els,opts,manual,fwd){if(opts.busy){return}var p=els[0].parentNode,curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleTimeout===0&&!manual){return}if(manual||!p.cyclePause){if(opts.before.length){$.each(opts.before,function(i,o){o.apply(next,[curr,next,opts,fwd])})}var after=function(){if($.browser.msie){this.style.removeAttribute("filter")}$.each(opts.after,function(i,o){o.apply(next,[curr,next,opts,fwd])})};if(opts.nextSlide!=opts.currSlide){opts.busy=1;$.fn.cycle.custom(curr,next,opts,after)}var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1}if(opts.timeout){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev)},opts.timeout)}}function advance(els,opts,val){var p=els[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0}opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){opts.nextSlide=els.length-1}else{if(opts.nextSlide>=els.length){opts.nextSlide=0}}go(els,opts,1,val>=0);return false}$.fn.cycle.custom=function(curr,next,opts,cb){var $l=$(curr),$n=$(next);$n.css(opts.cssBefore);var fn=function(){$n.animate(opts.animIn,opts.speedIn,opts.easeIn,cb)};$l.animate(opts.animOut,opts.speedOut,opts.easeOut,function(){$l.css(opts.cssAfter);if(!opts.sync){fn()}});if(opts.sync){fn()}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq(0)").hide();opts.cssBefore={opacity:0,display:"block"};opts.cssAfter={display:"none"};opts.animOut={opacity:0};opts.animIn={opacity:1}},fadeout:function($cont,$slides,opts){opts.before.push(function(curr,next,opts,fwd){$(curr).css("zIndex",opts.slideCount+(fwd===true?1:0));$(next).css("zIndex",opts.slideCount+(fwd===true?0:1))});$slides.not(":eq(0)").hide();opts.cssBefore={opacity:1,display:"block",zIndex:1};opts.cssAfter={display:"none",zIndex:0};opts.animOut={opacity:0}}};$.fn.cycle.ver=function(){return ver};$.fn.cycle.defaults={animIn:{},animOut:{},fx:"fade",after:null,before:null,cssBefore:{},cssAfter:{},delay:0,fit:0,height:"auto",metaAttr:"cycle",next:null,pause:0,prev:null,speed:1000,slideExpr:null,sync:1,timeout:6000}})(jQuery);(function($){$.extend($.fx.step,{backgroundPosition:function(fx){if(fx.state===0&&typeof fx.end=="string"){var start=$.curCSS(fx.elem,"backgroundPosition");start=toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.end);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]]}var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+" "+nowPosX[1];function toArray(strg){strg=strg.replace(/left|top/g,"0px");strg=strg.replace(/right|bottom/g,"100%");strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]}}})})(jQuery);$.fn.spin=function(opts){this.each(function(){var $this=$(this),data=$this.data();if(data.spinner){data.spinner.stop();delete data.spinner}if(opts!==false){data.spinner=new Spinner($.extend({color:$this.css("color")},opts)).spin(this)}});return this};(function(d){function i(){var b=d("script:first"),a=b.css("color"),c=false;if(/^rgba/.test(a)){c=true}else{try{c=a!=b.css("color","rgba(0, 0, 0, 0.5)").css("color");b.css("color",a)}catch(e){}}return c}function g(b,a,c){var e="rgb"+(d.support.rgba?"a":"")+"("+parseInt(b[0]+c*(a[0]-b[0]),10)+","+parseInt(b[1]+c*(a[1]-b[1]),10)+","+parseInt(b[2]+c*(a[2]-b[2]),10);if(d.support.rgba){e+=","+(b&&a?parseFloat(b[3]+c*(a[3]-b[3])):1)}e+=")";return e}function f(b){var a,c;if(a=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(b)){c=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1]}else{if(a=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(b)){c=[parseInt(a[1],16)*17,parseInt(a[2],16)*17,parseInt(a[3],16)*17,1]}else{if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b)){c=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),1]}else{if(a=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(b)){c=[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])]}}}}return c}d.extend(true,d,{support:{rgba:i()}});var h=["color","backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","outlineColor"];d.each(h,function(b,a){d.fx.step[a]=function(c){if(!c.init){c.a=f(d(c.elem).css(a));c.end=f(c.end);c.init=true}c.elem.style[a]=g(c.a,c.end,c.pos)}});d.fx.step.borderColor=function(b){if(!b.init){b.end=f(b.end)}var a=h.slice(2,6);d.each(a,function(c,e){b.init||(b[e]={a:f(d(b.elem).css(e))});b.elem.style[e]=g(b[e].a,b.end,b.pos)});b.init=true}})(jQuery);(function(a,b,c){function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent){b.x+=a.offsetLeft,b.y+=a.offsetTop}return b}function m(a,b){for(var d in b){a[d]===c&&(a[d]=b[d])}return a}function l(a,b){for(var c in b){a.style[k(a,c)||c]=b[c]}return a}function k(a,b){var e=a.style,f,g;if(e[b]!==c){return b}b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c){return f}}}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=0.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";e[g]||(i.insertRule("@"+l+"keyframes "+g+"{0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+0.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}100%{opacity:"+j+"}}",0),e[g]=1);return g}function h(a,b,c){c&&!c.parentNode&&h(a,c),a.insertBefore(b,c||null);return a}function g(a,c){var d=b.createElement(a||"div"),e;for(e in c){d[e]=c[e]}return d}var d=["webkit","Moz","ms","O"],e={},f;h(b.getElementsByTagName("head")[0],g("style"));var i=b.styleSheets[b.styleSheets.length-1],o=function(a){this.opts=m(a||{},{lines:12,length:7,width:5,radius:10,color:"#000",speed:1,trail:100,opacity:0.25})},p=o.prototype={spin:function(a){var b=this,c=b.el=l(g(),{position:"relative"}),d,e;a&&(e=n(h(a,c,a.firstChild)),d=n(c),l(c,{left:(a.offsetWidth>>1)-d.x+e.x+"px",top:(a.offsetHeight>>1)-d.y+e.y+"px"})),b.lines(c,b.opts);if(!f){var i=b.opts,j=0,k=20/i.speed,m=(1-i.opacity)/(k*i.trail/100),o=k/i.lines;(function p(){j++;for(var a=i.lines;a;a--){var d=Math.max(1-(j+a*o)%k*m,i.opacity);b.opacity(c,i.lines-a,d,i)}b.timeout=b.el&&setTimeout(p,50)})()}return b},stop:function(){var a=this,b=a.el;clearTimeout(a.timeout),b&&b.parentNode&&b.parentNode.removeChild(b),a.el=c;return a}};p.lines=function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c)+"deg) translate("+b.radius+"px,0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++){d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:"translate3d(0,0,0)",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")))}return a},p.opacity=function(a,b,c){a.childNodes[b].style.opacity=c},function(){var a=l(g("group"),{behavior:"url(#default#VML)"}),b;if(!k(a,"transform")&&a.adj){for(b=4;b--;){i.addRule(["group","roundrect","fill","stroke"][b],"behavior:url(#default#VML)")}p.lines=function(a,b){function k(a,d,i){h(f,h(l(e(),{rotation:360/b.lines*a+"deg",left:~~d}),h(l(g("roundrect",{arcsize:1}),{width:c,height:b.width,left:b.radius,top:-b.width>>1,filter:i}),g("fill",{color:b.color,opacity:b.opacity}),g("stroke",{opacity:0}))))}function e(){return l(g("group",{coordsize:d+" "+d,coordorigin:-c+" "+-c}),{width:d,height:d})}var c=b.length+b.width,d=2*c,f=e(),i=~(b.length+b.radius+b.width)+"px",j;if(b.shadow){for(j=1;j<=b.lines;j++){k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)")}}for(j=1;j<=b.lines;j++){k(j)}return h(l(a,{margin:i+" 0 0 "+i}),f)},p.opacity=function(a,b,c,d){d=d.shadow&&d.lines||0,a.firstChild.childNodes[b+d].firstChild.firstChild.opacity=c}}else{f=k(a,"animation")}}(),a.Spinner=o})(window,document);
