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,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e;}if((h/=k)==1){return e+l;}if(!j){j=k*0.3;}if(g<Math.abs(l)){g=l;var i=j/4;}else{var i=j/(2*Math.PI)*Math.asin(l/g);}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e;},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e;}if((h/=k)==1){return e+l;}if(!j){j=k*0.3;}if(g<Math.abs(l)){g=l;var i=j/4;}else{var i=j/(2*Math.PI)*Math.asin(l/g);}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e;},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e;}if((h/=k/2)==2){return e+l;}if(!j){j=k*(0.3*1.5);}if(g<Math.abs(l)){g=l;var i=j/4;}else{var i=j/(2*Math.PI)*Math.asin(l/g);}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e;}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e;},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158;}return i*(f/=h)*f*((g+1)*f-g)+a;},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158;}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a;},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158;}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a;}return i/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;}});(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e;};c.formatMatch=c.formatMatch||c.formatItem;return this.each(function(){new a.Autocompleter(this,c);});},result:function(b){return this.bind("result",b);},search:function(b){return this.trigger("search",[b]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(b){return this.trigger("setOptions",[b]);},unautocomplete:function(){return this.trigger("unautocomplete");}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var x={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,x);var w;a.browser.opera&&a(l.form).bind("submit.autocomplete",function(){if(w){w=false;return false;}});b.bind((a.browser.opera?"keypress":"keydown")+".autocomplete",function(y){e=1;u=y.keyCode;switch(y.keyCode){case c.UP:y.preventDefault();if(r.visible()){r.prev();}else{t(0,true);}break;case c.DOWN:y.preventDefault();if(r.visible()){r.next();}else{t(0,true);}break;case c.PAGEUP:y.preventDefault();if(r.visible()){r.pageUp();}else{t(0,true);}break;case c.PAGEDOWN:y.preventDefault();if(r.visible()){r.pageDown();}else{t(0,true);}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){y.preventDefault();w=true;return false;}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break;}}).focus(function(){e++;}).blur(function(){e=0;if(!x.mouseDownOnSelect){s();}}).click(function(){if(e++>1&&!r.visible()){t(0,true);}}).bind("search",function(){var y=(arguments.length>1)?arguments[1]:null;function z(D,C){var A;if(C&&C.length){for(var B=0;B<C.length;B++){if(C[B].result.toLowerCase()==D.toLowerCase()){A=C[B];break;}}}if(typeof y=="function"){y(A);}else{b.trigger("result",A&&[A.data,A.value]);}}a.each(h(b.val()),function(A,B){f(B,z,z);});}).bind("flushCache",function(){m.flush();}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate();}}).bind("unautocomplete",function(){r.unbind();b.unbind();a(l.form).unbind(".autocomplete");});function d(){var B=r.selected();if(!B){return false;}var y=B.result;p=y;if(g.multiple){var E=h(b.val());if(E.length>1){var A=g.multipleSeparator.length;var D=a(l).selection().start;var C,z=0;a.each(E,function(F,G){z+=G.length;if(D<=z){C=F;return false;}z+=A;});E[C]=y;y=E.join(g.multipleSeparator);}y+=g.multipleSeparator;}b.val(y);v();b.trigger("result",[B.data,B.value]);return true;}function t(A,z){if(u==c.DEL){r.hide();return;}var y=b.val();if(!z&&y==p){return;}p=y;y=i(y);if(y.length>=g.minChars){b.addClass(g.loadingClass);if(!g.matchCase){y=y.toLowerCase();}f(y,k,v);}else{n();r.hide();}}function h(y){if(!y){return[""];}if(!g.multiple){return[a.trim(y)];}return a.map(y.split(g.multipleSeparator),function(z){return a.trim(y).length?a.trim(z):null;});}function i(y){if(!g.multiple){return y;}var A=h(y);if(A.length==1){return A[0];}var z=a(l).selection().start;if(z==y.length){A=h(y);}else{A=h(y.replace(y.substring(z),""));}return A[A.length-1];}function q(y,z){if(g.autoFill&&(i(b.val()).toLowerCase()==y.toLowerCase())&&u!=c.BACKSPACE){b.val(b.val()+z.substring(i(p).length));a(l).selection(p.length,p.length+z.length);}}function s(){clearTimeout(j);j=setTimeout(v,200);}function v(){var y=r.visible();r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(z){if(!z){if(g.multiple){var A=h(b.val()).slice(0,-1);b.val(A.join(g.multipleSeparator)+(A.length?g.multipleSeparator:""));}else{b.val("");b.trigger("result",null);}}});}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);q(z,y[0].value);r.show();}else{v();}}function f(z,B,y){if(!g.matchCase){z=z.toLowerCase();}var A=m.load(z);if(A&&A.length){B(z,A);}else{if((typeof g.url=="string")&&(g.url.length>0)){var C={timestamp:+new Date()};a.each(g.extraParams,function(D,E){C[D]=typeof E=="function"?E():E;});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(z),limit:g.max},C),success:function(E){var D=g.parse&&g.parse(E)||o(E);m.add(z,D);B(z,D);}});}else{r.emptyList();y(z);}}}function o(B){var y=[];var A=B.split("\n");for(var z=0;z<A.length;z++){var C=a.trim(A[z]);if(C){C=C.split("|");y[y.length]={data:C,value:C[0],result:g.formatResult&&g.formatResult(C,C[0])||C[0]};}}return y;}function n(){b.removeClass(g.loadingClass);}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase();}var j=l.indexOf(k);if(c.matchContains=="word"){j=l.toLowerCase().search("\\b"+k.toLowerCase());}if(j==-1){return false;}return j==0||c.matchContains;}function g(j,i){if(d>c.cacheLength){b();}if(!f[j]){d++;}f[j]=i;}function e(){if(!c.data){return false;}var k={},j=0;if(!c.url){c.cacheLength=1;}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatMatch(p,m+1,c.data.length);if(o===false){continue;}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[];}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q);}}a.each(k,function(r,s){c.cacheLength++;g(r,s);});}setTimeout(e,25);function b(){f={};d=0;}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null;}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k);}});}}return m;}else{if(f[n]){return f[n];}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k;}});return m;}}}}}return null;}};};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return;}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(document.body);o=a("<ul/>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE);}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false;}).mousedown(function(){p.mouseDownOnSelect=true;}).mouseup(function(){p.mouseDownOnSelect=false;});if(e.width>0){c.css("width",e.width);}s=false;}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode;}if(!t){return[];}return t;}function h(t){k.slice(f,f+1).removeClass(i.ACTIVE);g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight;});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight());}else{if(u<o.scrollTop()){o.scrollTop(u);}}}}function g(t){f+=t;if(f<0){f=k.size()-1;}else{if(f>=k.size()){f=0;}}}function b(t){return e.max&&e.max<t?e.max:t;}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue;}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue;}var t=a("<li/>").html(e.highlight(w,m)).addClass(v%2==0?"ac_even":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v]);}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0;}if(a.fn.bgiframe){o.bgiframe();}}return{display:function(u,t){n();r=u;m=t;d();},next:function(){h(1);},prev:function(){h(-1);},pageUp:function(){if(f!=0&&f-8<0){h(-f);}else{h(-8);}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f);}else{h(8);}},hide:function(){c&&c.hide();k&&k.removeClass(i.ACTIVE);f=-1;},visible:function(){return c&&c.is(":visible");},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0]);},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight;});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")));}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data");},emptyList:function(){o&&o.empty();},unbind:function(){c&&c.remove();}};};a.fn.selection=function(i,b){if(i!==undefined){return this.each(function(){if(this.createTextRange){var j=this.createTextRange();if(b===undefined||i==b){j.move("character",i);j.select();}else{j.collapse(true);j.moveStart("character",i);j.moveEnd("character",b);j.select();}}else{if(this.setSelectionRange){this.setSelectionRange(i,b);}else{if(this.selectionStart){this.selectionStart=i;this.selectionEnd=b;}}}});}var g=this[0];if(g.createTextRange){var c=document.selection.createRange(),h=g.value,f="<->",d=c.text.length;c.text=f;var e=g.value.indexOf(f);g.value=h;this.selection(e,e+d);return{start:e,end:e+d};}else{if(g.selectionStart!==undefined){return{start:g.selectionStart,end:g.selectionEnd};}}};})(jQuery);(function($){$.fn.carouFredSel=function(o){if(this.length===0){return log("No element selected.");}if(this.length>1){return this.each(function(){$(this).carouFredSel(o);});}this.init=function(o){if(typeof o!=="object"){o={};}if(typeof o.scroll==="number"){if(o.scroll<=50){o.scroll={items:o.scroll};}else{o.scroll={duration:o.scroll};}}else{if(typeof o.scroll==="string"){o.scroll={easing:o.scroll};}}if(typeof o.items==="number"){o.items={visible:o.items};}else{if(typeof o.items==="string"){o.items={visible:o.items,width:o.items,height:o.items};}}opts=$.extend(true,{},$.fn.carouFredSel.defaults,o);opts.padding=getPadding(opts.padding);opts.usePadding=(opts.padding[0]===0&&opts.padding[1]===0&&opts.padding[2]===0&&opts.padding[3]===0)?false:true;direction=(opts.direction==="up"||opts.direction==="left")?"next":"prev";if(opts.direction==="right"||opts.direction==="left"){opts.dimentions=["width","outerWidth","height","outerHeight","left","top","marginRight","innerWidth"];}else{opts.dimentions=["height","outerHeight","width","outerWidth","top","left","marginBottom","innerHeight"];opts.padding=[opts.padding[3],opts.padding[2],opts.padding[1],opts.padding[0]];}if(!opts.items.width){opts.items.width=getItems($cfs).outerWidth(true);}if(!opts.items.height){opts.items.height=getItems($cfs).outerHeight(true);}if(opts.items.visible==="variable"){if(typeof opts[opts.dimentions[0]]==="number"){opts.maxDimention=opts[opts.dimentions[0]];opts[opts.dimentions[0]]=null;}else{opts.maxDimention=$wrp.parent()[opts.dimentions[7]]();}if(opts.items[opts.dimentions[0]]==="variable"){varnumvisitem=true;opts.items.visible=0;}else{opts.items.visible=Math.floor(opts.maxDimention/opts.items[opts.dimentions[0]]);}}if(typeof opts.items.minimum!=="number"){opts.items.minimum=opts.items.visible;}if(typeof opts.scroll.items!=="number"){opts.scroll.items=opts.items.visible;}if(typeof opts.scroll.duration!=="number"){opts.scroll.duration=500;}opts.auto=getNaviObject(opts.auto,false,true);opts.prev=getNaviObject(opts.prev);opts.next=getNaviObject(opts.next);opts.pagination=getNaviObject(opts.pagination,true);opts.auto=$.extend({},opts.scroll,opts.auto);opts.prev=$.extend({},opts.scroll,opts.prev);opts.next=$.extend({},opts.scroll,opts.next);opts.pagination=$.extend({},opts.scroll,opts.pagination);if(typeof opts.pagination.keys!=="boolean"){opts.pagination.keys=false;}if(typeof opts.pagination.anchorBuilder!=="function"){opts.pagination.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder;}if(typeof opts.auto.play!=="boolean"){opts.auto.play=true;}if(typeof opts.auto.nap!=="boolean"){opts.auto.nap=true;}if(typeof opts.auto.delay!=="number"){opts.auto.delay=0;}if(typeof opts.auto.pauseDuration!=="number"){opts.auto.pauseDuration=(opts.auto.duration<10)?2500:opts.auto.duration*5;}};this.build=function(){$wrp.css({position:"relative",overflow:"hidden"});$cfs.data("cfs_origCss",{width:$cfs.css("width"),height:$cfs.css("height"),position:$cfs.css("position"),top:$cfs.css("top"),left:$cfs.css("left")}).css({position:"absolute"});if(opts.usePadding){getItems($cfs).each(function(){var m=parseInt($(this).css(opts.dimentions[6]),10);if(isNaN(m)){m=0;}$(this).data("cfs_origCssMargin",m);});}showNavi(opts,totalItems);};this.bind_events=function(){$cfs.bind("pause",function(e,g){if(typeof g!=="boolean"){g=false;}if(g){pausedGlobal=true;}if(autoTimeout!==null){clearTimeout(autoTimeout);}if(autoInterval!==null){clearInterval(autoInterval);}});$cfs.bind("play",function(e,d,f,g){$cfs.trigger("pause");if(opts.auto.play){if(typeof g!=="boolean"){if(typeof f==="boolean"){g=f;}else{if(typeof d==="boolean"){g=d;}else{g=false;}}}if(typeof f!=="number"){if(typeof d==="number"){f=d;}else{f=0;}}if(d!=="prev"&&d!=="next"){d=direction;}if(g){pausedGlobal=false;}if(pausedGlobal){return;}autoTimeout=setTimeout(function(){if($cfs.is(":animated")){$cfs.trigger("play",d);}else{pauseTimePassed=0;$cfs.trigger(d,opts.auto);}},opts.auto.pauseDuration+f-pauseTimePassed);if(opts.auto.pauseOnHover==="resume"){autoInterval=setInterval(function(){pauseTimePassed+=100;},100);}}});if(varnumvisitem){$cfs.bind("prev",function(e,sO,nI){if($cfs.is(":animated")){return false;}var items=getItems($cfs),total=0,x=0;if(typeof sO==="number"){nI=sO;}if(typeof nI!=="number"){for(var a=items.length-1;a>=0;a--){current=items.filter(":eq("+a+")")[opts.dimentions[1]](true);if(total+current>opts.maxDimention){break;}total+=current;x++;}nI=x;}for(var a=items.length-nI;a<items.length;a++){current=items.filter(":eq("+a+")")[opts.dimentions[1]](true);if(total+current>opts.maxDimention){break;}total+=current;if(a===items.length-1){a=0;}x++;}opts.items.visible=x;$cfs.trigger("scrollPrev",[sO,nI]);});$cfs.bind("next",function(e,sO,nI){if($cfs.is(":animated")){return false;}var items=getItems($cfs),total=0,x=0;if(typeof sO==="number"){nI=sO;}if(typeof nI!=="number"){nI=opts.items.visible;}for(var a=nI;a<items.length;a++){current=items.filter(":eq("+a+")")[opts.dimentions[1]](true);if(total+current>opts.maxDimention){break;}total+=current;if(a===items.length-1){a=0;}x++;}opts.items.visible=x;$cfs.trigger("scrollNext",[sO,nI]);}).trigger("next",{duration:0});}else{$cfs.bind("prev",function(e,sO,nI){$cfs.trigger("scrollPrev",[sO,nI]);});$cfs.bind("next",function(e,sO,nI){$cfs.trigger("scrollNext",[sO,nI]);});}$cfs.bind("scrollPrev",function(e,sO,nI){if($cfs.is(":animated")){return false;}if(opts.items.minimum>=totalItems){return log("Not enough items: not scrolling");}if(typeof sO==="number"){nI=sO;}if(typeof sO!=="object"){sO=opts.prev;}if(typeof nI!=="number"){nI=sO.items;}if(typeof nI!=="number"){return log("Not a valid number: not scrolling");}if(!opts.circular){var nulItem=totalItems-firstItem;if(nulItem-nI<0){nI=nulItem;}if(firstItem===0){nI=0;}}firstItem+=nI;if(firstItem>=totalItems){firstItem-=totalItems;}if(!opts.circular){if(firstItem===0&&nI!==0&&opts.prev.onEnd){opts.prev.onEnd();}if(opts.infinite){if(nI===0){$cfs.trigger("next",totalItems-opts.items.visible);return false;}}else{if(firstItem===0&&opts.prev.button){opts.prev.button.addClass("disabled");}if(opts.next.button){opts.next.button.removeClass("disabled");}}}if(nI===0){return false;}getItems($cfs,":gt("+(totalItems-nI-1)+")").prependTo($cfs);if(totalItems<opts.items.visible+nI){getItems($cfs,":lt("+((opts.items.visible+nI)-totalItems)+")").clone(true).appendTo($cfs);}var c_itm=getCurrentItems($cfs,opts,nI),l_cur=getItems($cfs,":nth("+(nI-1)+")"),l_old=c_itm[1].filter(":last"),l_new=c_itm[0].filter(":last");if(opts.usePadding){l_old.css(opts.dimentions[6],l_old.data("cfs_origCssMargin"));}var i_siz=getSizes(opts,getItems($cfs,":lt("+nI+")")),w_siz=mapWrapperSizes(getSizes(opts,c_itm[0],true),opts);if(opts.usePadding){l_old.css(opts.dimentions[6],l_old.data("cfs_origCssMargin")+opts.padding[1]);}var a_cfs={},a_new={},a_cur={},a_dur=sO.duration;if(a_dur==="auto"){a_dur=opts.scroll.duration/opts.scroll.items*nI;}else{if(a_dur<=0){a_dur=0;}else{if(a_dur<10){a_dur=i_siz[0]/a_dur;}}}if(sO.onBefore){sO.onBefore(c_itm[1],c_itm[0],w_siz,a_dur);}if(opts.usePadding){var new_m=opts.padding[3];a_cur[opts.dimentions[6]]=l_cur.data("cfs_origCssMargin");a_new[opts.dimentions[6]]=l_new.data("cfs_origCssMargin")+opts.padding[1];l_cur.css(opts.dimentions[6],l_cur.data("cfs_origCssMargin")+opts.padding[3]);l_cur.stop().animate(a_cur,{duration:a_dur,easing:sO.easing});l_new.stop().animate(a_new,{duration:a_dur,easing:sO.easing});}else{var new_m=0;}a_cfs[opts.dimentions[4]]=new_m;if((typeof opts[opts.dimentions[0]]!=="number"&&typeof opts.items[opts.dimentions[0]]!=="number")||(typeof opts[opts.dimentions[2]]!=="number"&&typeof opts.items[opts.dimentions[2]]!=="number")){$wrp.stop().animate(w_siz,{duration:a_dur,easing:sO.easing});}$cfs.data("cfs_numItems",nI).data("cfs_slideObj",sO).data("cfs_oldItems",c_itm[1]).data("cfs_newItems",c_itm[0]).data("cfs_wrapSize",w_siz).css(opts.dimentions[4],-i_siz[0]).animate(a_cfs,{duration:a_dur,easing:sO.easing,complete:function(){if($cfs.data("cfs_slideObj").onAfter){$cfs.data("cfs_slideObj").onAfter($cfs.data("cfs_oldItems"),$cfs.data("cfs_newItems"),$cfs.data("cfs_wrapSize"));}if(totalItems<opts.items.visible+$cfs.data("cfs_numItems")){getItems($cfs,":gt("+(totalItems-1)+")").remove();}var l_itm=getItems($cfs,":nth("+(opts.items.visible+$cfs.data("cfs_numItems")-1)+")");if(opts.usePadding){l_itm.css(opts.dimentions[6],l_itm.data("cfs_origCssMargin"));}}});$cfs.trigger("updatePageStatus").trigger("play",a_dur);});$cfs.bind("scrollNext",function(e,sO,nI){if($cfs.is(":animated")){return false;}if(opts.items.minimum>=totalItems){return log("Not enough items: not scrolling");}if(typeof sO==="number"){nI=sO;}if(typeof sO!=="object"){sO=opts.next;}if(typeof nI!=="number"){nI=sO.items;}if(typeof nI!=="number"){return log("Not a valid number: not scrolling");}if(!opts.circular){if(firstItem===0){if(nI>totalItems-opts.items.visible){nI=totalItems-opts.items.visible;}}else{if(firstItem-nI<opts.items.visible){nI=firstItem-opts.items.visible;}}}firstItem-=nI;if(firstItem<0){firstItem+=totalItems;}if(!opts.circular){if(firstItem===opts.items.visible&&nI!==0&&opts.next.onEnd){opts.next.onEnd();}if(opts.infinite){if(nI===0){$cfs.trigger("prev",totalItems-opts.items.visible);return false;}}else{if(firstItem===opts.items.visible&&opts.next.button){opts.next.button.addClass("disabled");}if(opts.prev.button){opts.prev.button.removeClass("disabled");}}}if(nI===0){return false;}if(totalItems<opts.items.visible+nI){getItems($cfs,":lt("+((opts.items.visible+nI)-totalItems)+")").clone(true).appendTo($cfs);}var c_itm=getCurrentItems($cfs,opts,nI),l_cur=getItems($cfs,":nth("+(nI-1)+")"),l_old=c_itm[0].filter(":last"),l_new=c_itm[1].filter(":last");if(opts.usePadding){l_old.css(opts.dimentions[6],l_old.data("cfs_origCssMargin"));l_new.css(opts.dimentions[6],l_new.data("cfs_origCssMargin"));}var i_siz=getSizes(opts,getItems($cfs,":lt("+nI+")")),w_siz=mapWrapperSizes(getSizes(opts,c_itm[1],true),opts);if(opts.usePadding){l_old.css(opts.dimentions[6],l_old.data("cfs_origCssMargin")+opts.padding[1]);l_new.css(opts.dimentions[6],l_new.data("cfs_origCssMargin")+opts.padding[1]);}var a_cfs={},a_old={},a_cur={},a_dur=sO.duration;if(a_dur==="auto"){a_dur=opts.scroll.duration/opts.scroll.items*nI;}else{if(a_dur<=0){a_dur=0;}else{if(a_dur<10){a_dur=i_siz[0]/a_dur;}}}if(sO.onBefore){sO.onBefore(c_itm[0],c_itm[1],w_siz,a_dur);}a_cfs[opts.dimentions[4]]=-i_siz[0];if(opts.usePadding){a_old[opts.dimentions[6]]=l_old.data("cfs_origCssMargin");a_cur[opts.dimentions[6]]=l_cur.data("cfs_origCssMargin")+opts.padding[3];l_new.css(opts.dimentions[6],l_new.data("cfs_origCssMargin")+opts.padding[1]);l_old.stop().animate(a_old,{duration:a_dur,easing:sO.easing});l_cur.stop().animate(a_cur,{duration:a_dur,easing:sO.easing});}if((typeof opts[opts.dimentions[0]]!=="number"&&typeof opts.items[opts.dimentions[0]]!=="number")||(typeof opts[opts.dimentions[2]]!=="number"&&typeof opts.items[opts.dimentions[2]]!=="number")){$wrp.stop().animate(w_siz,{duration:a_dur,easing:sO.easing});}$cfs.data("cfs_numItems",nI).data("cfs_slideObj",sO).data("cfs_oldItems",c_itm[0]).data("cfs_newItems",c_itm[1]).data("cfs_wrapSize",w_siz).animate(a_cfs,{duration:a_dur,easing:sO.easing,complete:function(){if($cfs.data("cfs_slideObj").onAfter){$cfs.data("cfs_slideObj").onAfter($cfs.data("cfs_oldItems"),$cfs.data("cfs_newItems"),$cfs.data("cfs_wrapSize"));}if(totalItems<opts.items.visible+$cfs.data("cfs_numItems")){getItems($cfs,":gt("+(totalItems-1)+")").remove();}var org_m=(opts.usePadding)?opts.padding[3]:0;$cfs.css(opts.dimentions[4],org_m);var l_itm=getItems($cfs,":lt("+$cfs.data("cfs_numItems")+")").appendTo($cfs).filter(":last");if(opts.usePadding){l_itm.css(opts.dimentions[6],l_itm.data("cfs_origCssMargin"));}}});$cfs.trigger("updatePageStatus").trigger("play",a_dur);});$cfs.bind("slideTo",function(e,num,dev,org,obj){if($cfs.is(":animated")){return false;}num=getItemIndex(num,dev,org,firstItem,totalItems,$cfs);if(num===0){return false;}if(typeof obj!=="object"){obj=false;}if(opts.circular){if(num<totalItems/2){$cfs.trigger("next",[obj,num]);}else{$cfs.trigger("prev",[obj,totalItems-num]);}}else{if(firstItem===0||firstItem>num){$cfs.trigger("next",[obj,num]);}else{$cfs.trigger("prev",[obj,totalItems-num]);}}}).bind("insertItem",function(e,itm,num,org,dev){if(typeof itm==="object"&&typeof itm.jquery==="undefined"){itm=$(itm);}if(typeof itm==="string"){itm=$(itm);}if(typeof itm!=="object"||typeof itm.jquery==="undefined"||itm.length===0){return log("Not a valid object.");}if(typeof num==="undefined"||num==="end"){$cfs.append(itm);}else{num=getItemIndex(num,dev,org,firstItem,totalItems,$cfs);var $cit=getItems($cfs,":nth("+num+")");if($cit.length){if(num<=firstItem){firstItem+=itm.length;}$cit.before(itm);}else{$cfs.append(itm);}}totalItems=getItems($cfs).length;link_anchors("",".caroufredsel",$cfs);setSizes($cfs,opts);showNavi(opts,totalItems);$cfs.trigger("updatePageStatus",true);}).bind("removeItem",function(e,num,org,dev){if(typeof num==="undefined"||num==="end"){getItems($cfs,":last").remove();}else{num=getItemIndex(num,dev,org,firstItem,totalItems,$cfs);var $cit=getItems($cfs,":nth("+num+")");if($cit.length){if(num<firstItem){firstItem-=$cit.length;}$cit.remove();}}totalItems=getItems($cfs).length;link_anchors("",".caroufredsel",$cfs);setSizes($cfs,opts);showNavi(opts,totalItems);$cfs.trigger("updatePageStatus",true);}).bind("updatePageStatus",function(e,bpa){if(!opts.pagination.container){return false;}if(typeof bpa==="boolean"&&bpa){getItems(opts.pagination.container).remove();for(var a=0;a<Math.ceil(totalItems/opts.items.visible);a++){opts.pagination.container.append(opts.pagination.anchorBuilder(a+1));}getItems(opts.pagination.container).unbind("click").each(function(a){$(this).click(function(e){e.preventDefault();$cfs.trigger("slideTo",[a*opts.items.visible,0,true,opts.pagination]);});});}var nr=(firstItem===0)?0:Math.round((totalItems-firstItem)/opts.items.visible);getItems(opts.pagination.container).removeClass("selected").filter(":nth("+nr+")").addClass("selected");});};this.bind_buttons=function(){if(opts.auto.pauseOnHover&&opts.auto.play){$wrp.hover(function(){$cfs.trigger("pause");},function(){$cfs.trigger("play");});}if(opts.prev.button){opts.prev.button.click(function(e){$cfs.trigger("prev");e.preventDefault();});if(opts.prev.pauseOnHover&&opts.auto.play){opts.prev.button.hover(function(){$cfs.trigger("pause");},function(){$cfs.trigger("play");});}if(!opts.circular&&!opts.infinite){opts.prev.button.addClass("disabled");}}if($.fn.mousewheel){if(opts.prev.mousewheel){$wrp.mousewheel(function(e,delta){if(delta>0){e.preventDefault();num=(typeof opts.prev.mousewheel==="number")?opts.prev.mousewheel:"";$cfs.trigger("prev",num);}});}if(opts.next.mousewheel){$wrp.mousewheel(function(e,delta){if(delta<0){e.preventDefault();num=(typeof opts.next.mousewheel==="number")?opts.next.mousewheel:"";$cfs.trigger("next",num);}});}}if(opts.next.button){opts.next.button.click(function(e){e.preventDefault();$cfs.trigger("next");});if(opts.next.pauseOnHover&&opts.auto.play){opts.next.button.hover(function(){$cfs.trigger("pause");},function(){$cfs.trigger("play");});}}if(opts.pagination.container){$cfs.trigger("updatePageStatus",true);if(opts.pagination.pauseOnHover&&opts.auto.play){opts.pagination.container.hover(function(){$cfs.trigger("pause");},function(){$cfs.trigger("play");});}}if(opts.next.key||opts.prev.key){$(document).keyup(function(e){var k=e.keyCode;if(k===opts.next.key){e.preventDefault();$cfs.trigger("next");}if(k===opts.prev.key){e.preventDefault();$cfs.trigger("prev");}});}if(opts.pagination.keys){$(document).keyup(function(e){var k=e.keyCode;if(k>=49&&k<58){k=(k-49)*opts.items.visible;if(k<=totalItems){e.preventDefault();$cfs.trigger("slideTo",[k,0,true,opts.pagination]);}}});}if(opts.auto.play){$cfs.trigger("play",opts.auto.delay);if($.fn.nap&&opts.auto.nap){$cfs.nap("pause","play");}}};this.destroy=function(){$cfs.css($cfs.data("cfs_origCss")).unbind("pause").unbind("play").unbind("prev").unbind("next").unbind("scrollTo").unbind("slideTo").unbind("insertItem").unbind("removeItem").unbind("updatePageStatus");$wrp.replaceWith($cfs);return this;};this.configuration=function(a,b){if(typeof a==="undefined"){return opts;}if(typeof b==="undefined"){var r=eval("opts."+a);if(typeof r==="undefined"){r="";}return r;}eval("opts."+a+" = b");this.init(opts);setSizes($cfs,opts);return this;};this.link_anchors=function($c,se){link_anchors($c,se,$cfs);};this.current_position=function(){if(firstItem===0){return 0;}return totalItems-firstItem;};if($(this).parent().is(".caroufredsel_wrapper")){log("Element allready is a carousel!");}else{var $cfs=$(this),$wrp=$(this).wrap('<div class="caroufredsel_wrapper" />').parent(),opts={},totalItems=getItems($cfs).length,firstItem=0,autoTimeout=null,autoInterval=null,pauseTimePassed=0,pausedGlobal=false,direction="next",varnumvisitem=false;this.init(o);this.build();this.bind_events();this.bind_buttons();link_anchors("",".caroufredsel",$cfs);setSizes($cfs,opts);if(opts.items.start!==0&&opts.items.start!==false){var s=opts.items.start;if(opts.items.start===true){s=window.location.hash;if(!s.length){s=0;}}$cfs.trigger("slideTo",[s,0,true,{duration:0}]);}}return this;};$.fn.carouFredSel.defaults={infinite:true,circular:true,direction:"left",padding:0,items:{visible:5,start:0},scroll:{easing:"swing",pauseOnHover:false,mousewheel:false}};$.fn.carouFredSel.pageAnchorBuilder=function(nr){return'<a href="#"><span>'+nr+"</span></a>";};function link_anchors($c,se,$cfs){if(typeof $c==="undefined"||$c.length===0){$c=$("body");}else{if(typeof $c==="string"){$c=$($c);}}if(typeof $c!=="object"){return false;}if(typeof se==="undefined"){se="";}$c.find("a"+se).each(function(){var h=this.hash||"";if(h.length>0&&getItems($cfs).index($(h))!==-1){$(this).unbind("click").click(function(e){e.preventDefault();$cfs.trigger("slideTo",h);});}});}function showNavi(o,t){if(o.items.minimum>=t){log("Not enough items: not scrolling");var f="hide";}else{var f="show";}if(o.prev.button){o.prev.button[f]();}if(o.next.button){o.next.button[f]();}if(o.pagination.container){o.pagination.container[f]();}}function getKeyCode(k){if(k==="right"){return 39;}if(k==="left"){return 37;}if(k==="up"){return 38;}if(k==="down"){return 40;}return -1;}function getNaviObject(obj,pagi,auto){if(typeof pagi!=="boolean"){pagi=false;}if(typeof auto!=="boolean"){auto=false;}if(typeof obj==="undefined"){obj={};}if(typeof obj==="string"){var temp=getKeyCode(obj);if(temp===-1){obj=$(obj);}else{obj=temp;}}if(pagi){if(typeof obj.jquery!=="undefined"){obj={container:obj};}if(typeof Object==="boolean"){obj={keys:obj};}if(typeof obj.container==="string"){obj.container=$(obj.container);}}else{if(auto){if(typeof obj==="boolean"){obj={play:obj};}if(typeof obj==="number"){obj={pauseDuration:obj};}}else{if(typeof obj.jquery!=="undefined"){obj={button:obj};}if(typeof obj==="number"){obj={key:obj};}if(typeof obj.button==="string"){obj.button=$(obj.button);}if(typeof obj.key==="string"){obj.key=getKeyCode(obj.key);}}}return obj;}function getItems(a,f){if(typeof f!=="string"){f="";}return $("> *"+f,a);}function getCurrentItems(c,o,n){var oi=getItems(c,":lt("+o.items.visible+")"),ni=getItems(c,":lt("+(o.items.visible+n)+"):gt("+(n-1)+")");return[oi,ni];}function getItemIndex(num,dev,org,firstItem,totalItems,$cfs){if(typeof num==="string"){if(isNaN(num)){num=$(num);}else{num=parseInt(num,10);}}if(typeof num==="object"){if(typeof num.jquery==="undefined"){num=$(num);}num=getItems($cfs).index(num);if(num===-1){num=0;}if(typeof org!=="boolean"){org=false;}}else{if(typeof org!=="boolean"){org=true;}}if(isNaN(num)){num=0;}else{num=parseInt(num,10);}if(isNaN(dev)){dev=0;}else{dev=parseInt(dev,10);}if(org){num+=firstItem;}num+=dev;if(totalItems>0){while(num>=totalItems){num-=totalItems;}while(num<0){num+=totalItems;}}return num;}function getSizes(o,$i,wrap){if(typeof wrap!=="boolean"){wrap=false;}var di=o.dimentions,s1=0,s2=0;if(wrap&&typeof o[di[0]]==="number"){s1+=o[di[0]];}else{if(typeof o.items[di[0]]==="number"){s1+=o.items[di[0]]*$i.length;}else{$i.each(function(){s1+=$(this)[di[1]](true);});}}if(wrap&&typeof o[di[2]]==="number"){s2+=o[di[2]];}else{if(typeof o.items[di[2]]==="number"){s2+=o.items[di[2]];}else{$i.each(function(){var m=$(this)[di[3]](true);if(s2<m){s2=m;}});}}return[s1,s2];}function mapWrapperSizes(ws,o){var pad=(o.usePadding)?o.padding:[0,0,0,0];var wra={};wra[o.dimentions[0]]=ws[0]+pad[1]+pad[3];wra[o.dimentions[2]]=ws[1]+pad[0]+pad[2];return wra;}function setSizes($c,o){var $w=$c.parent(),$i=getItems($c),$l=$i.filter(":nth("+(o.items.visible-1)+")"),is=getSizes(o,$i);$w.css(mapWrapperSizes(getSizes(o,$i.filter(":lt("+o.items.visible+")"),true),o));if(o.usePadding){$l.css(o.dimentions[6],$l.data("cfs_origCssMargin")+o.padding[1]);$c.css(o.dimentions[5],o.padding[0]);$c.css(o.dimentions[4],o.padding[3]);}$c.css(o.dimentions[0],is[0]*2);$c.css(o.dimentions[2],is[1]);}function getPadding(p){if(typeof p==="number"){p=[p];}else{if(typeof p==="string"){p=p.split("px").join("").split(" ");}}if(typeof p!=="object"){log('Not a valid value, padding set to "0".');p=[0];}for(i in p){p[i]=parseInt(p[i],10);}switch(p.length){case 0:return[0,0,0,0];case 1:return[p[0],p[0],p[0],p[0]];case 2:return[p[0],p[1],p[0],p[1]];case 3:return[p[0],p[1],p[2],p[1]];default:return p;}}function log(m){if(typeof m==="string"){m="carouFredSel: "+m;}if(window.console&&window.console.log){window.console.log(m);}else{try{console.log(m);}catch(err){}}return false;}$.fn.caroufredsel=function(o){this.carouFredSel(o);};}(jQuery));(Newsday.TopCarousel=function(){var d=false;var f={CAROUSEL_CONTAINER_ID:"div#topCarousel",CAROUSEL_PANE:"ul.carousel li"};var h={document:$(document),carouselContainer:null,carouselPane:null,selected:null,historyLoad:false};var a=f;var b=h;var c=function(){$("#topCarousel ul.carousel").carouFredSel({items:{visible:1,width:980},prev:"#topCarousel a.prev",next:"#topCarousel a.next",container:"#topCarousel span.dots",auto:false,pagination:{container:"#topCarousel span.dots"},scroll:{duration:800,onAfter:function(){e();}}});var j=null;$carousel=b.carouselContainer.find("ul.carousel");j=$carousel.children();j.each(function(k){var l=$(this);l.attr("pane",k+1);});};var e=function(){var j=$(".controls span.dots a.selected span");var k=parseInt(j.text(),10);if(!b.historyLoad){carouselLink(k);}else{b.historyLoad=false;}i(k);};var i=function(m){var l,j,k=null;l=b.carouselContainer.find("ul.carousel");j=l.children();j.each(function(){$this=$(this);currentPane=parseInt($this.attr("pane"),10);if(currentPane===m){var n=$this.find("a");n.live("click",function(p){if(p.button!==0){return;}p.preventDefault();var o=$(this).text();Newsday.Global.State.resetHashState();Newsday.Global.State.setHashState("tc",m);Newsday.Global.State.syncHashState();window.location.href=$(this).attr("href");});}});};var g=function(){var j=Newsday.Global.State.getHashState("tc");if(j!==null&&j!==1){b.historyLoad=true;$("ul.carousel").trigger("slideTo",(j-1));}else{j=0;}};return{initialize:function(){b.carouselContainer=b.carouselContainer||$(a.CAROUSEL_CONTAINER_ID);b.carouselPane=b.carouselPane||$(a.CAROUSEL_PANE);if(d||!b.carouselContainer.length){return;}c();g();d=true;}};}());$(document).ready(Newsday.TopCarousel.initialize);(Newsday.Live=function(){var e=false;var f={LIVE_CONTAINER_ID:"#live",LIVE_LEFT_DIV:"div#live div.left",HEADLINE_LIST_CLASS:"div.list",H2_SELECTOR:"h2",TABS_CLASS:"sels"};var h={document:$(document),liveContainer:null,leftDiv:null,headlineList:null,list1:null,list2:null,h2:null,tabs:null,tabLinks:null,activeTab:null,dataCount:null,jlistName:null};var a=f;var b=h;var j=function(){b.headlineList=b.liveContainer.find(a.HEADLINE_LIST_CLASS);b.h2=b.liveContainer.find(a.H2_SELECTOR);b.tabs=b.liveContainer.find("."+a.TABS_CLASS);if(!b.headlineList.length||!b.tabs.length){return;}var l=$.makeArray(b.tabs.children("li"));b.tabLinks=$.merge(b.h2,l);b.tabLinks.each(function(o,m){var p=$(this);if(o===0){b.activeTab=p;}var n=p.attr("link");p.data("key",n);p.bind("click",d);o++;});$("div.list a").live("click",function(m){if(m.button!==0){return;}m.preventDefault();Newsday.Global.State.resetHashState();currentTab=parseInt(b.activeTab.attr("tabindex"),10);Newsday.Global.State.setHashState("lf",currentTab);Newsday.Global.State.syncHashState();window.location.href=$(this).attr("href");});};var d=function(m){if(m){m.preventDefault();}var l=$(this);b.jlistName=parseInt(l.attr("tabindex"),10);if(l.hasClass("active")){return;}b.activeTab=l;c();};var c=function(){if(!b.activeTab.length){return;}$.each(b.tabLinks,function(){$(this).removeClass("active");});b.activeTab.addClass("active");b.leftDiv=b.leftDiv||$(a.LIVE_LEFT_DIV);b.leftDiv.append('<div class="loading">Loading headlines</div>');var l=b.activeTab.data("key");var m=Math.round(new Date().getTime()/1000);l=l+"&timestamp="+m;try{$.ajax({url:l+"&callback=?",dataType:"jsonp",success:function(o){k(o);b.leftDiv.find("div.loading").remove();},error:function(p,o){}});}catch(n){}};var k=function(n){if(typeof n!=="object"){return;}var o=b.activeTab.get(0),m=n.headlines,p;if(!$.isArray(m)){return;}b.headlineList.empty();var l=0;$.each(b.headlineList,function(r,q){var s=$(this);$curr=$("<ul></ul>");$.each(m,function(u,t){if(u>=l&&u<=(l+4)){$item=i(this,u+1);$curr.append($item);}});s.append($curr);l+=5;});};var i=function(p,n){if(typeof p!=="object"){return;}var r=$("<li></li>");var o=function(){var s,u;if(!p.newsLabel||p.newsLabel===""||p.newsLabel==="undefined"){u="&nbsp;";}else{u=p.newsLabel;}try{s=Newsday.Builder.newsLabel({newsLabel:u});if(s){r.append(s);}}catch(t){}};var m=function(){var s;if((p.headline&&p.headline.length>0)&&(p.link&&p.link.length>0)){try{s=Newsday.Builder.headline({headline:p.headline,link:p.link,pageSection:"live",linkPosition:n,listName:b.jlistName});if(s){r.append(s);}}catch(t){}}};var l=function(){var s;if(p.time&&p.time!==""){try{s=Newsday.Builder.displayTime({time:p.time});if(s){r.append(s);}}catch(t){}}};var q=function(){var s;if(p.media){try{s=Newsday.Builder.media({media:p.media});if(s){r.append(s);}}catch(t){}}};o();m();l();q();return r;};var g=function(){var l=Newsday.Global.State.getHashState("lf");if(l!==null&&l!==1){$selected=$("li[tabindex='"+l+"']");b.activeTab=$selected;c();}else{l=0;}};return{initialize:function(){b.liveContainer=b.liveContainer||$(a.LIVE_CONTAINER_ID);if(e||!b.liveContainer.length){return;}j();g();e=true;}};}());$(document).ready(Newsday.Live.initialize);(Newsday.MultimediaCarousel=function(){var g=false;var b={CAROUSEL_CONTAINER_ID:"div.strip"};var e={document:$(document),carouselContainer:null};var f=b;var c=e;var a=function(){$("#mezz ul").carouFredSel({items:{visible:4},prev:"#mezz a.prev",next:"#mezz a.next",container:"#mezz span.dots",auto:false,pagination:{container:"#mezz span.dots"},scroll:{duration:800,onAfter:function(){d();}}});};var d=function(){mediaCarouselLink();};return{initialize:function(){c.carouselContainer=c.carouselContainer||$(f.CAROUSEL_CONTAINER_ID);if(g||!c.carouselContainer.length){return;}a();g=true;}};}());$(document).ready(Newsday.MultimediaCarousel.initialize);function getLocalData(){(Newsday.YourNews=function(){var i={WEATHER_CONTAINER:"li.navWeather",AVAILABLE_ZIPS:["06390","11001","11003","11010","11020","11021","11023","11024","11030","11040","11042","11050","11096","11501","11507","11509","11510","11514","11516","11518","11520","11530","11542","11545","11548","11550","11552","11553","11554","11557","11558","11559","11560","11561","11563","11565","11566","11568","11570","11572","11575","11576","11577","11579","11580","11581","11590","11596","11598","11701","11702","11703","11704","11705","11706","11709","11710","11713","11714","11715","11716","11717","11718","11719","11720","11721","11722","11724","11725","11726","11727","11729","11730","11731","11732","11733","11735","11738","11740","11741","11742","11743","11746","11747","11749","11751","11752","11753","11754","11755","11756","11757","11758","11762","11763","11764","11765","11766","11767","11768","11769","11770","11771","11772","11776","11777","11778","11779","11780","11782","11783","11784","11786","11787","11788","11789","11790","11791","11792","11793","11794","11795","11796","11797","11798","11801","11803","11804","11901","11930","11932","11933","11934","11935","11937","11939","11940","11941","11942","11944","11946","11948","11949","11950","11951","11952","11953","11954","11955","11957","11958","11961","11963","11964","11965","11967","11968","11971","11976","11977","11978","11980"],YOUR_TOWN_CONTAINER:"div#midpage div#towns",YOUR_TOWN_LINK_ID:"input#newsNearYouId",YOUR_TOWN_LIST_SELECTOR:"div#towns ul#stories",YOUR_TOWN_TITLE_SELECTOR:"div#towns h3",YOUR_TOWN_LINKS_SELECTOR:"div#towns div.links",YOUR_TOWN_BUTTON_SELECTOR:"div#towns a#change"};var m={document:$(document),weatherContainer:null,yourTownContainer:null,yourTownList:null,yourTownTitle:null,yourTownLinks:null,yourTownButton:null};var b=i;var c=m;var e=null;var f=false;function d(){var r=polopoly.cookie.get("NDLiveLocale");if(r&&r.length){e=r.substr(r.indexOf("(")+1,5);if(e&&e.length){return e;}}else{var p=polopoly.base64.stringDecode(polopoly.cookie.get("zipcoordinates"));if((p&&p.length)){var q=0;var t=1;var s=p.split(",");if(s.length>t){if((s[t]!==null)&&(s[t]!=="")&&(s[t]!=="null")){return s[t];}}if(s[q]&&s[q].length){return s[q];}}}return;}var l=d();var o="http://api.wunderground.com/api/4af85b71ee552bcb/conditions/forecast/radar/q/"+l+".json";var j=function(r){var p=r;try{$.ajax({url:p+"?callback=?",dataType:"jsonp",success:function(s){k(s);},error:function(t,s){}});}catch(q){}};var k=function(p){$.each(p,function(){var D=Math.round(p.current_observation.temp_f);var r=p.forecast.simpleforecast.forecastday[0].high.fahrenheit;var y=p.forecast.simpleforecast.forecastday[0].low.fahrenheit;var v=p.current_observation.weather;var w=p.current_observation.relative_humidity;var x=p.current_observation.wind_dir+" "+p.current_observation.wind_mph+" mph";var F=p.current_observation.pressure_in;var B=p.current_observation.icon;var A="";if(window.location.href.indexOf("newyork.newsday.com")>-1){A="http://weather-newyork.newsday.com";}else{A="http://weather.newsday.com";}if(!p.current_observation.display_location.city||!p.current_observation.display_location.state||!D){return;}if($.inArray(l,b.AVAILABLE_ZIPS)>-1){a(p.current_observation.display_location.city);}n(p.current_observation.display_location.city);var z,s,u,q,t,C,E=null;c.weatherContainer.empty();z=$("<a></a>").attr("href","#").html(p.current_observation.display_location.city+", "+p.current_observation.display_location.state+" <strong>"+D+"&deg;</strong><span></span>").appendTo(c.weatherContainer);s=$("<div></div>").attr("id","weather").addClass("flyout").html('<p class="head">current conditions</p>');if(r&&y&&v){u=$("<p></p>").addClass("conditions").html('<span class="degree"><span id="wtemplg">'+D+"</span>&deg;</span>"+'<span class="hiLo">Hi <span id="wtemphi">'+r+"</span>&deg;"+'Lo <span id="wtemplo">'+y+"</span>&deg;</span>"+'<span class="status"><span id="wtempcondition">'+v+"</span></span>").appendTo(s);}if(B&&B!==""){t=$("<img>").addClass("todaysWeather").attr("width","75").attr("height","69").attr("alt","todays weather").attr("src","/img/newsday/weather/sm/"+B+".gif").appendTo(s);}C=$("<p></p>").addClass("radar").html("<p>radar</p>"+'<a href="/wundermap"><img width="100" height="70" src="'+p.radar.image_url+'"'+' alt="current radar map" class="radarMap"/></a>').appendTo(s);if(w&&x&&F){q=$("<p></p>").addClass("detail").html('<b>Humidity: </b><span id="whumid">'+w+"</span> "+'<b>Wind: </b><span id="wwind">'+x+"</span><br/>"+'<b>Barometer: </b><span id="wpress">'+F+"</span>&nbsp;Hg").appendTo(s);}E=$("<p></p>").addClass("links").html('<a id="forecastfull" href="'+A+"/cgi-bin/findweather/getForecast?brand=newsday&amp;query="+l+'">full forecast</a> '+'<a id="forecasthour" href="'+A+"/cgi-bin/findweather/getForecast?hourly=1&amp;query="+l+'&amp;yday=&amp;weekday=">hour-by-hour</a> '+'<a href="/wundermap">local map</a>').appendTo(s);c.weatherContainer.append(s);});};var g=function(r){$("div#towns").append('<div class="loading">Loading headlines</div>');var p=$(b.YOUR_TOWN_LINK_ID).val();var q=p+"?zip="+r;try{$.ajax({url:q,dataType:"json",success:function(t){h(t);},error:function(u,t){}});}catch(s){}$("div#towns").find("div.loading").remove();};var a=function(p){if(c.yourTownContainer&&c.yourTownContainer.length>0){c.yourTownTitle=$(b.YOUR_TOWN_TITLE_SELECTOR);c.yourTownTitle.empty();c.yourTownTitle.text(p);}c.yourTownButton=$(b.YOUR_TOWN_BUTTON_SELECTOR);if(c.yourTownButton&&c.yourTownButton.length>0){c.yourTownButton.text("Change your town");}};var h=function(s){c.yourTownList.empty();var q=4;var t,r,p=null;$.each(s.headlines,function(w,u){if(w<=q){t=$("<li></li>");r=$("<p></p>");if(w===0){t.addClass("lead");if((u.imageURL&&u.imageURL!=="")&&(u.link&&u.link!=="")&&(u.headline&&u.headline!=="")){$image=Newsday.Builder.image({url:u.imageURL,link:u.link,headline:u.headline,cssClass:"img",pageSection:"Community",linkPosition:w+1,listName:"Community"});if($image){t.append($image);}}else{q=5;}}p=u.category;$label=Newsday.Builder.label({newsLabel:u.newsLabel,section:p.title,link:p.link,time:""});if($label){t.append($label);}if((u.headline&&u.headline!=="")&&(u.link&&u.link!=="")){$headline=Newsday.Builder.headline({headline:u.headline,link:u.link,pageSection:"Community",linkPosition:w+1,listName:"Community"});if($headline){t.append($headline);}}c.yourTownList.append(t);}});};var n=function(s){c.yourTownLinks=c.yourTownLinks||$(b.YOUR_TOWN_LINKS_SELECTOR);c.yourTownLinks.empty();var u=s.toLowerCase();u=u.replace(/ /g,"");var r="/"+u+"Events";var p="http://directory.newsday.com/search.pg?q="+s+"&z=Long%20Island%2C%20NY";var t="http://longisland.newsday.com/newsday/crime/?community="+s;var q="/"+u;c.yourTownLinks.html("<h4>"+s+' links</h4><div><a class="btn" href="'+r+'">Events</a>'+'<a class="btn" href="'+p+'">Yellow Pages</a>'+'<a class="btn" href="'+t+'">Crime</a>'+'<a class="btn" href="'+q+'">More news</a></div>');$("#towns.module a.btn.more").html("Change town");};return{buildYourTown:g,updateTownName:a,writeTownLinks:n,initialize:function(){c.weatherContainer=c.weatherContainer||$(b.WEATHER_CONTAINER);c.yourTownContainer=c.yourTownContainer||$(b.YOUR_TOWN_CONTAINER);c.yourTownList=c.yourTownList||$(b.YOUR_TOWN_LIST_SELECTOR);if(f||!c.weatherContainer.length){return;}if(l&&l.length){j(o);}if(c.yourTownContainer&&c.yourTownContainer.length>0){if(l&&l.length){if($.inArray(l,b.AVAILABLE_ZIPS)>-1){g(l);}}}f=true;}};}());(Newsday.YourNews.SelectCommunity=function(){var g={LOCATION_LOOKUP_DATA:["Albertson (11507)","Amagansett (11930)","Amityville (11701)","Aquebogue (11931)","Atlantic Beach (11509)","Babylon (11702)","Baldwin (11510)","Bay Shore (11706)","Bayport (11705)","Bayville (11709)","Bellmore (11710)","Bellport (11713)","Bethpage (11714)","Blue Point (11715)","Bohemia (11716)","Brentwood (11717)","Bridgehampton (11932)","Brightwaters (11718)","Brookhaven (11719)","Brookville (11545)","Calverton (11933)","Carle Place (11514)","Cedarhurst (11516)","Center Moriches (11934)","Centereach (11720)","Centerport (11721)","Central Islip (11722)","Centre Island (11771)","Cold Spring Harbor (11724)","Commack (11725)","Copiague (11726)","Coram (11727)","Cutchogue (11935)","Deer Park (11729)","Dix Hills (11746)","East Hampton (11937)","East Islip (11730)","East Marion (11939)","East Meadow (11554)","East Moriches (11940)","East Northport (11731)","East Norwich (11732)","East Quogue (11942)","East Rockaway (11518)","East Setauket (11733)","Eastport (11941)","Elmont (11003)","Farmingdale (11735)","Farmingville (11738)","Floral Park (11001)","Fort Salonga (11768)","Franklin Square (11010)","Freeport (11520)","Garden City (11530)","Glen Cove (11542)","Glen Head (11545)","Glenwood Landing (11547)","Great Neck (11020)","Great Neck (11021)","Great Neck (11023)","Greenlawn (11740)","Greenport (11944)","Greenvale (11548)","Hampton Bays (11946)","Hauppauge (11788)","Hempstead (11550)","Hewlett (11557)","Hicksville (11801)","Holbrook (11741)","Holtsville (11742)","Huntington (11743)","Huntington Station (11746)","Inwood (11096)","Island Park (11558)","Islandia (11749)","Islip (11751)","Islip Terrace (11752)","Jamesport (11947)","Jericho (11753)","Kings Park (11754)","Kings Point (11024)","Lake Grove (11755)","Laurel (11948)","Lawrence (11559)","Levittown (11756)","Lido Beach (11561)","Lindenhurst (11757)","Locust Valley (11560)","Long Beach (11561)","Lynbrook (11563)","Malverne (11565)","Manhasset (11030)","Manorville (11949)","Massapequa (11758)","Massapequa Park (11762)","Mastic (11950)","Mastic Beach (11951)","Mattituck (11952)","Medford (11763)","Melville (11747)","Merrick (11566)","Middle Island (11953)","Mill Neck (11765)","Miller Place (11764)","Mineola (11501)","Montauk (11954)","Moriches (11955)","Mount Sinai (11766)","Muttontown (11791)","Nesconset (11767)","New Hyde Park (11040)","New Hyde Park (11042)","New Suffolk (11956)","North Babylon (11703)","North Bellmore (11710)","Northport (11768)","Oakdale (11769)","Ocean Beach (11770)","Oceanside (11572)","Old Bethpage (11804)","Old Westbury (11568)","Orient (11957)","Oyster Bay (11771)","Patchogue (11772)","Peconic (11958)","Plainview (11803)","Point Lookout (11569)","Port Jefferson (11777)","Port Jefferson Station (11776)","Port Washington (11050)","Quogue (11959)","Remsenburg (11960)","Ridge (11961)","Riverhead (11901)","Rockville Centre (11570)","Rocky Point (11778)","Ronkonkoma (11779)","Roosevelt (11575)","Roslyn (11576)","Roslyn Heights (11577)","Sag Harbor (11963)","Sagaponack (11962)","Sayville (11782)","Sea Cliff (11579)","Seaford (11783)","Selden (11784)","Setauket (11733)","Shelter Island (11964)","Shelter Island Heights (11965)","Shirley (11967)","Shoreham (11786)","Smithtown (11787)","Sound Beach (11789)","South Jamesport (11970)","Southampton (11968)","Southold (11971)","Speonk (11972)","St. James (11780)","Stony Brook (11790)","Stony Brook (11794)","Syosset (11791)","Uniondale (11553)","Valley Stream (11580)","Valley Stream (11581)","Wading River (11792)","Wantagh (11793)","Water Mill (11976)","West Babylon (11704)","West Hempstead (11552)","West Islip (11795)","West Sayville (11796)","Westbury (11590)","Westhampton (11977)","Westhampton Beach (11978)","Wheatley Heights (11798)","Williston Park (11596)","Woodbury (11797)","Woodmere (11598)","Wyandanch (11798)","Yaphank (11980)"],TOWNS_MODULE:"#towns",FLYOUT_ID:"div#locationSearch",RESULTS_LIST_ID:"ul#locationSearchResults",SEARCH_INPUT_ID:"input#searchLocale",INPUT_DEFAULT_VALUE:"Enter town or zip code...",LOCALE_COOKIE:"NDLiveLocale"};var i={flyout:null,resultsList:null,searchInput:null,townsModule:null,button:null};var a=g;var b=i;var c=function(){b.button=$("div#towns a#change");if(!b.button.length){return;}b.button.bind("click",e);};var f=function(){b.flyout=$(a.FLYOUT_ID);b.resultsList=$(a.RESULTS_LIST_ID);b.searchInput=$(a.SEARCH_INPUT_ID);$("div#towns button.cancel").show();$("div#towns button.cancel").bind("click",j);b.searchInput.attr("value",$.cookie(a.LOCALE_COOKIE)||a.INPUT_DEFAULT_VALUE);b.searchInput.bind("focus",function(){if(this.value===a.INPUT_DEFAULT_VALUE){this.value="";}if(this.value===$.cookie(a.LOCALE_COOKIE)){this.value="";}}).bind("blur",function(){if(this.value===""){this.value=a.INPUT_DEFAULT_VALUE;b.resultsList.empty();}});b.searchInput.autocomplete(a.LOCATION_LOOKUP_DATA,{delay:150,resultTarget:b.resultsList,matchContains:true,scroll:false,autofill:true}).result(function(l,n,m){$("div#towns button.save").show();Newsday.YourNews.SelectCommunity.preference=m;});try{$("div#towns button.save").bind("click",function(l){l.preventDefault();d();$("div#towns button.save").hide();});}catch(k){}};var d=function(n){if(n){n.preventDefault();}var k=Newsday.YourNews.SelectCommunity.preference;var l=k.substr(k.indexOf("(")+1,5);var m=k.substr(0,k.indexOf("(")-1);polopoly.cookie.set(a.LOCALE_COOKIE,k);if(Newsday.YourNews.SelectCommunity.preference!==null){j();h(l,m);}};var h=function(k,l){Newsday.YourNews.buildYourTown(k);Newsday.YourNews.updateTownName(l);Newsday.YourNews.writeTownLinks(l);setCommunityNews(l+" - "+k);};var e=function(k){if(k&&typeof k.preventDefault==="function"){k.preventDefault();}if(!b.flyout||!b.flyout.length){if(typeof b.townsModule!=="object"||!b.townsModule.length){return;}f();}b.flyout.show();};var j=function(k){if(k&&typeof k.preventDefault==="function"){k.preventDefault();}if(!b.flyout||!b.flyout.length){return;}b.flyout.hide();};return{preference:$.cookie(a.LOCALE_COOKIE),open:e,close:j,initialize:function(){b.townsModule=b.townsModule||$(a.TOWNS_MODULE);c();}};}());$(document).ready(Newsday.YourNews.initialize);$(document).ready(Newsday.YourNews.SelectCommunity.initialize);}getLocalData();
