/*! Mousewheel plugin for jScrollPane * Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.1.3 * * Requires: 1.2.2+ */ (function(c){"function"===typeof define&&define.amd?define(["jquery"],c):"object"===typeof exports?module.exports=c:c(jQuery)})(function(c){function l(b){var a=b||window.event,h=[].slice.call(arguments,1),d=0,e=0,f=0,g=0,g=0;b=c.event.fix(a);b.type="mousewheel";a.wheelDelta&&(d=a.wheelDelta);a.detail&&(d=-1*a.detail);a.deltaY&&(d=f=-1*a.deltaY);a.deltaX&&(e=a.deltaX,d=-1*e);void 0!==a.wheelDeltaY&&(f=a.wheelDeltaY);void 0!==a.wheelDeltaX&&(e=-1*a.wheelDeltaX);g=Math.abs(d);if(!m||g').css("padding",aH).append(D.children());al=b('
').css({width:aj+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aO=ay.stickToBottom&&K();aK=ay.stickToRight&&B();aJ=D.innerWidth()+f!=aj||D.outerHeight()!=v;if(aJ){aj=D.innerWidth()+f;v=D.innerHeight();al.css({width:aj+"px",height:v+"px"})}if(!aJ&&L==T&&Y.outerHeight()==Z){D.width(aj);return}L=T;Y.css("width","");D.width(aj);al.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aQ.contentWidth){T=aQ.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/aj;q=Z/v;az=q>1;aE=y>1;if(!(aE||az)){D.removeClass("jspScrollable");Y.css({top:0,width:al.width()-f});n();E();R();w()}else{D.addClass("jspScrollable");aL=ay.maintainPosition&&(I||aa);if(aL){aN=aC();aM=aA()}aF();z();F();if(aL){N(aK?(T-aj):aN,false);M(aO?(Z-v):aM,false)}J();ag();an();if(ay.enableKeyboardNavigation){S()}if(ay.clickOnTrack){p()}C();if(ay.hijackInternalLinks){m()}}if(ay.autoReinitialise&&!av){av=setInterval(function(){ar(ay)},ay.autoReinitialiseDelay)}else{if(!ay.autoReinitialise&&av){clearInterval(av)}}aI&&D.scrollTop(0)&&M(aI,false);aP&&D.scrollLeft(0)&&N(aP,false);D.trigger("jsp-initialised",[aE||az])}function aF(){if(az){al.append(b('
').append(b('
'),b('
').append(b('
').append(b('
'),b('
'))),b('
')));U=al.find(">.jspVerticalBar");ap=U.find(">.jspTrack");au=ap.find(">.jspDrag");if(ay.showArrows){aq=b('').bind("mousedown.jsp",aD(0,-1)).bind("click.jsp",aB);af=b('').bind("mousedown.jsp",aD(0,1)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){aq.bind("mouseover.jsp",aD(0,-1,aq));af.bind("mouseover.jsp",aD(0,1,af))}ak(ap,ay.verticalArrowPositions,aq,af)}t=v;al.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});au.hover(function(){au.addClass("jspHover")},function(){au.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);au.addClass("jspActive");var s=aI.pageY-au.position().top;b("html").bind("mousemove.jsp",function(aJ){V(aJ.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});o()}}function o(){ap.height(t+"px");I=0;X=ay.verticalGutter+ap.outerWidth();Y.width(aj-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aE){al.append(b('
').append(b('
'),b('
').append(b('
').append(b('
'),b('
'))),b('
')));am=al.find(">.jspHorizontalBar");G=am.find(">.jspTrack");h=G.find(">.jspDrag");if(ay.showArrows){ax=b('').bind("mousedown.jsp",aD(-1,0)).bind("click.jsp",aB);x=b('').bind("mousedown.jsp",aD(1,0)).bind("click.jsp",aB); if(ay.arrowScrollOnHover){ax.bind("mouseover.jsp",aD(-1,0,ax));x.bind("mouseover.jsp",aD(1,0,x))}ak(G,ay.horizontalArrowPositions,ax,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);h.addClass("jspActive");var s=aI.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aJ){W(aJ.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});l=al.innerWidth();ah()}}function ah(){al.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aE&&az){var aI=G.outerHeight(),s=ap.outerWidth();t-=aI;b(am).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;aj-=aI;G.parent().append(b('
').css("width",aI+"px"));o();ah()}if(aE){Y.width((al.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aE){at=Math.ceil(1/y*l);if(at>ay.horizontalDragMaxWidth){at=ay.horizontalDragMaxWidth}else{if(atay.verticalDragMaxHeight){A=ay.verticalDragMaxHeight}else{if(AaS){Q.scrollByY(-aP)}else{V(aS)}}else{if(aM>0){if(I+aQaS){Q.scrollByX(-aP)}else{W(aS)}}else{if(aM>0){if(aa+aQi){s=i}}if(aI===c){aI=ay.animateScroll}if(aI){Q.animate(au,"top",s,ad)}else{au.css("top",s);ad(s)}}function ad(aI){if(aI===c){aI=au.position().top}al.scrollTop(0);I=aI;var aL=I===0,aJ=I==i,aK=aI/i,s=-aK*(Z-v);if(ai!=aL||aG!=aJ){ai=aL;aG=aJ;D.trigger("jsp-arrow-change",[ai,aG,P,k])}u(aL,aJ);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aL,aJ]).trigger("scroll")}function W(aI,s){if(!aE){return}if(aI<0){aI=0}else{if(aI>j){aI=j}}if(s===c){s=ay.animateScroll}if(s){Q.animate(h,"left",aI,ae) }else{h.css("left",aI);ae(aI)}}function ae(aI){if(aI===c){aI=h.position().left}al.scrollTop(0);aa=aI;var aL=aa===0,aK=aa==j,aJ=aI/j,s=-aJ*(T-aj);if(P!=aL||k!=aK){P=aL;k=aK;D.trigger("jsp-arrow-change",[ai,aG,P,k])}r(aL,aK);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aL,aK]).trigger("scroll")}function u(aI,s){if(ay.showArrows){aq[aI?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aI,s){if(ay.showArrows){ax[aI?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aI){var aJ=s/(Z-v);V(aJ*i,aI)}function N(aI,s){var aJ=aI/(T-aj);W(aJ*j,s)}function ab(aV,aQ,aJ){var aN,aK,aL,s=0,aU=0,aI,aP,aO,aS,aR,aT;try{aN=b(aV)}catch(aM){return}aK=aN.outerHeight();aL=aN.outerWidth();al.scrollTop(0);al.scrollLeft(0);while(!aN.is(".jspPane")){s+=aN.position().top;aU+=aN.position().left;aN=aN.offsetParent();if(/^body|html$/i.test(aN[0].nodeName)){return}}aI=aA();aO=aI+v;if(saO){aR=s-v+aK+ay.verticalGutter}}if(aR){M(aR,aJ)}aP=aC();aS=aP+aj;if(aUaS){aT=aU-aj+aL+ay.horizontalGutter}}if(aT){N(aT,aJ)}}function aC(){return -Y.position().left}function aA(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aA()<10)}function B(){var s=T-aj;return(s>20)&&(s-aC()<10)}function ag(){al.unbind(ac).bind(ac,function(aL,aM,aK,aI){var aJ=aa,s=I;Q.scrollBy(aK*ay.mouseWheelSpeed,-aI*ay.mouseWheelSpeed,false);return aJ==aa&&s==I})}function n(){al.unbind(ac)}function aB(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aI,aK=[];aE&&aK.push(am[0]);az&&aK.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aN){if(aN.target!==this&&!(aK.length&&b(aN.target).closest(aK).length)){return}var aM=aa,aL=I;switch(aN.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aN.keyCode;aJ();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aI=aN.keyCode==s&&aM!=aa||aL!=I;return !aI}).bind("keypress.jsp",function(aL){if(aL.keyCode==s){aJ()}return !aI});if(ay.hideFocus){D.css("outline","none");if("hideFocus" in al[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in al[0]){D.attr("hideFocus",false)}}function aJ(){var aM=aa,aL=I;switch(s){case 40:Q.scrollByY(ay.keyboardSpeed,false);break;case 38:Q.scrollByY(-ay.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*ay.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*ay.scrollPagePercent,false);break;case 39:Q.scrollByX(ay.keyboardSpeed,false);break;case 37:Q.scrollByX(-ay.keyboardSpeed,false);break}aI=aM!=aa||aL!=I;return aI}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aI,aJ=escape(location.hash.substr(1));try{aK=b("#"+aJ+', a[name="'+aJ+'"]')}catch(s){return}if(aK.length&&Y.find(aJ)){if(al.scrollTop()===0){aI=setInterval(function(){if(al.scrollTop()>0){ab(aK,true);b(document).scrollTop(al.position().top);clearInterval(aI)}},50)}else{ab(aK,true);b(document).scrollTop(al.position().top)}}}}function m(){if(b(document.body).data("jspHijack")){return}b(document.body).data("jspHijack",true);b(document.body).delegate("a[href*=#]","click",function(s){var aI=this.href.substr(0,this.href.indexOf("#")),aK=location.href,aO,aP,aJ,aM,aL,aN;if(location.href.indexOf("#")!==-1){aK=location.href.substr(0,location.href.indexOf("#"))}if(aI!==aK){return}aO=escape(this.href.substr(this.href.indexOf("#")+1));aP;try{aP=b("#"+aO+', a[name="'+aO+'"]')}catch(aQ){return}if(!aP.length){return}aJ=aP.closest(".jspScrollable");aM=aJ.data("jsp");aM.scrollToElement(aP,true);if(aJ[0].scrollIntoView){aL=b(a).scrollTop();aN=aP.offset().top;if(aNaL+b(a).height()){aJ[0].scrollIntoView()}}s.preventDefault() })}function an(){var aJ,aI,aL,aK,aM,s=false;al.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aN){var aO=aN.originalEvent.touches[0];aJ=aC();aI=aA();aL=aO.pageX;aK=aO.pageY;aM=false;s=true}).bind("touchmove.jsp",function(aQ){if(!s){return}var aP=aQ.originalEvent.touches[0],aO=aa,aN=I;Q.scrollTo(aJ+aL-aP.pageX,aI+aK-aP.pageY);aM=aM||Math.abs(aL-aP.pageX)>5||Math.abs(aK-aP.pageY)>5;return aO==aa&&aN==I}).bind("touchend.jsp",function(aN){s=false}).bind("click.jsp-touchclick",function(aN){if(aM){aM=false;return false}})}function g(){var s=aA(),aI=aC();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ao.append(Y.children()));ao.scrollTop(s);ao.scrollLeft(aI);if(av){clearInterval(av)}}b.extend(Q,{reinitialise:function(aI){aI=b.extend({},ay,aI);ar(aI)},scrollToElement:function(aJ,aI,s){ab(aJ,aI,s)},scrollTo:function(aJ,s,aI){N(aJ,aI);M(s,aI)},scrollToX:function(aI,s){N(aI,s)},scrollToY:function(s,aI){M(s,aI)},scrollToPercentX:function(aI,s){N(aI*(T-aj),s)},scrollToPercentY:function(aI,s){M(aI*(Z-v),s)},scrollBy:function(aI,s,aJ){Q.scrollByX(aI,aJ);Q.scrollByY(s,aJ)},scrollByX:function(s,aJ){var aI=aC()+Math[s<0?"floor":"ceil"](s),aK=aI/(T-aj);W(aK*j,aJ)},scrollByY:function(s,aJ){var aI=aA()+Math[s<0?"floor":"ceil"](s),aK=aI/(Z-v);V(aK*i,aJ)},positionDragX:function(s,aI){W(s,aI)},positionDragY:function(aI,s){V(aI,s)},animate:function(aI,aL,s,aK){var aJ={};aJ[aL]=s;aI.animate(aJ,{duration:ay.animateDuration,easing:ay.animateEase,queue:false,step:aK})},getContentPositionX:function(){return aC()},getContentPositionY:function(){return aA()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aC()/(T-aj)},getPercentScrolledY:function(){return aA()/(Z-v)},getIsScrollableH:function(){return aE},getIsScrollableV:function(){return az},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:b.noop,destroy:function(){g()}});ar(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{b("script",f).filter('[type="text/javascript"],:not([type])').remove();g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:10,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this); /** * Cookie plugin - minimized by Google Closure Compiler * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ jQuery.cookie=function(d,c,a){if("undefined"!=typeof c){a=a||{};null===c&&(c="",a.expires=-1);var b="";if(a.expires&&("number"==typeof a.expires||a.expires.toUTCString))"number"==typeof a.expires?(b=new Date,b.setTime(b.getTime()+864E5*a.expires)):b=a.expires,b="; expires="+b.toUTCString();var e=a.path?"; path="+a.path:"",f=a.domain?"; domain="+a.domain:"",a=a.secure?"; secure":"";document.cookie=[d,"=",encodeURIComponent(c),b,e,f,a].join("")}else{c=null;if(document.cookie&&""!=document.cookie){a=document.cookie.split(";");for(b=0;bj.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("").bind("load",function(){var d=c.data(j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.data(j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/iphone|ipod|ipad.*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document); /*! * jCarousel - Riding carousels with jQuery * http://sorgalla.com/jcarousel/ * * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Built on top of the jQuery library * http://jquery.com * * Inspired by the "Carousel Component" by Bill Scott * http://billwscott.com/carousel/ */ (function(g){var q={vertical:!1,rtl:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"
",buttonPrevHTML:"
",buttonNextEvent:"click",buttonPrevEvent:"click", buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},m=!1;g(window).bind("load.jcarousel",function(){m=!0});g.jcarousel=function(a,c){this.options=g.extend({},q,c||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===void 0)this.options.rtl=(g(a).attr("dir")||g("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical? this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f
").parent();if(this.container.size()===0)this.container=this.clip.wrap("
").parent();b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('
');this.buttonPrev=g(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=g(this.options.buttonPrevHTML).appendTo(this.container);this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext= g(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext=g(this.options.buttonNextHTML).appendTo(this.container);this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"}); !this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null,b=this.list.children("li"),e=this;if(b.size()>0){var h=0,i=this.options.offset;b.each(function(){e.format(this,i++);h+=e.dimension(this,j)});this.list.css(this.wh,h+100+"px");if(!c||c.size===void 0)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display", "block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.resizeTimer&&clearTimeout(e.resizeTimer);e.resizeTimer=setTimeout(function(){e.reload()},100)};this.options.initCallback!==null&&this.options.initCallback(this,"init");!m&&g.browser.safari?(this.buttons(!1,!1),g(window).bind("load.jcarousel",function(){e.setup()})):this.setup()};var f=g.jcarousel;f.fn=f.prototype={jcarousel:"0.2.8"};f.fn.extend=f.extend=g.extend;f.fn.extend({setup:function(){this.prevLast= this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(a,!1);g(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);this.options.setupCallback!==null&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt, "0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(f){b+=a.dimension(this, c);f+1this.options.size)c=this.options.size;for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return!1}return!0}, get:function(a){return g(">.jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,p=g(c);if(b.length===0)for(var j,e=f.intval(a),b=this.create(a);;){if(j=this.get(--e),e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}else d=this.dimension(b);p.get(0).nodeName.toUpperCase()=="LI"?(b.replaceWith(p),b=p):b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);p=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible): null;d=this.dimension(b,p)-d;a>0&&a=this.first&&a<=this.last)){var b=this.dimension(c);athis.options.size?this.options.size:a);for(var d=this.first>a,g=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(g): this.get(this.last),e=d?g:g-1,h=null,i=0,k=!1,l=0;d?--e>=a:++ethis.options.size)))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)));j=h;l=this.dimension(h);k&&(i+=l);if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<= this.options.size)))b=d?b+l:b-l}for(var g=this.clipping(),m=[],o=0,n=0,j=this.get(a-1),e=a;++o;){h=this.get(e);k=!h.length;if(h.length===0){h=this.create(e).addClass(this.className("jcarousel-item-placeholder"));if(j.length===0)this.list.prepend(h);else j[d?"before":"after"](h);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)))}j=h;l=this.dimension(h);if(l===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."); this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size?m.push(h):k&&(i+=l);n+=l;if(n>=g)break;e++}for(h=0;h0&&(this.list.css(this.wh,this.dimension(this.list)+i+"px"),d&&(b-=i,this.list.css(this.lt,f.intval(this.list.css(this.lt))-i+"px")));i=a+o-1;if(this.options.wrap!="circular"&&this.options.size&&i>this.options.size)i=this.options.size;if(e>i){o=0;e=i;for(n=0;++o;){h=this.get(e--);if(!h.length)break;n+=this.dimension(h);if(n>=g)break}}e=i-o+ 1;this.options.wrap!="circular"&&e<1&&(e=1);if(this.inTail&&d)b+=this.tail,this.inTail=!1;this.tail=null;if(this.options.wrap!="circular"&&i==this.options.size&&i-o+1>=1&&(d=f.intval(this.get(i).css(!this.options.vertical?"marginRight":"marginBottom")),n-d>g))this.tail=n-g-d;if(c&&a===this.options.size&&this.tail)b-=this.tail,this.inTail=!0;for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=i;return b},animate:function(a,c){if(!this.locked&& !this.animating){this.animating=!0;var b=this,d=function(){b.animating=!1;a===0&&b.list.css(b.lt,0);!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last=b.first&&c<=b.last)&&(c<1||c>b.options.size)&&b.remove(c)}; this.notify("onBeforeAnimation");if(!this.options.animation||c===!1)this.list.css(this.lt,a+"px"),d();else{var f=!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},d={duration:this.options.animation,easing:this.options.easing,complete:d};if(g.isFunction(this.options.animationStepCallback))d.step=this.options.animationStepCallback;this.list.animate(f,d)}}},startAuto:function(a){if(a!==void 0)this.options.auto=a;if(this.options.auto===0)return this.stopAuto();if(this.timer===null){this.autoStopped= !1;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){if(this.timer!==null)window.clearTimeout(this.timer),this.timer=null},buttons:function(a,c){if(a==null&&(a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last=this.options.size))a=this.tail!==null&&!this.inTail;if(c==null&&(c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1),!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1))c=this.tail!==null&&this.inTail;var b=this;this.buttonNext.size()>0?(this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext),a&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext), this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?!1:!0),this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)):this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);this.buttonPrev.size()>0?(this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev), c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?!1:!0),this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)):this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b,null,c);this.buttonNextState= a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst=j&&k<=e)&&a(k)}}},create:function(a){return this.format("
  • ",a)},format:function(a,c){for(var a=g(a),b=a.get(0).className.split(" "),d=0;d 300) { // more than 200 ms elapsed sttns.lastscrll = sttns.getTime(); } }); var timeoutObj=null,attempts=0; var refreshPage = function() { if (((sttns.getTime() - sttns.lastscrll) >= sttns.threadhtime ) && ( (sttns.getTime() - sttns.loadtime) > sttns.reloadtime) ) { clearTimeout(timeoutObj); window.location.reload(); } else if (attempts<50) { attempts++; if(typeof window.console != 'undefined' ){console.log("[attempting reload ]: "+ attempts);} clearTimeout(timeoutObj); timeoutObj = setTimeout(function(){ refreshPage(); },sttns.threadhtime); } else { clearTimeout(timeoutObj); if(typeof window.console != 'undefined' ){console.log("[warning]: Maximum of attempts exceeded"); window.location.reload(); } } }; try{ refreshPage(); }catch(e){ jQuery.tbzWarning('blazerefresher >> '+e);} }; $.extend({ blazereFresher:blazerefresher }); })( jQuery ); /*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation * Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in t)e++;return e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"Warning: No message defined for "+e.name+"")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery); /* Polyfill for Placeholder */ /*! http://mths.be/placeholder v2.0.7 by @mathias */ ;(function(f,h,$){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=$.fn,c=$.valHooks,k,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){var l=this;l.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':b,'blur.placeholder':e}).data('placeholder-enabled',true).trigger('blur.placeholder');return l};j.input=a;j.textarea=d;k={get:function(m){var l=$(m);return l.data('placeholder-enabled')&&l.hasClass('placeholder')?'':m.value},set:function(m,n){var l=$(m);if(!l.data('placeholder-enabled')){return m.value=n}if(n==''){m.value=n;if(m!=h.activeElement){e.call(m)}}else{if(l.hasClass('placeholder')){b.call(m,true,n)||(m.value=n)}else{m.value=n}}return l}};a||(c.input=k);d||(c.textarea=k);$(function(){$(h).delegate('form','submit.placeholder',function(){var l=$('.placeholder',this).each(b);setTimeout(function(){l.each(e)},10)})});$(f).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value=''})})}function g(m){var l={},n=/^jQuery\d+$/;$.each(m.attributes,function(p,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(m,n){var l=this,o=$(l);if(l.value==o.attr('placeholder')&&o.hasClass('placeholder')){if(o.data('placeholder-password')){o=o.hide().next().show().attr('id',o.removeAttr('id').data('placeholder-id'));if(m===true){return o[0].value=n}o.focus()}else{l.value='';o.removeClass('placeholder');l==h.activeElement&&l.select()}}}function e(){var q,l=this,p=$(l),m=p,o=this.id;if(l.value==''){if(l.type=='password'){if(!p.data('placeholder-textinput')){try{q=p.clone().attr({type:'text'})}catch(n){q=$('').attr($.extend(g(this),{type:'text'}))}q.removeAttr('name').data({'placeholder-password':true,'placeholder-id':o}).bind('focus.placeholder',b);p.data({'placeholder-textinput':q,'placeholder-id':o}).before(q)}p=p.removeAttr('id').hide().prev().attr('id',o).show()}p.addClass('placeholder');p[0].value=p.attr('placeholder')}else{p.removeClass('placeholder')}}}(this,document,jQuery)); /** * TheBlaze Browser Detection Obj * * usage: * var tag_id = "body";// (default tag is body ) it will append descriptive classes to this tag * var attach_funcs = { 'system':true, 'type'=>true,'capabilities' => true }; * _ system : will attach operative systems names. Example "mobile,windows,mac,linux,BlackBerry,Androidv-#" * _ browser-type : will attach browser type names. Example "ie9,firefox3-6,safari4" * _ browser-capabilities : will attach browser capabilities names. Example " js,no-touch,local-store" * $.blazeBrowserDetection({'capabilities' : true, 'type' :true, 'system':true, 'tag_id':'body' }); * jQuery.blazeBrowserDetection({'capabilities' : true, 'type' :true, 'system':true, 'tag_id':'body' }); */ (function( $ ){ var browUtils ={ is_touch_device : function() { try { document.createEvent("TouchEvent"); return true; } catch (e) { if((typeof Touch == "object")){ return true; } return false; } }, isBot : function (){ ua = navigator.userAgent; if( ua.match(/Googlebot/i) || ua.match(/Visual Revenue/i) ){ return true; }else{ return false; } }, isRWDPage : function (){ var nowSize = jQuery(window).width(); if(typeof window.TBZ.RWDPage === "undefined" || typeof window.TBZ.RWDPageSize != nowSize ){ if(window.tblz_do_rwd === true && nowSize !== 0 && nowSize < 500){ window.TBZ.RWDPage = true; } else{ window.TBZ.RWDPage = false; } window.TBZ.RWDPageSize = nowSize; } return window.TBZ.RWDPage }, isMobile : function (ua){ if(typeof ua != "string" ){ ua = navigator.userAgent; } if( ua.match(/Android/i) || ua.match(/webOS/i) || ua.match(/iPhone/i) || ua.match(/iPod/i) || ua.match(/iPad/i) || ua.match(/Mobile/i) || ua.match(/Blackberry/i) || ua.match(/IEMobile/i) || ua.match(/playbook/i) ){ return true; }else{ return false; } }, supportLocalStorage : function () { var ls = false; try { if (typeof localStorage != "undefined" && "setItem" in localStorage) { localStorage.setItem("site", "theblaze"); ls = true; localStorage.removeItem("site", "theblaze"); } } catch (e) { ls = false; } return ls; }, hasSessionStorage : function () { var ss = false; try { if (typeof sessionStorage != "undefined" && "setItem" in sessionStorage) { sessionStorage.setItem("site", "theblaze"); ss = true; sessionStorage.removeItem("site", "theblaze"); } } catch (a) { ss = false; } return ss; }, supportCookies :function () { return ("cookie" in document && navigator.cookieEnabled) ? true : false; } }; window.isMobile = function(){ return browUtils.isMobile(); } window.isBot = function(){ return browUtils.isBot(); } var blazerBrowserObj = function( options ) { var sttns ={}; var opts = {'capabilities' : true, 'type' :true, 'system':true, 'tag_id':'body' }; opts = $.extend( opts , options); setUserAgent(navigator.userAgent); setCSSClass(opts); //logger(opts); //logger(sttns); sttns = { chrome : false, opera : false, firefox : false, firefoxVer : false, ie : false, ieVer : false, mozilla : false, safari : false, safariVer : false, windows : false, mac : false, linux : false, touch : false, mobile : false, cookies : false, localStorage : false, cookieStorage : false }; function trim(str) { return (str.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")); }; function setUserAgent(ua) { sttns.userAgent = ua; var u = ua.toLowerCase(), t = "", v = ""; if (u.indexOf("msie") > -1) { sttns.ie = true; t = u.substring(u.indexOf("msie"), u.length); v = t.substring(4, t.indexOf(";")); v = trim(v); sttns.ieVer = "ie"+v.substring(0, v.indexOf(".", 0)); } else { if (u.indexOf("firefox") > -1) { sttns.firefox = true; t = u.substring(u.indexOf("firefox")); v = t.substring(8); v = trim(v); sttns.firefoxVer = "ff"+v.substring(0, v.indexOf(".", 0)); } else { if (u.indexOf("chrome") > -1) { sttns.chrome = true; } else { if (u.indexOf("safari") > -1) { sttns.safari = true; t = u.substring(u.indexOf("version/")); v = t.substring(8); v = trim(v); sttns.safariVer = "sf"+v.substring(0, v.indexOf(".", 0)); } else { if (u.indexOf("opera") > -1) { sttns.opera = true; } else { if (u.indexOf("mozilla") > -1) { sttns.mozilla = true; } } } } } } //alert(u); if (u.indexOf("windows") > -1) { sttns.windows = true; } else { if (u.indexOf("macintosh") > -1) { sttns.mac = true; } else { if (u.indexOf("linux") > -1) { sttns.linux = true; }else{ if (u.indexOf("ipod") > -1 || u.indexOf('iphone') > -1 ) { if (u.indexOf("ipod") > -1 ) { sttns.ipod = true; } if ( u.indexOf('iphone') > -1) { sttns.iphone = true; } }else{ if (u.indexOf("ipad") > -1) { sttns.ipad = true; }else { if (u.indexOf("blackberry") > -1) { sttns.blackberry = true; } else { if(u.indexOf("playbook") > -1){ sttns.playbook = true; } } } } } } } sttns.touch = browUtils.is_touch_device(); sttns.cookies = browUtils.supportCookies(); sttns.localStorage = browUtils.supportLocalStorage(); sttns.cookieStorage = browUtils.hasSessionStorage(); sttns.mobile = browUtils.isMobile(u); sttns.isBot = browUtils.isBot(); window.browserObjBlaze = sttns; }; function logger(e){if(typeof window.console != "undefined" ){ console.log(e); }} function addClass (c) { if (document.getElementById && document.createTextNode) { var n = document.body; if (n) { if(n.className.indexOf(c) < 0){ n.className += n.className ? " " + c : c; } } } } function setCSSClass(opts) { if (document.getElementById && document.createTextNode) { var n = document.body; if (typeof n == "undefined" || n == null || n.length == 0) { setTimeout(function() { jQuery.theBlazerBrowser(opts); //logger('Browser info : ', "['"+ $('body').attr('class').split(' ').join("', '")+ "' ];"); }, 250); return; } } else { logger("Browser doesn't support getElementById"); return; } if(opts.system){ if (sttns.windows) { addClass("win"); } else { if (sttns.mac) { addClass("mac"); } else { if (sttns.linux) { addClass("lin"); } else { if(sttns.blackberry){ addClass('blkbrry');} if(sttns.playbook){ addClass('playbook');} else{ if(sttns.ipad){addClass('ipad');} else{ if(sttns.ipod || sttns.iphone){ if(sttns.ipod){addClass('ipod');} if(sttns.iphone){addClass('iphone');} } else{ addClass('in_unknown'); } } } } } } } if(opts.type){ if (sttns.ie) { addClass("ie"); if(sttns.ieVer){ addClass(sttns.ieVer); } } else { if (sttns.firefox) { addClass("ff"); if (sttns.firefoxVer) { addClass(sttns.firefoxVer); } } else { if (sttns.safari) { addClass("safari"); if (sttns.safariVer) { addClass(sttns.safariVer); } } else { if (sttns.chrome) { addClass("chrome"); } else { if (sttns.opera) { addClass("opera"); } else { if (sttns.mozilla) { addClass("mozilla"); } } } } } } } if(opts.capabilities){ addClass("js"); // by magic; if(sttns.touch){ addClass("touch"); }else{ addClass("no-touch"); } if(sttns.mobile){addClass('mobile');} if(sttns.cookies){addClass('cookie');} } //alert('Browser info : ['+ $('body').attr('class') + ' ];'); }; }; $.extend({ theBlazerBrowser:blazerBrowserObj,blzBrowserFuncs:browUtils }); })( jQuery ); /** * TheBlaze NewsAlert functionality * usage: jQuery.blazeNewsAlertInterval({reload_time:55}); * */ (function( $ ){ function classSwitcher(elm, addClass,removeClass){ $(elm).removeClass(removeClass).addClass(addClass); } function aTagAttrSet(atype,pelem,dat){ var news_text='',news_link='',news_window=''; if( atype == 'breaking'){ news_text = dat.breaking_news_text, news_link = dat.breaking_news_link, news_window = dat.breaking_news_link_window, atype_track = 'headline'; } else if(atype == 'secondary'){ news_text = dat.secondary_news_text, news_link = dat.secondary_news_link, news_window = dat.secondary_news_link_window, atype_track = atype; } elem = $(pelem), aelem = {}; if(news_link.length > 1){ if(elem.find('span')){ if(news_window === '_blank') { elem.html('
    ') } else { elem.html('') } } aelem = $(elem.find('a')) ; aelem.attr({'href': news_link,'target':news_window}); }else{ if(elem.find('a')){ elem.html('') } aelem = elem ; } aelem.html(news_text); } function createAlertData(dat,opts){ var coElm = jQuery('.'+opts.callout_id) || false; var pbreak = {}, psecod = {}, _atag_ = {}; if(coElm){ pbreak = $('div#'+opts.breaking_id); psecod = $('div#'+opts.secondary_id); if(dat.breaking_news_status == 'true'){ _atag_ = pbreak.find('a'); aTagAttrSet('breaking',pbreak,dat); classSwitcher(pbreak,opts.active_class,opts.inactive_class); }else{ classSwitcher(pbreak,opts.inactive_class,opts.active_class); } if(dat.secondary_news_status == 'true'){ _atag_ = psecod.find('a'); aTagAttrSet('secondary',psecod,dat); classSwitcher(psecod,opts.active_class,opts.inactive_class); }else{ classSwitcher(psecod,opts.inactive_class,opts.active_class); } } } function blazeNewsAlertInterval( options ){ var opts ={ reload_time : 55 , //secs callout_id : 'callouts', breaking_id : 'breaking_callout', secondary_id : 'secondary_callout', active_class : 'active', inactive_class : 'inactive', request_limit : 100 }, request_counter = 0; opts = $.extend(opts, options); var getNewsAlertData = function(){ try{ var epochmod10 = parseInt(new Date().valueOf()/10000); jQuery.ajax({ url: '/api/1/breaking-news.json?_='+epochmod10 , type: "GET" , dataType: "json" , cache: true , success : function(data){ createAlertData(data,opts); } }); }catch(e){ jQuery.tbzWarning('blazeNewsAlertInterval >> '+e); } if(opts.request_limit > request_counter){ setTimeout(getNewsAlertData, opts.reload_time * 1000 ); request_counter++ } } getNewsAlertData(); } $.extend({blazeNewsAlertInterval: blazeNewsAlertInterval}) })( jQuery ); /* TheBlaze tracker custom function data-blz-tracker="desc;scope" */ (function( $ ){ var blaze_tracking = function( target ) { function getScope(key){ key = key || 'external'; var scopes = { internal : 'Internal Links', flyout : 'NextStoryFlyout', radiopopout : 'Internal Links', promotext : 'Marketing Links', external : 'Outbound Links' }; return scopes[key]; } function getUrl(obj){ obj = $(obj); if(typeof obj.attr('href') == 'undefined' ){ obj = $("a",obj); } return obj.attr('href'); } function delaytracker(link,scopetxt,desc,timeout,scope){ _gat._getTrackerByName()._trackEvent(scopetxt, link, desc); if(scope == 'radiopopout'){ window.open(link,'winBRNLivePlayer','width=820,height=560,scrollbars=no,toolbar=no,status=no,menubar=no,resizable=no,location=no,directories=no'); } else if (timeout > 0){ setTimeout('document.location = "' + link + '"', timeout); } } function init(target){ $(target).each(function(){ var ths = $(this); ths.on("click", function(evt){ var link, rel , attr, timeout=100; link = getUrl(this); if(!link){ link = '';} attr = ths.attr('data-blz-tracker'); if(typeof attr !== 'undefined' && attr !== false){ var args = attr.split(";"); var scope = args[0], scopeTxt = getScope(args[0]), desc = args[1]; if ( (scope !== 'external') && !(evt.which > 1 || evt.shiftKey || evt.altKey || evt.metaKey) ) { evt.preventDefault(); } if(scope == 'external'){ timeout=0; } else if(scope == 'flyout'){ var link_ = 'clicked-' + desc; desc = link; link = link_; } delaytracker(link,scopeTxt,desc,timeout,scope); } }); }); } init(target); }; $.extend({ blzTrackEvent : blaze_tracking }); })( jQuery ); (function(jQuery, window) { window.TBZ = window.TBZ || {}; window.TBZ.LOGS = { WARNS : [], INFO :[]}; var conf = { logWindowErrors : false, reportUrl : "/jsreporter", reportToServer: false } var tbzWarnings = function ( err ) { window.TBZ.LOGS.WARNS.push( '' + err ); if ( window.console && console.warn ) { console.warn( "THEBLAZE : " + err); if (console.trace ) { console.trace(); } } if(conf.reportToServer && typeof err == "object"){ blazeErrorHandler(err.message,err.fileName,err.lineNumber); } }; var errorObject = function (){ try { throw Error('') } catch(err) { return err; } } var cLog = function (msg) { window.TBZ.LOGS.INFO.push( msg ); if ( window.console && console.log ) { console.log( "THEBLAZE : " + msg ); } } var tbzLoggings = function (msg,err) { cLog(msg); if(conf.reportToServer && typeof err == "object"){ blazeErrorHandler(msg,err.fileName,err.lineNumber); } }; var NRELogReporting = function(error_params){ $.ajax({ url: conf.reportUrl , type: "POST" , dataType: "json" , data: error_params , success : function(data){ cLog("Error has been reported..."); } }); return false; } var blazeErrorHandler = function(msg, url, line) { var time_stamp = new Date().getTime();//, user_agent = navigator.userAgent; return NRELogReporting({ msg: escape(msg), context :{ url: encodeURI(url), line: line, timestamp:time_stamp//, //useragent:user_agent already collected by newrelic } }); }; var init = function(){ if(conf.logWindowErrors){ // window.onerror = blazeErrorHandler; } cLog("Logging is active"); } init(); jQuery.extend({ tbzWarning : tbzWarnings, tbzLog: tbzLoggings }); })( jQuery, window); /*global jQuery */ /*jshint multistr:true browser:true */ /*! * FitVids 1.0 * * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ * * Date: Thu Sept 01 18:00:00 2011 -0500 */ (function( $ ){ "use strict"; $.fn.fitVids = function( options ) { var settings = { customSelector: null }; if(!document.getElementById('fit-vids-style')) { var div = document.createElement('div'), ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0]; div.className = 'fit-vids-style'; div.id = 'fit-vids-style'; div.style.display = 'none'; div.innerHTML = '­'; ref.parentNode.insertBefore(div,ref); } if ( options ) { $.extend( settings, options ); } return this.each(function(){ var selectors = [ "iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed" ]; if (settings.customSelector) { selectors.push(settings.customSelector); } var $allVideos = $(this).find(selectors.join(',')); $allVideos = $allVideos.not("object object"); // SwfObj conflict patch $allVideos.each(function(){ var $this = $(this); if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), aspectRatio = height / width; if(!$this.attr('id')){ var videoID = 'fitvid' + Math.floor(Math.random()*999999); $this.attr('id', videoID); } $this.wrap('
    ').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); $this.removeAttr('height').removeAttr('width'); }); }); }; })( jQuery ); /** * menu-aim jQuery plugin * https://github.com/kamens/jQuery-menu-aim */ (function($){$.fn.menuAim=function(opts){this.each(function(){init.call(this,opts)});return this};function init(opts){var $menu=$(this),activeRow=null,mouseLocs=[],lastDelayLoc=null,timeoutId=null,options=$.extend({rowSelector:"> li",submenuSelector:"*",submenuDirection:"right",tolerance:75,enter:$.noop,exit:$.noop,activate:$.noop,deactivate:$.noop,exitMenu:$.noop},opts);var MOUSE_LOCS_TRACKED=3,DELAY=300;var mousemoveDocument=function(e){mouseLocs.push({x:e.pageX,y:e.pageY});if(mouseLocs.length>MOUSE_LOCS_TRACKED)mouseLocs.shift()};var mouseleaveMenu=function(){if(timeoutId)clearTimeout(timeoutId);if(options.exitMenu(this)){if(activeRow)options.deactivate(activeRow);activeRow=null}};var mouseenterRow=function(){if(timeoutId)clearTimeout(timeoutId);options.enter(this);possiblyActivate(this)},mouseleaveRow=function(){options.exit(this)};var clickRow=function(){activate(this)};var activate=function(row){if(row==activeRow)return;if(activeRow)options.deactivate(activeRow);options.activate(row);activeRow=row};var possiblyActivate=function(row){var delay=activationDelay();if(delay)timeoutId=setTimeout(function(){possiblyActivate(row)},delay);else activate(row)};var activationDelay=function(){if(!activeRow||!$(activeRow).is(options.submenuSelector))return 0;var offset=$menu.offset(),upperLeft={x:offset.left,y:offset.top-options.tolerance},upperRight={x:offset.left+$menu.outerWidth(),y:upperLeft.y},lowerLeft={x:offset.left,y:offset.top+$menu.outerHeight()+options.tolerance},lowerRight={x:offset.left+$menu.outerWidth(),y:lowerLeft.y},loc=mouseLocs[mouseLocs.length-1],prevLoc=mouseLocs[0];if(!loc)return 0;if(!prevLoc)prevLoc=loc;if(prevLoc.xlowerRight.x||prevLoc.ylowerRight.y)return 0;if(lastDelayLoc&&loc.x==lastDelayLoc.x&&loc.y==lastDelayLoc.y)return 0;function slope(a,b){return(b.y-a.y)/(b.x-a.x)}var decreasingCorner=upperRight,increasingCorner=lowerRight;if(options.submenuDirection=="left"){decreasingCorner=lowerLeft;increasingCorner=upperLeft}else if(options.submenuDirection=="below"){decreasingCorner=lowerRight;increasingCorner=lowerLeft}else if(options.submenuDirection=="above"){decreasingCorner=upperLeft;increasingCorner=upperRight}var decreasingSlope=slope(loc,decreasingCorner),increasingSlope=slope(loc,increasingCorner),prevDecreasingSlope=slope(prevLoc,decreasingCorner),prevIncreasingSlope=slope(prevLoc,increasingCorner);if(decreasingSlopeprevIncreasingSlope){lastDelayLoc=loc;return DELAY}lastDelayLoc=null;return 0};$menu.mouseleave(mouseleaveMenu).find(options.rowSelector).mouseenter(mouseenterRow).mouseleave(mouseleaveRow).click(clickRow);$(document).mousemove(mousemoveDocument)}})(jQuery); /* MENU TEMPLATES Files */ (function( jQuery, window) { var TBZ = window.TBZ || {}; window.TBZ.menu_templates = { reply_comment_tmpl : '\
    \
    \
    \ \

    Characters Remaining: 1500

    \
    \ Cancel Reply\ \ \ \
    \
    \
    \
    \ ', stories_tmpl : '\ \ <% story_set = stories.third_navigation.stories; %>\ \ ', story_tmpl_contentonEnter: '\ <% jQuery.each(stories.third_navigation, function(index, story_set){ %>\ <% if(index != "stories"){ %>\ \ <% } %>\ <% }); %>\ ', videos_tmpl: '\ \ <% vid_set = stories.third_navigation.all_videos; %>\ <% index = "all_videos" ; %>\ \ ', videos_tmpl_contentonEnter : '\ <% jQuery.each(stories.third_navigation, function(index, vid_set) { %>\ <% if(index != "all_videos") { %>\ \ <% } %>\ <% }); %>\ ', radio_tmpl : '\ \ \ ', radio_tmpl_contentonEnter : '\ \ \ \ \ ', subs_tmpl : '\ \ ', blogs_tmpl : '\ \ ', contribution_tmpl : '\ \ <% var contrib_set = stories.third_navigation.featured_contributions, top_index = "featured_contributions"; %>\ \ ', contrib_tmpl_contentonEnter :'\ <% jQuery.each(stories.third_navigation, function(top_index, contrib_set) { %>\ <% if (top_index != "featured_contributions") { %>\ \ <% } %>\ <% }); %>\ ', shop_tmpl : '\ \ \ \ \ ', book_tmpl : '\ \ ', book_tmpl_contentonEnter : '\ \ \ \ \ \ ' }; var setUpHTMLElements = function(){ function thirdSubMenuOnEnter(elm_id, template,stories_data ){ jQuery('#'+elm_id).closest('.menu-primary-list').one('mouseenter',function(){ var story_textSub = TBZ.Template(TBZ.menu_templates[template], {stories: stories_data, data: {}} ); jQuery('#'+elm_id).append(story_textSub); window.setTimeout(function(){ clear_contentlist_sizes();},500); });//.addClass(elm_id+'-thrd-sub-menu') } var clear_contentlist_sizes = function (){ jQuery('.menu-secondary-content-list').each(function() { var postNum = jQuery(this).find('li').length; if(postNum == 10) { jQuery(this).find('li:nth-child(6)').css('clear','left'); } else { jQuery(this).find('li:nth-child(5)').css('clear','left'); } }); } var story_text = TBZ.Template(TBZ.menu_templates.stories_tmpl, {stories: window.TBZ.subnav_data.stories, data: {}} ); var videos_text = TBZ.Template(TBZ.menu_templates.videos_tmpl, {stories: window.TBZ.subnav_data.theblazetv, data: {}} ); var radio_text = TBZ.Template(TBZ.menu_templates.radio_tmpl, {stories: window.TBZ.subnav_data.radio, data: {}} ); var subs_text = TBZ.Template(TBZ.menu_templates.subs_tmpl, {stories: window.TBZ.subnav_data.subscribe, data: {}} ); var blogs_text = TBZ.Template(TBZ.menu_templates.blogs_tmpl, {stories: window.TBZ.subnav_data.blog, data: {}} ); var contrib_text = TBZ.Template(TBZ.menu_templates.contribution_tmpl, {stories: window.TBZ.subnav_data.contributors, data: {}} ); var books_text = TBZ.Template(TBZ.menu_templates.book_tmpl, {stories: window.TBZ.subnav_data.books, data: {}} ); var shop_text = TBZ.Template(TBZ.menu_templates.shop_tmpl, {stories: window.TBZ.subnav_data.shop, data: {}} ); jQuery('#cat-stories').html(story_text) jQuery('#cat-videos').html(videos_text); jQuery('#cat-radio').html(radio_text); jQuery('#cat-subscribe').html(subs_text); jQuery('#cat-blog').html(blogs_text); jQuery('#cat-contrib').html(contrib_text); jQuery('#cat-book').html(books_text); jQuery('#cat-shop').html(shop_text); thirdSubMenuOnEnter('cat-stories', 'story_tmpl_contentonEnter', window.TBZ.subnav_data.stories ); thirdSubMenuOnEnter('cat-videos', 'videos_tmpl_contentonEnter', window.TBZ.subnav_data.theblazetv ); thirdSubMenuOnEnter('cat-radio', 'radio_tmpl_contentonEnter', window.TBZ.subnav_data.radio ); thirdSubMenuOnEnter('cat-contrib', 'contrib_tmpl_contentonEnter', window.TBZ.subnav_data.contributors ); thirdSubMenuOnEnter('cat-book', 'book_tmpl_contentonEnter', window.TBZ.subnav_data.books ); window.setTimeout(function(){ if(!(jQuery.blzBrowserFuncs.isRWDPage())) { jQuery(".menu-secondary-nav").menuAim({ submenuSelector: ".menu-secondary-list", submenuDirection: "right", activate: function (e) { var classname = 'div.'+$(e).attr("id");+ $(".menu-secondary-content").hide(); $(classname).show(); $(".menu-secondary-list").removeClass('active'); $(e).addClass("active"); }, deactivate: function (e) { var classname = 'div.'+$(e).attr("id"); $(classname).hide(); $(e).removeClass("active"); } }); jQuery(".menu-primary-nav").menuAim({ submenuSelector: ".menu-primary-list.menu-drop", submenuDirection: "below", timeoutId: "menuwtimeut", activate: function (e) { if(jQuery.blzBrowserFuncs.isRWDPage()) return false; $(e).find(".menu-secondary-container").show(); $(e).find(".menu-secondary-content:first").show(); $(e).find(".menu-secondary-list:first").addClass('active'); }, deactivate: function (e) { if(jQuery.blzBrowserFuncs.isRWDPage()) return false; $(e).find(".menu-secondary-container").hide(); $(e).find(".menu-secondary-content").hide(); $(e).find(".menu-secondary-list").removeClass('active'); }, exitMenu:function() { if(jQuery.blzBrowserFuncs.isRWDPage()) return false; $(".menu-secondary-content").hide(); $(".menu-secondary-list").removeClass('active'); return true; } }); // search slide in jQuery('.menu-search').click(function(){ jQuery('.menu-search-container').show('slide', { direction : 'right' }, 500, function(){ jQuery('#s').focus(); }); }); // close search jQuery('.menu-search-close').click(function(){ jQuery('.menu-search-container').hide('slide', { direction : 'right' }, 500); }); // show login content jQuery('.menu-login-list').hover( function() { if(jQuery.blzBrowserFuncs.isRWDPage()) return false; jQuery('#logincontroller').show(); }, function() { if(jQuery.blzBrowserFuncs.isRWDPage()) return false; jQuery('#logincontroller').hide(); } ); // Clearing content lists in header, depending on the size. clear_contentlist_sizes(); } try{ jQuery.blzTrackEvent('a.menu-primary-link, .main-logo > a, a.menu-secondary-post-image, a.menu-secondary-link, a.menu-secondary-post-heading, .menu-secondary-banner a, a.tblz_ps_title'); } catch(err){jQuery.tbzWarning(err);} },1000); }; var getJsonData = function(){ $.ajax({ url: "/api/1/subnav.json", dataType: "json", success: function (dat) { window.TBZ.subnav_data = dat; setUpHTMLElements(); } }); }; var init = function(){ jQuery.tbzLog("Menu has been initiated"); getJsonData(); }; //init(); jQuery.extend({ tbzMenuInit : init, renewJsonData: getJsonData }); })( jQuery, window ); (function( $ ){ window.TBZ.blzComments = { conf : { commentsID : 'tblz_comments_container', reportUrl : '/api/1/comments/' }, setupHTML : function(data,elem_id,page_id,page){ jQuery('#'+elem_id).html('
    '); jQuery('.comments-pages').hide(); jQuery('.PAGE'+page+'-'+elem_id).append(data).show(); this.setOnClickCommentsPages(page_id,page); }, setLoginStatusLinks : function(page_id,page){ var reply_link = $('a.comment-reply-login'); reply_link.attr('href',''+reply_link.attr('href') + window.location.href) blazeuser = unescape($.cookie("theblaze_user")); if( blazeuser != null && blazeuser != 'null' && blazeuser != "") { reply_link.hide(); $('a.comment-reply-link').show(); $('#respond #leave-comment').show(); function cancel_reply_form(){ $('h2#reply-title').text(blazeuser + ', Speak Your Mind'); $('#post-comment #comment_parent').val('0'); $('#cancel-comment-reply-link').hide(); $('#comment-post-button').addClass('red').removeClass('secondary').text('Post'); } cancel_reply_form(); //$('a.comment-reply-login').hide(); $('#respond .logged-out').hide(); $('a.comment-reply-link').show().click(function(e){ $('#reply_respond').remove(); e.preventDefault(); var _ths = $(this); var comment_foot = _ths.parents('.comment-footer'); var list_id = _ths.parents('li').attr('id'); list_id = list_id.replace('li-comment-', ''); var comment_form = TBZ.Template(TBZ.menu_templates.reply_comment_tmpl, {info:{'post_id':page_id, 'parent_comment_id':list_id}, data: {}} ); //$(this).append(comment_form); $( comment_form ).insertAfter( comment_foot ); //When a user adds a comment form and then click reply on another comment, previous reply stays hidden //Lets show is and then remove the used class. $('a.comment-reply-link.used').show().removeClass('used'); _ths.hide().addClass('used'); $('#respond').hide(); $('#cancel-comment-reply-link').click(function(e){ e.preventDefault(); _ths.show().removeClass('used'); $('#reply_respond').remove(); $('#respond').show(); }); var rely_cmmt =$('#reply_comment'); rely_cmmt.on('focus',function(){ var ths = $(this); if( ths.val() == 'Add your comments'){ ths.val('');} }).on('blur',function(){ var ths = $(this); if( ths.val() == ''){ ths.val('Add your comments');} }).keyup(function(event) { var value = $(this).val(), remaining = comment_limiter.comment_max_length - value.length; if ( remaining < 0 ) { $(this).val( value.substring(0,comment_limiter.comment_max_length) ); remaining = 0; } $('#reply_char_count').text( remaining ); }); /* $('h2#reply-title').text(blazeuser + ', Leave A Reply to ' + $(this).prevAll('h5').eq(0).text()); $('#post-comment #comment_parent').val(list_id); $('#cancel-comment-reply-link').show(); $('#comment-post-button').removeClass('red').addClass('secondary').text('Reply'); window.location.hash = "respond"; */ }); $('#cancel-comment-reply-link').click(function(e){ e.preventDefault(); cancel_reply_form(); }); if(jQuery.blzBrowserFuncs.isRWDPage()) { jQuery('#comments,#leave-comment').addClass('comments-closed'); jQuery('#leave-comment').attr('style',''); } jQuery('#comment-count').on('click', function() { if(jQuery.blzBrowserFuncs.isRWDPage()) { jQuery('#comments,#leave-comment').toggleClass('comments-closed comments-open'); } }); blazerole = unescape($.cookie('theblaze_role')); if (blazerole != 'readonly') $('#comments ul.commentlist li.comment a.report').show(); } }, setOnClickCommentsPages : function(page_id,page){ var _th = this; _alinks_pages = jQuery('.navigation .comment-pages'); _alinks_pages.find('a.page-numbers').each(function(){ var ths_ = $(this), href_=ths_.attr('href'), hash_url ='#comments' ; if(href_ != hash_url){ ths_.attr('orig-href',href_ ).attr('href', hash_url); } }); _alinks_pages.off('click','a.page-numbers',function(){}); _alinks_pages.on('click','a.page-numbers',function(e){ e.preventDefault(); var ths_ = $(this); var href = $(ths_).attr('orig-href'); var pageid = href.match(/api\/1\/comments\/(\d+)/)[1]; var page = href.match(/api\/1\/comments\/\d+\/(\d+).html/); page = (page == null) ? 1 : page[1]; var pageClass = '.PAGE'+page+'-'+_th.conf.commentsID; var comments_elem = jQuery('#'+_th.conf.commentsID); if(comments_elem.find(pageClass).length){ comments_elem.find('.comments-pages').hide(); comments_elem.find(pageClass).show(); }else{ $('
    ').appendTo('.comments-pages .navigation'); _gat._getTrackerByName()._trackEvent('Site Features', 'Comment Thread', 'Load Page '+page+''); _th.getCommentContent(_th.conf,pageid,page); } }); _th.setLoginStatusLinks(page_id,page); }, getCommentContent : function(conf,page_id,page){ var conf = this.conf, _th = this; $.ajax({ url: conf.reportUrl+page_id+'/'+page+'.html', type: "GET", dataType: "html", success : function(data) { _th.setupHTML(data,conf.commentsID,page_id,page); $('.navigation .small-spinner').remove(); } }); return false; }, init : function(page_id,page){ var _th = this; _th.getCommentContent(_th.conf,page_id,page); function _fireLazyloadTrackerFunc(){ if(typeof _gat != 'undefined') { _gat._getTrackerByName()._trackEvent('Site Features', 'Comment Thread', 'LazyLoad'); }else{ setTimeout(_fireLazyloadTrackerFunc, 250); } } _fireLazyloadTrackerFunc(); } }; })(jQuery); (function($){ window.TBZ.Util = window.TBZ.Util ||{} TBZ.Util.Interval = function(delay) { this.delay = delay || 1000; this.timeout = null; this.bindable = $(this); }; TBZ.Util.Interval.prototype = { listen : function(event, callback) { this.bindable.bind(event, callback); }, setDelay : function(delay) { this.delay = delay; }, start : function(now) { if (!this.timeout) { this.scheduleUpdate(); } }, restart : function(now) { this.stop(); this.start(); }, stop : function(now) { if (this.timeout) { clearTimeout(this.timeout); this.timeout = 'undefined'; } }, scheduleUpdate : function() { var self = this; this.timeout = setTimeout(function() { self.scheduleUpdate(); self.execute(); }, this.delay); }, execute : function() { this.bindable.trigger("run"); } }; /* Util Function Interval End */ })( jQuery ); (function($){ window.TBZ.Util = window.TBZ.Util ||{} TBZ.Util.loadNVisible = function(settings,callBack) { this.offset = settings.offset || 600; this.delay = settings.delay || 100; this.run_once = settings.run_once || true; this.event_name = settings.event_name || ''; this.container = $(settings.container) || $(window); this.callback = (typeof callBack == 'function')?callBack:function(){}; }; TBZ.Util.loadNVisible.prototype = { inView : function(settings,callback) { var _this_ = this;var wind = $(window); _this_.event = settings.event || 'scroll'; if(_this_.event == 'scroll') { var scrolled = false; wind.bind(_this_.event,function(){ scrolled = true; }); _this_.intervalObj = new TBZ.Util.Interval(_this_.delay); _this_.intervalObj.setDelay(_this_.delay); _this_.intervalObj.listen("run", function() { if ( scrolled ) { scrolled = false; $(settings.elems).each(function(){ var elm = $(this); if( _this_.inHorizontalView(elm,wind) && _this_.inVerticalView(elm,wind)){ callback(elm); if(_this_.run_once){ _this_.intervalObj.stop(); } } }); } }); _this_.intervalObj.start(); } else { jQuery.tbzWarning('loadNVisible.event.'+this.event+': Not Implemented'); } }, isInView:function(elem){ var _this_ = this, wind = $(window), elm = $(elem); if( _this_.inHorizontalView(elm,wind) && _this_.inVerticalView(elm,wind)){ return true; } return false; }, inHorizontalView:function(elm, window){ var wind = $(window); var top_fold = wind.scrollTop(); var bot_fold = wind.height() + top_fold; var elm_pos = elm.offset().top; var abovefold = elm_pos + this.offset; var belowfold = elm_pos - this.offset + elm.height(); if( (bot_fold >= belowfold ) && (top_fold <= abovefold)) { return true; } return false; }, inVerticalView:function(elm,window){ var wind = $(window); var elm_pos = elm.offset().left; var lef_fold = wind.scrollLeft(); var rig_fold = wind.width() + lef_fold; var lef_edge = elm_pos + this.offset; var rig_edge = elm_pos - this.offset + elm.width(); if((rig_fold >= rig_edge) && (lef_fold <= lef_edge )) { return true; } return false; } }; /* ----- End Lazyloader */ })(jQuery); (function( $ ){ window.TBZ.Util = window.TBZ.Util ||{} window.TBZ.Util.stickyAdController = function( options ) { this.sttns = { id : '#sticky' , hasScroll : true , lastScroll : 0 , threadhtime : 100 , allowAttemps : 1 , attempts : 0 , offset : 0 }; var _ths_ = this, timeoutObj=0; sttns = $.extend( _ths_.sttns , options); $(window).bind('scroll',function () { _ths_.sttns.hasScroll = true; }); var stickyController = function() { if ( _ths_.sttns.hasScroll ) { _ths_.sttns.attempts++, _ths_.sttns.hasScroll = false; var stckad = $(_ths_.sttns.id); var offset = 0, sticky_height = stckad.height(), prnt_elem = stckad.parent(); offset = prnt_elem.offset().top + prnt_elem.outerHeight(); var prnt_siblngs = $('.column-row > .two-thirds.column'),isneedit = true; if(prnt_siblngs.height() <= prnt_elem.height()){ isneedit = false; ;} if(_ths_.sttns.lastScroll && offset > _ths_.sttns.lastScroll){ offset -= sticky_height; } _ths_.sttns.lastScroll = offset; var pos = $(window).scrollTop(), footer_pos = $("#footer_wrapper").position().top - 20; /*20 is the padding that #footer has */ if(pos >= offset && ( pos < footer_pos ) && isneedit ) { stckad.addClass('sticky-active'); if( (pos + sticky_height) >= footer_pos ){ stckad.addClass('to-bottom'); } else { stckad.removeClass('to-bottom');} } else { stckad.removeClass('sticky-active'); } } clearTimeout(timeoutObj); timeoutObj = setTimeout(function(){ stickyController(); },_ths_.sttns.threadhtime); }; try{ stickyController(); }catch(e){ jQuery.tbzWarning('stickyController >> '+e);} }; })( jQuery ); ;window.TBZ=window.TBZ||{};(function(){var cache={};TBZ.Template=function tmpl(str,data){var fn=!/\W/.test(str)?cache[str]=cache[str]||TBZ.Template(document.getElementById(str).innerHTML):new Function("obj","var p=[],print=function() {p.push.apply(p,arguments);};"+"with(obj) {p.push('"+ str.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'") +"');}return p.join('');");return data?fn(data):fn;};})();TBZ.shareTools=(function($){var conf={mainClass:'social-tools',balloonClass:'social-networks',itemClass:'share-item',articleID:'postContent',default_data:{url:window.location.href.replace(/#.*/,''),title:$('meta[property="og:title"]').attr("content")||document.title,description:$('meta[name=description]').attr("content")||"",image:$('meta[property="og:image"]').attr("content")||"",engines:"facebook,twitter,google,linkedin,email,comments,print,ad"},windowWidth:600,windowHeight:450,trackpairs:{utm_campaign:'ShareButtons',utm_medium:'story'}};var providers={facebook:{active:true,onShareOver:true,label:"Facebook",postUrl:"http://www.facebook.com/sharer.php?m2w",postType:"popup",shareParameters:{url:"p[url]",description:"p[summary]",title:"p[title]",image:"p[images]"},urlParameters:{'s':100},tckid:"facebook",width:655,height:430,countElm:'facebook-count'},onselect:{active:true,onShareOver:true,label:"Select & Share",postUrl:"http://www.facebook.com/sharer.php",postType:"select",shareParameters:{},urlParameters:{},tckid:"select-share",width:655,height:430},twitter:{active:true,onShowAll:true,label:"Twitter",postUrl:"https://twitter.com/share",postType:"popup",shareParameters:{url:"url",title:"text",related:["theblaze","theblazefaith"]},tckid:"twitter",width:600,height:450,strLength:117,countElm:'twitter-count'},google:{active:true,onShowAll:true,label:"Google+",postUrl:"https://plus.google.com/share",postType:"popup",shareParameters:{url:"url"},urlParameters:{hl:"en-US"},tckid:"googleplus",width:600,height:600,countElm:'gplus-count'},linkedin:{active:true,onShowAll:true,label:"Linkedin",postUrl:"http://www.linkedin.com/shareArticle",postType:"popup",shareParameters:{url:"url",title:"title",description:"summary"},urlParameters:{mini:"true",source:"TheBlaze"},tckid:"linkedin",width:750,height:450,countElm:'linkedin-count'},email:{active:true,onShowAll:true,label:"E-mail",postType:"link",shareParameters:{url:"url",title:"subject",description:"body"},message:"I thought you would like this story from TheBlaze.com",tckid:"email"},comments:{active:true,onShowAll:false,label:"Comments",postType:"link",urlParameters:{hash:'#comments'},countElm:'comment-count',commentCountsDOC:'div#comments span.num'},print:{active:true,onShowAll:false,label:"Print",postUrl:'',postType:"print",urlParameters:{}},ad:{active:true,onShowAll:false,label:"Advertisement",adInnerHtml:'Restoring Love'},posted:{active:true,postType:"display"}};var templates={shareList:'\ <% jQuery.each(shares, function(index, share) { \ if (share.name == "ad") { %>\
  • <%= share.adInnerHtml %>
  • \ <% } else if (share.type == "link") { %>\
  • <%= share.label %>
  • \ <% } else if (share.type == "print") { %>\
  • <%= share.label %>
  • \ <% } else if (share.type == "display") { %>\
  • <%= share.label %>
  • \ <% } else { %>\
  • <%= share.label %>
  • \ <% }\ }); %>\ ',selectPopup:'
    \
    \
    \ ',softIcons:'\ <% jQuery.each(shares, function(index, share) { %> \ <% if (share.name == "comments"){ %>\
  • \ <% } else { %>\
  • \ <% } }); %>\ '};function getImageFrom(elem){var img='';$(elem).find('img').each(function(){img=$(this).attr('src');});return img;} function getSharingData(elem,data){data=data?data:{};var _dt=elem?elem.data():{},_cf=conf.default_data;var images=getImageFrom($('#'+conf.articleID+' > div'));return{url:data.url||_dt.url||_cf.url,title:data.title||_dt.title||$('meta[property="og:title"]').attr("content"),description:data.description||_dt.description||_cf.description,image:images,engines:_dt.engines?_dt.engines.split(','):conf.default_data.engines.split(',')};} function strackEvents(action,category,elem,custom){try{var label=custom;if(elem.closest('ul').hasClass('social-tools-top')){label='Top';}else if(elem.closest('ul').hasClass('social-tools-bottom')){label='Bottom';} _gaq.push(['_trackEvent',category,action,label]);}catch(e){jQuery.tbzWarning('ShareTools >> '+e)}} function setupTrackingPairs(source,trckpairs){return"utm_source="+source +'&utm_medium='+trckpairs.utm_medium+'&utm_campaign='+encodeURIComponent(trckpairs.utm_campaign)} function setCopyListener(){function listenner(e){var selected=get_paragraph();if(selected!='') {getBalloonSharing();}} if((/dev\./.test(window.location.hostname)&&/http\:\/\/dev\./.test(window.location.href))||(/local\./.test(window.location.hostname)&&/http\:\/\/local\./.test(window.location.href))){if(typeof window.setListner=='undefined'){$(document).bind('keydown','ctrl+h',function(e){if(e.ctrlKey==true&&e.keyCode==72){e.stopPropagation();e.preventDefault();listenner(e);}});window.setListner=1;}}} function setupHandlers(){var selector='.'+conf.itemClass+' span',bd_=jQuery('body');bd_.undelegate(selector,'click');setCopyListener();bd_.delegate(selector,'click',function(event){var this_=$(this);var shareName=this_.parent().data('share');var data=getSharingData();options=providers[shareName];if(options.tckid){var trckpairs=conf.trackpairs;data.url=data.url+paramChar(data.url)+setupTrackingPairs(options.tckid,trckpairs);strackEvents(options.tckid,trckpairs.utm_campaign,this_);} if(options.active){if(options.postType=='popup'){sharePopUp(shareName,data);}else if(options.active&&options.postType=='select'){overlayPop(shareName,data);}} event.stopPropagation();});} function getSelectedDesc(){return $("div#on-select-overlay div.share-module textarea.selected-desc").attr('value');} function setupBalloonHandlers(_dat){var selector='.'+conf.balloonClass+' > a.'+conf.itemClass,postUrl='',bd_=jQuery('body');bd_.undelegate(selector,'click');bd_.delegate(selector,'click',function(event){_dat.description=getSelectedDesc();_dat.url=location.href;this_=$(this);var shareName=this_.data('share');var options=providers[shareName];if(options.tckid){var trckpairs=conf.trackpairs;_dat.url=_dat.url+paramChar(_dat.url)+setupTrackingPairs(options.tckid,trckpairs);strackEvents(options.tckid,trckpairs.utm_campaign,this_,'Bottom-Ballon');} if(options.active){if(options.postType=='popup'){sharePopUp(shareName,_dat);}} event.stopPropagation();});} function getBalloonSharing(){var sel=window.getSelection();for(var i=0;i0){var str=[];for(var i=0;i a, a.share-item.email').attr('href',postUrl).on('click',function(){strackEvents(options.tckid,trckpairs.utm_campaign,this_,'Bottom-Ballon');});}} function sethilightext(slectedtxt,str,index,reverse,srt){srt=srt||1;var endInd='';var _t=slectedtxt.split(' ').slice(0,3).join(' ');_t_=slectedtxt.split(' ').slice(-1).join(' ');function getIndex(text,end){var cntr=5,_t_,tjd;while(cntr){if(end){_t_=text.split(' ').slice(-(cntr--));}else{_t_=text.split(' ').slice(0,cntr);} tjd=_t_.join(' ');index=str.indexOf(tjd);cntr--;if(index>=0){if(end){index+=tjd.length;} return(index);}} return false;} start=getIndex(slectedtxt);endin=getIndex(slectedtxt,true);if(srt){endInd=' data-startoffset="'+start+'" ';} var staspan='',dnspn='';return(str.substring(0,start)+staspan+str.substring(start,endin)+dnspn+str.substring(endin));} function setUpHtml(){$('p',$('#'+conf.articleID)).each(function(){_el=$(this),fobj={};seltxt=get_paragraph();var otxt=_el.data('orig');if(_el.text().indexOf(seltxt)>=0){if(_el.attr('data-endoffset')&&_el.attr('data-startoffset')){_el.addClass('emActive');indx=0,reverse=true;start=_el.attr('data-startoffset');indx=_el.attr('data-endoffset');_el.html(sethilightext(seltxt,otxt,indx,reverse,start));} else if(_el.hasClass('emActive')){if(key=_el.attr('data-key')){indx=0,reverse=false;if(_el.attr('data-startoffset')){indx=_el.attr('data-startoffset');}else if(_el.attr('data-endoffset')){indx=_el.attr('data-endoffset');reverse=true;} _el.html(sethilightext(seltxt,otxt,indx,reverse));}} _el.removeAttr('data-startoffset').removeAttr('data-endoffset');}});updateUrlHash();} function get_paragraph(){var objSelc=getSelectedText();var selectedText=objSelc.text;if(typeof selectedText=='string'&&selectedText.length){return selectedText;} return false;} function get_text(el){return $(el).text().replace(/[^a-z\ ]+/gi,'').replace(/[\s\s]+/gi,' ').toLowerCase();} function createKey(elm,len){var _t=get_text($(elm)),len=len||5;_t=(_t.split(' ').slice(0,len-2).concat(_t.split(' ').slice(-(2))));$.each(_t,function(i,v){_t[i]=v.slice(0,1);});return _t.join('');} function setUpData(){$('p',$('#'+conf.articleID)).each(function(i){var key=createKey(this),this_=$(this);$(this).attr({'data-num':i+1,'data-key':key});this_.data('orig',""+this_.html());});} function highlightHash(){var rh=decodeURI(location.hash);if(rh&&rh.indexOf('comment')<0){var fhl=rh.match(/hl\[([^[\]]*)\]/);hlp=fhl.length?fhl[1]:false;if(hlp){hlp=hlp.match(/[a-zA-Z]+(,[0-9]+)*/g);var phi=[],elems=findParagraghs();for(var i=0;i0)?countSs.substring(1,countSs.indexOf(')')):0;jQuery('ul.social-tools.social-tools-set .share-item.comments > a').html(countSs);}else{setTimeout(getCountsFromDocOnReady,60);jQuery('ul.social-tools.social-tools-set .share-item.comments > a').html('');}} getCountsFromDocOnReady();countSs=0;}else{countSs=$('meta[property='+prDat.countElm+']').attr('content');} if(isNaN(parseInt(countSs,10))){countSs=0;} var cnt=formatCount(parseInt(countSs,10));label=label+cnt;} classes=cf.itemClass+' '+pName;type=prDat.postType;if(type=='link'){postUrl=createUrl(pName,_dat,true);} if(pName=='ad'){adInnerHtml=prDat.adInnerHtml;} templateInfo.push({label:label,name:pName,classes:classes,type:type,postUrl:postUrl,adInnerHtml:adInnerHtml});}}} var _ths_=$(this);if(elem.hasClass('tools-append')){$(elem).append(TBZ.Template(templates.shareList,{shares:templateInfo}));}else{var istmplted=_ths_.attr('data-template')||false;if(istmplted&&templates[istmplted]){$(elem).html(TBZ.Template(templates[istmplted],{shares:templateInfo}));}else{$(elem).html(TBZ.Template(templates.shareList,{shares:templateInfo}));}} elem.data({url:_dat.url,title:_dat.title,description:_dat.description,image:_dat.image});var list=elem.find('li');list.filter(':first').addClass('firstItem');list.filter(':last').addClass('lastItem');}});setUpData();} return{init:init,setupHandlers:setupHandlers};})(jQuery); ;window.TBZ=window.TBZ||{};var googletag=googletag||{};googletag.cmd=googletag.cmd||[];(function($){TBZ.displayingAds=TBZ.displayingAds||[];TBZ.displayingAdPos=TBZ.displayingAdPos||[];TBZ.ads_params={"account":75484061,"collapse_on_empty":true,"site":"TheBlaze.com","keywords":["lang=en"],"cookie_exp":{expires:30,path:'/',domain:document.location.hostname.replace('www.','')},"positions":{"Minibar_980x27_109":{"sizes":[[980,27]],"keywords":[]},"Billboard_970x90-970x250_170":{"sizes":[[970,90],[970,250]],"keywords":[],"settings":{"minimize":true,"criteo":true},"hide_on_mobile":true},"Right-Top_300x250-300x600_101":{"sizes":[[300,600],[300,250]],"keywords":[],"settings":{"criteo":true}},"In-Content_300x250_102":{"sizes":[[300,250]],"keywords":[]},"Poll_300x250_105":{"sizes":[[300,250]],"keywords":[]},"Interstitial_640x480_194":{"sizes":[[640,480]],"keywords":[],"hide_on_mobile":true},"Under-Content-Text_605x100_193":{"sizes":[[605,100]],"keywords":[]},"Under-Content_620x310_192":{"sizes":[[620,310]],"keywords":[]},"Right-Sticky_300x250_103":{"sizes":[[300,250]],"keywords":[],"settings":{"sticky":true}},"Right-Sticky-2-200_104":{"sizes":[[300,250]],"keywords":[],"settings":{"sticky":true}},"Right-Skyscraper_160x600_191":{"sizes":[[160,600]],"keywords":[]},"Right-Top-Skyscraper_160x600":{"sizes":[[160,600]],"keywords":[]},"Left-Top-Skyscraper_160x600":{"sizes":[[160,600]],"keywords":[]},"Native_Stream_Top":{"sizes":[[300,400]],"keywords":[]},"Native_Stream_Mid":{"sizes":[[300,400]],"keywords":[]},"Native_Understory":{"sizes":[[300,400]],"keywords":[]}}};TBZ.blzDFPAds={registerAdPos:function(elem_id,pos,settings){var tpos=TBZ.ads_params.positions[pos];if(tpos.hide_on_mobile!="undefined"&&tpos.hide_on_mobile){if(jQuery.blzBrowserFuncs.isMobile()||jQuery.blzBrowserFuncs.isRWDPage()){return{'cancel':true,'position':pos};}} TBZ.displayingAdPos.push({"elem_id":elem_id,"position":pos,"settings":settings});TBZ.displayingAds.push(function(){googletag.display(elem_id);});googletag.cmd.push(function(){googletag.display(elem_id);});},util:{get_elem_height:function(elem){return jQuery(elem).outerHeight(true);},count_down:function(vars){var takeover_i=1;function _StartCountDown(){var stop_interval=setInterval(function(){$(vars.idname).text(vars.time-takeover_i);if(takeover_i===vars.time){clearInterval(stop_interval);window[vars.close_ad_func]();} takeover_i+=1;},1000);} setTimeout(_StartCountDown,1000);},set_up_time:function(elem){var gthght_i=0,t_interval=setInterval(function(){var _elem=jQuery('#'+elem.id),s_option='style="display:none;"',o_style='',c_style='';var _pelem=_elem.parent();var notempty=$('#'+elem.id).attr("sytle");if(($('#'+elem.id).has('iframe').length&¬empty!='undefined')&&elem.failover0){var thinfuncname=elem.id.replace(/\-/g,'_') var closeAdfunc=thinfuncname+'closeAdfunc',openAdfunc=thinfuncname+'openAdfunc';window[closeAdfunc]=function(){_elem.slideUp(1000,function(){$(this).hide();});_pelem.find('.close_link').hide();_pelem.find('.open_link').show();return false;};window[openAdfunc]=function(){_elem.slideDown(1000,function(){$(this).css({'display':'block'});});_pelem.find('.close_link').show();_pelem.find('.open_link').hide();return false;};_pelem.prepend('');if(elem.time>0){TBZ.blzDFPAds.util.count_down({idname:'#takeover_time',time:elem.time,close_ad_func:closeAdfunc});}}}} gthght_i++;},600);}},getAdUnit:function(account_id,site,zone){targetArray=["/"+account_id,site];if(typeof zone!=undefined&&zone)targetArray.push(zone);return targetArray.join("/").replace('//','/');},buildAds:function(){try{var ads=TBZ.ads_params,t_=this,page_params=TBZ.page_params,positions=ads.positions,account=ads.account,zone=page_params.zone,site=ads.site,keywords=ads.keywords;if(typeof page_params.articleid==='number'&&page_params.articleid>0){keywords.push("articleid="+page_params.articleid);} if(typeof page_params.tags==='object'&&page_params.tags.length>0&&typeof JSON!=='undefined'){keywords.push("tags="+JSON.stringify(page_params.tags));} for(var p=0;pposition.settings.refresh_time){try{googletag.pubads().refresh([_this_.gslot]);}catch(err){jQuery.tbzWarning(err);} _this_.timeOnView=-5;}});_this_.intervalObj.start();} if(position.settings.lazyload){var tio=new TBZ.Util.loadNVisible({}),jelem=$("#"+elem_id);if(!tio.inHorizontalView(jelem)&&!tio.inVerticalView(jelem)){TBZ.LazyLoadads=TBZ.LazyLoadads||[];TBZ.LazyLoadads[""+elem_id+""]=dslot;try{tio.inView({elems:"#"+elem_id,delay:300,offset:600},function(elm){var elem_id_=$(elm).attr('id');var nloads=TBZ.LazyLoadads[elem_id_];nloads.addService(googletag.pubads());googletag.display(elem_id_);googletag.pubads().refresh([nloads]);});}catch(err){jQuery.tbzWarning(err);} window.setTimeout(function(){$(window).triggerHandler("scroll");},500);}else{dslot.addService(googletag.pubads());}}else{dslot.addService(googletag.pubads());}} if(position.settings){var settings=position.settings;var time_close=settings.close||false;var minmze=settings.minimize||false;var stcky=settings.sticky||false;var sekeywords=settings.keywords||false;if(time_close||minmze){var h=80;t_.util.set_up_time({id:elem_id,failover:50,height:h,minimizes:minmze});} if(sekeywords){for(var k=0;k0)this.cats=local_cats.attr('value');}},init:function(){this.ord=this.util.set_ord_val();if(document.location.pathname!=='/'){var path=document.location.pathname.split('/');if(path.length>=2)this.slug=path[path.length-2];} this.gather_cats();},util:{set_ord_val:function(){return Math.ceil(Math.random()*10000000000000000);},get_elem_height:function(elem){return jQuery(elem).outerHeight(true);},count_down:function(vars){var takeover_i=1;function _StartCountDown(){var stop_interval=setInterval(function(){$(vars.idname).text(vars.time-takeover_i);if(takeover_i===vars.time){clearInterval(stop_interval);window[vars.close_ad_func]();} takeover_i+=1;},1000);} setTimeout(_StartCountDown,1000);},set_up_time:function(elem){var gthght_i=0,t_interval=setInterval(function(){var _elem=jQuery('#'+elem.id),s_option='style="display:none;"',o_style='',c_style='';var _pelem=_elem.parent();_pelem.css('display','block');var hgt=jQuery.blzads.util.get_elem_height('#'+elem.id);_pelem.css('display','none');if(hgt>=elem.height||elem.failover=elem.height){if(elem.keepclose==true){_elem.hide(),c_style=s_option;}else{_elem.slideDown(1000),o_style=s_option;} _pelem.show();if(elem.minimizes||elem.time>0){var closeAdfunc=elem.id+'closeAdfunc',openAdfunc=elem.id+'openAdfunc';window[closeAdfunc]=function(){_elem.slideUp(1000,function(){$(this).hide();});_pelem.find('.close_link').hide();_pelem.find('.open_link').show();return false;};window[openAdfunc]=function(){_elem.slideDown(1000,function(){$(this).css({'display':'block'});});_pelem.find('.close_link').show();_pelem.find('.open_link').hide();return false;};_pelem.prepend('');if(elem.time>0){jQuery.blzads.util.count_down({idname:'#takeover_time',time:elem.time,close_ad_func:closeAdfunc});}}}} gthght_i++;},500);},iframe:{create:function(w,h,id){var ifrm=document.createElement('iframe');ifrm.setAttribute('id','iframe-'+id);ifrm.setAttribute('border','0');ifrm.setAttribute('scrolling','no');ifrm.setAttribute('frameBorder','0');ifrm.setAttribute('width',w);ifrm.setAttribute('height',h);return ifrm;},doc:function(ifr){if(ifr.contentDocument){return ifr.contentDocument;}else if(ifr.contentWindow){return ifr.contentWindow.document;}else if(ifr.document){return ifr.document;} return null;},closeDoc:function(doc,i){if(i==10){doc.close();}else{setTimeout(function(){jQuery.blzads.util.iframe.closeDoc(doc,i+1);},20);}}},get_doubleclick_params:function(params){var rt='',rta='';$.each(params,function(k,v){if(k=='prnpage'&&v==''){v='interior';} if(k.indexOf('misc')>0&&v!=''){rt+=v;v='';} if(v!=''){rt+=k+'='+v+';';rta+=k+'*'+v+'!';}});if($.blzads.slug!==''){rt+='prntarget='+encodeURIComponent($.blzads.slug)+';';rta+='prntarget*'+encodeURIComponent($.blzads.slug)+'!';} if($.blzads.cats!==null&&$.blzads.cats!==''){rt+='prnpagecat'+'='+encodeURIComponent($.blzads.cats)+';';rta+='prnpagecat'+'*'+encodeURIComponent($.blzads.cats)+'!';} rt+='tile'+'='+$.blzads.tile+';';rta+='tile'+'*'+$.blzads.tile+'!';rta=rta.substring(0,(rta.length-1));return rt+'u='+rta;}},create_script_ad:function(id,url,w,h,params,xparams,refresh,mobile){jQuery.tbzWarning('Deprecated function: create_script_ad');if(mobile==false&&jQuery(window).width()<500)return false;this.gather_cats();var local_params=$.extend({},params,xparams);var src_url=url+';'+this.util.get_doubleclick_params(local_params)+';ord='+$.blzads.ord+'?';document.write('