window.app=function(){function r(){return(typeof t=="undefined"||t==="")&&$.get(constant.appRoot+"templates/commentlisttemplate.mustache",function(n){t=n}),t}function i(t){switch(t){case constant.postListTemplateType.a:return(typeof n.a=="undefined"||n.a==="")&&$.get(constant.appRoot+"templates/postlistatemplate.mustache",function(t){n.a=t}),n.a;case constant.postListTemplateType.c:return(typeof n.c=="undefined"||n.c==="")&&$.get(constant.appRoot+"templates/postlistctemplate.mustache",function(t){n.c=t}),n.c;case constant.postListTemplateType.d:return(typeof n.d=="undefined"||n.d==="")&&$.get(constant.appRoot+"templates/postlistdtemplate.mustache",function(t){n.d=t}),n.d;case constant.postListTemplateType.e:return(typeof n.e=="undefined"||n.e==="")&&$.get(constant.appRoot+"templates/postlistetemplate.mustache",function(t){n.e=t}),n.e;case constant.postListTemplateType.f:return(typeof n.f=="undefined"||n.f==="")&&$.get(constant.appRoot+"templates/postlistftemplate.mustache",function(t){n.f=t}),n.f;case constant.postListTemplateType.g:return(typeof n.g=="undefined"||n.g==="")&&$.get(constant.appRoot+"templates/postlistgtemplate.mustache",function(t){n.g=t}),n.g;case constant.postListTemplateType.h:return(typeof n.h=="undefined"||n.h==="")&&$.get(constant.appRoot+"templates/postlisthtemplate.mustache",function(t){n.h=t}),n.h;case constant.postListTemplateType.j:return(typeof n.j=="undefined"||n.j==="")&&$.get(constant.appRoot+"templates/postlistjtemplate.mustache",function(t){n.j=t}),n.j;case constant.postListTemplateType.k:return(typeof n.k=="undefined"||n.k==="")&&$.get(constant.appRoot+"templates/postlistktemplate.mustache",function(t){n.k=t}),n.k;case constant.postListTemplateType.search:return(typeof n.search=="undefined"||n.search==="")&&$.get(constant.appRoot+"templates/searchlisttemplate.mustache",function(t){n.search=t}),n.search;case constant.postListTemplateType.w:return(typeof n.w=="undefined"||n.w==="")&&$.get(constant.appRoot+"templates/postlistwtemplate.mustache",function(t){n.w=t}),n.w;case constant.postListTemplateType.b:default:return(typeof n.b=="undefined"||n.b==="")&&$.get(constant.appRoot+"templates/postlistbtemplate.mustache",function(t){n.b=t}),n.b}}function u(n,t){var r=i(n);return Mustache.to_html(r,t)}function o(n){var t=r();return Mustache.to_html(t,n)}function s(n){return'<p class="font-resize"><strong style="font-size:11px;">Font Size<\/strong><br/><a style="font-size:14px;margin-left:10px;" href="javascript:window.app.makeFontSmall(\''+n+'\');">A<\/a><a style="font-size:18px;margin-left:10px;" href="javascript:window.app.makeFontMedium(\''+n+'\');">A<\/a><a style="font-size:22px;margin-left:10px;" href="javascript:window.app.makeFontLarge(\''+n+"');\">A<\/a><\/p>"}function l(n,t){return n.toLowerCase()=="united states"||n.toLowerCase()=="canada"?n.toLowerCase()=="united states"?p(t):n.toLowerCase()=="canada"?w(t):!0:!0}function a(n,t){return n.toLowerCase()=="united states"||n.toLowerCase()=="canada"||n==""?(t=t.replace("-",""),k(t)):!0}function v(n,t){return n.toLowerCase()=="united states"||n.toLowerCase()=="canada"?n.toLowerCase()=="united states"?d(t):n.toLowerCase()=="canada"?g(t):!0:!0}function y(n,t){return n.toLowerCase()=="united states"||n.toLowerCase()=="canada"?b(t,n):t?!1:!0}function e(n){if(n){var t=n.match(/^[A-Za-z\s]+$/);return t?!0:!1}return!1}function p(n){if(n){var t=n.match(/^(\d{5}|\d{9})$/);return t?!0:!1}return!1}function w(n){if(n){var t=n.match(/^[ABCEGHJ-NPRSTVXY]{1}[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}\s+[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[0-9]{1}$/);return t?!0:!1}return!1}function b(n,t){return t.toLowerCase()=="united states"?n?jQuery.inArray(n,h)!==-1?!0:!1:!1:t.toLowerCase()=="canada"?n?jQuery.inArray(n,c)!==-1?!0:!1:!1:!0}function k(n){if(n){var t=n.match(/^\d{10}$/);return t?!0:!1}return!1}function d(n){if(n){var t=n.match(/^[A-Za-z]{2}$/);return t?!0:!1}return!1}function g(n){if(n){var t=n.match(/^[A-Za-z]{2}$/);return t?!0:!1}return!1}function nt(n,t){n.addClass("on"),t.addClass("on")}function f(n,t){n.removeClass("on"),t.removeClass("on")}var n={a:"",b:"",c:"",d:"",e:"",f:"",g:"",h:"",j:"",k:"",search:""},t="",h=["AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","AS","AA","AE","AP","CZ","CM","FM","GU","MH","MP","PW","PI","PR","TT","VI"],c=["AB","BC","MB","NB","NL","NT","NS","NU","ON","PE","QC","SK","YT"];return{getGaqAccount:function(){return constant.gaqAccount},getGaqDomainName:function(){return constant.gaqDomainName},getPaqSiteId:function(){return constant.paqSiteId},logError:function(n,t,i){if(n.length&&i>0){var r={Message:n||"",LineNumber:i,Url:t||window.location,Referrer:document.referrer||"",UserAgent:navigator.userAgent};$.ajax({type:"POST",url:constant.appRoot+"error/log",data:r,dataType:"json"})}},downloadWhitepaper:function(){var t=$(this),i=t.parents(".detail[data-role=page]"),u=t.parents(".ui-btn").find(".ui-btn-text"),f=t.data("registrationRequired"),r,n;if(f=="required"){if(n=$.cookie("WhitepaperFormLeadID"),typeof n=="undefined"||n==null||n==""||n=="undefined"||n<=0){window.location.href="http://m."+constant.gaqDomainName+"/whitepaper/"+i.data("postId");return}r=constant.apiUrl+"whitepaper/file/"+i.data("postId")+"/"+n+"?apiKey="+constant.apiKey}else r=constant.apiUrl+"whitepaper/"+i.data("postId")+"?apiKey="+constant.apiKey;$.ajax({url:r,crossDomain:!0,beforeSend:function(){t.attr("disabled","disabled"),u.text("Submitting...")},success:function(n){if(n){if(f=="required"&&n.LeadID>0){var t="."+constant.gaqDomainName;document.cookie="WhitepaperFormLeadID=; domain="+t+"; expires="+new Date(0).toUTCString()+"; path=/",$.cookie("WhitepaperFormLeadID",n.LeadID,{expires:constant.cookieWhitepaperExpireDays,domain:t,path:"/"})}window.location.href="http://m."+constant.gaqDomainName+"/whitepaper/file/"+n.ID+"/"+n.WhitepaperFiles[0].ID+"/"+n.WhitepaperFiles[0].FileName}},error:function(){alert("There was an error. File could not be downloaded.")},complete:function(){t.removeAttr("disabled"),u.text(t.text())}})},postLead:function(){var r=$(this),u=r.parents(".detail[data-role=page]"),f=r.parents(".ui-btn").find(".ui-btn-text"),i=r.parents(".post-leadfield"),p=i.parents(".post-leadfield-box").find(".download-whitepaper"),w=i.find(".post-leadfield-firstName"),b=i.find(".post-leadfield-lastName"),k=i.find(".post-leadfield-jobTitle"),d=i.find(".post-leadfield-company"),g=i.find(".post-leadfield-address"),nt=i.find(".post-leadfield-address2"),tt=i.find(".post-leadfield-city"),it=i.find(".post-leadfield-zip"),rt=i.find(".post-leadfield-phone"),ut=i.find("#jobAssignmentSelect option:selected"),o="",s,t;$("#jobAssignmentSelect").val()&&(s=$("#jobAssignmentSelect").val(),o=s.join("|"));var ft=i.find(".post-leadfield-email"),et=i.find("#state option:selected"),ot=i.find("#country option:selected"),h=i.find("#businessTypeSelect option:selected"),c=i.find("#jobTitleSelect option:selected"),st=i.find(".post-leadfield-advertiser"),ht=i.find(".post-leadfield-tags"),ct=i.find(".post-leadfield-ipaddress"),lt=i.find(".post-leadfield-whitepapertitle"),at=i.find(".post-leadfield-channelname"),n={postid:u.data("postId"),firstName:w.val(),lastName:b.val(),email:ft.val(),state:et.val(),country:ot.val(),jobAssignmentSelect:o,jobAssignmentSelectText:ut.text(),businessTypeSelect:h.val(),businessTypeSelectText:h.text(),jobTitleSelect:c.val(),jobTitleSelectText:c.text(),title:k.val(),company:d.val(),address:g.val(),city:tt.val(),zip:it.val(),phone:rt.val(),address2:nt.val()};if(!n.postid||!n.firstName||!n.lastName||!n.country||!n.jobAssignmentSelect||!n.businessTypeSelect||!n.jobTitleSelect||!n.title||!n.company||!n.address||!n.city||!n.zip||!n.phone){alert("Please enter all fields.");return}if(!n.email.match(constant.regexEmail)){alert("Please enter a valid email address.");return}if(!e(n.firstName)){alert("First Name should contain alphabetic characters only.");return}if(!e(n.lastName)){alert("Last Name should contain alphabetic characters only.");return}if(n.country){if(n.state){if(!y(n.country,n.state)){alert("State/Province does not match selected country.");return}if(!v(n.country,n.state)){alert("State/Province field should be two letter abbreviation.");return}}if((n.country.toLowerCase()=="united states"||n.country.toLowerCase()=="canada")&&!n.state){alert("Please select a state/province.");return}if(n.zip&&!l(n.country,n.zip)){if(n.country.toLowerCase()=="united states"){alert("Domestic zip codes should be 5 numeric characters (ex: 01302). If zip codes include +4, it should be 9 numeric characters with no space and no dash (ex: 013021023).");return}if(n.country.toLowerCase()=="canada"){alert("Canadian zip codes should have a space between 3rd and 4th position. (ex: A1A 2B2)<\/li>");return}}if(n.phone&&!a(n.country,n.phone)){alert("Domestic and Canadian phone numbers should be 10-digit numeric only.<\/li>");return}}t={},t["[0].Key"]="firstName",t["[0].Value"]=n.firstName,t["[1].Key"]="lastName",t["[1].Value"]=n.lastName,t["[2].Key"]="email",t["[2].Value"]=n.email,t["[3].Key"]="state",t["[3].Value"]=n.state,t["[4].Key"]="country",t["[4].Value"]=n.country,t["[5].Key"]="agencyType",t["[5].Value"]=n.businessTypeSelect,t["[6].Key"]="businessTypeSelectText",t["[6].Value"]=n.businessTypeSelectText,t["[7].Key"]="jobClassification",t["[7].Value"]=n.jobTitleSelect,t["[8].Key"]="jobTitleSelectText",t["[8].Value"]=n.jobTitleSelectText,t["[9].Key"]="jobAssignment",t["[9].Value"]=n.jobAssignmentSelect,t["[10].Key"]="jobAssignmentSelectText",t["[10].Value"]=n.jobAssignmentSelectText,t["[11].Key"]="title",t["[11].Value"]=n.title,t["[12].Key"]="company",t["[12].Value"]=n.company,t["[13].Key"]="address",t["[13].Value"]=n.address,t["[14].Key"]="address2",t["[14].Value"]=n.address2,t["[15].Key"]="city",t["[15].Value"]=n.city,t["[16].Key"]="zip",t["[16].Value"]=n.zip,t["[17].Key"]="phone",t["[17].Value"]=n.phone,t["[18].Key"]="advertiser",t["[18].Value"]=st.val(),t["[19].Key"]="tags",t["[19].Value"]=ht.val(),t["[20].Key"]="ipaddress",t["[20].Value"]=ct.val(),t["[21].Key"]="whitepapertitle",t["[21].Value"]=lt.val(),t["[22].Key"]="channelname",t["[22].Value"]=at.val(),$.ajax({url:constant.apiUrl+"whitepaper/lead/"+n.postid+"?apiKey="+constant.apiKey,type:"POST",dataType:"json",data:t,crossDomain:!0,beforeSend:function(){r.attr("disabled","disabled"),f.text("Submitting...")},success:function(n){if(n&&n.LeadID>0){var t="."+constant.gaqDomainName;document.cookie="WhitepaperFormLeadID=; domain="+t+"; expires="+new Date(0).toUTCString()+"; path=/",$.cookie("WhitepaperFormLeadID",n.LeadID,{expires:constant.cookieWhitepaperExpireDays,domain:t,path:"/"})}i.hide(),p.css("display","block"),u.find(".post-leadfield .download-whitepaper .btn-download-whitepaper").trigger("click")},error:function(){alert("There was an error. Data could not be posted.")},complete:function(){r.removeAttr("disabled"),f.text(r.text())}})},loadMoreWhitepapers:function(n){n.stopImmediatePropagation(),n.preventDefault;var t=$(this),e=t.find(".ui-btn-inner .ui-icon"),h=t.parents(".posts-section"),c=h.find("ul.posts"),v=t.data("channel")?"&f_channel="+t.data("channel"):"",o=t.data("templateType"),r=t.data("pageNumber"),l=t.data("pageSize"),s=t.attr("href"),f=t.data("trackUrl"),a=constant.apiUrl+"whitepaper?apiKey="+constant.apiKey+"&pagenumber="+r+"&pagesize="+l;return $.ajax({url:a,crossDomain:!0,beforeSend:function(){i(o),t.attr("disabled","disabled"),e.addClass("spinning")},success:function(n){var e=u(o,n),i,h,l;e?(c.append(e).listview("refresh"),$.support.pushState&&window.history.pushState({page:r},document.title,s),i=r+1,t.data("pageNumber",i),h=s.replace("/page/"+r,"/page/"+i),t.attr("href",h),l=f.replace("/page/"+r,"/page/"+i),t.data("trackUrl",l),window.app.reloadGoogleAnalytics(f),window.app.reloadPiwik(f)):t.hide()},error:function(){alert("There was an error loading more.")},complete:function(){t.removeAttr("disabled"),e.removeClass("spinning")}}),!1},postComment:function(){var t=$(this),u=t.parents(".detail[data-role=page]"),f=t.parents(".ui-btn").find(".ui-btn-text"),c=t.parents(".comments-section").find(".comments.ui-listview"),i=t.parents(".post-comment"),o=i.find(".post-comment-name"),s=i.find(".post-comment-email"),e=i.find(".post-comment-comment"),n={contenttype:u.data("contentType"),postid:u.data("postId"),author:o.val(),authoremail:s.val(),text:e.val()},h=grecaptcha.getResponse();if(h.length==0){alert("Please validate that you are human.");return}if(!n.contenttype||!n.postid||!n.author||!n.authoremail||!n.text){alert("Please enter name, email and comment.");return}if(!n.authoremail.match(constant.regexEmail)){alert("Please enter valid email address.");return}$.cookie(constant.cookieCommentKeyUserName,n.author,{expires:constant.cookieCommentExpireDays}),$.cookie(constant.cookieCommentKeyUserEmail,n.authoremail,{expires:constant.cookieCommentExpireDays}),$.ajax({url:constant.apiUrl+"comment?apiKey="+constant.apiKey,type:"POST",dataType:"json",data:n,crossDomain:!0,beforeSend:function(){r(),t.attr("disabled","disabled"),f.text("Submitting...")},success:function(){e.val(""),alert("Thank you for joining the discussion. Your comment is pending approval.")},error:function(){alert("There was an error. Comment could not be posted.")},complete:function(){t.removeAttr("disabled"),f.text(t.text())}})},loadAllComments:function(){var n=$(this),i=n.parents(".ui-btn").find(".ui-btn-text"),f=n.parents("li.ui-li"),t=n.parents("ul.comments"),u=n.parents(".detail[data-role=page]"),e=u.data("contentType"),s=u.data("postId"),h=constant.apiUrl+"comment?apiKey="+constant.apiKey+"&contenttype="+e+"&id="+s;$.ajax({url:h,crossDomain:!0,beforeSend:function(){r(),n.attr("disabled","disabled"),i.text("Loading...")},success:function(n){var i=o(n);t.html(i),t.find("span.date").each(function(n,t){$(t).text($.format.date($(t).text()+"-08:00","M/d/yyyy h:mm:ss a"))}),t.listview("refresh"),f.remove()},error:function(){alert("There was an error loading comments.")},complete:function(){n.removeAttr("disabled"),i.text(n.text())}})},loadMorePosts:function(n){n.stopImmediatePropagation(),n.preventDefault;var t=$(this),e=t.find(".ui-btn-inner .ui-icon"),h=t.parents(".posts-section"),c=h.find("ul.posts"),l=t.data("channel")?"&f_channel="+t.data("channel"):"",a=t.data("contentType")?"&f_contenttype="+t.data("contentType"):"",v=t.data("advertiserId")?"&f_advertiserid="+t.data("advertiserId"):"",y=t.data("tags")?"&f_tags="+t.data("tags"):"",p=t.data("excludeType")?"&fe_type="+t.data("excludeType"):"",w=t.data("excludeId")?"&fe_posts="+t.data("excludeId"):"",o=t.data("templateType"),r=t.data("pageNumber"),b=t.data("pageSize"),s=t.attr("href"),f=t.data("trackUrl"),k=constant.apiUrl+"post?apiKey="+constant.apiKey+l+a+v+y+p+w+"&pagenumber="+r+"&pagesize="+b;return $.ajax({url:k,crossDomain:!0,beforeSend:function(){i(o),t.attr("disabled","disabled"),e.addClass("spinning")},success:function(n){var e=u(o,n),i,h,l;e?(c.append(e).listview("refresh"),$.support.pushState&&window.history.pushState({page:r},document.title,s),i=r+1,t.data("pageNumber",i),h=s.replace("/page/"+r,"/page/"+i),t.attr("href",h),l=f.replace("/page/"+r,"/page/"+i),t.data("trackUrl",l),window.app.reloadGoogleAnalytics(f),window.app.reloadPiwik(f)):t.hide()},error:function(){alert("There was an error loading more.")},complete:function(){t.removeAttr("disabled"),e.removeClass("spinning")}}),!1},loadMoreSearchPosts:function(n){n.stopImmediatePropagation(),n.preventDefault;var t=$(this),e=t.find(".ui-btn-inner .ui-icon"),h=t.parents(".search-posts-section"),c=h.find("ul.search-posts"),l=t.data("excludeType")?"&fe_type="+t.data("excludeType"):"",a=t.data("searchKeyword"),o=t.data("templateType"),r=t.data("pageNumber"),v=t.data("pageSize"),s=t.attr("href"),f=t.data("trackUrl"),y=constant.apiUrl+"search?apiKey="+constant.apiKey+l+"&q="+a+"&pagenumber="+r+"&pagesize="+v;return $.ajax({url:y,crossDomain:!0,beforeSend:function(){i(o),t.attr("disabled","disabled"),e.addClass("spinning")},success:function(n){var e=u(o,n),i,h,l;e?(c.append(e).listview("refresh"),$.support.pushState&&window.history.pushState({page:r},document.title,s),i=r+1,t.data("pageNumber",i),h=s.replace("&page="+r,"&page="+i),t.attr("href",h),l=f.replace("&page="+r,"&page="+i),t.data("trackUrl",l),window.app.reloadGoogleAnalytics(f),window.app.reloadPiwik(f)):t.hide()},error:function(){alert("There was an error loading more.")},complete:function(){t.removeAttr("disabled"),e.removeClass("spinning")}}),!1},enewsSignup:function(){var i=$(this),n=i.parents(".enews-signup").find(".enews-signup-email").val(),t=constant.emailPreferenceUrl_Textbox.replace(/&amp;+/g,"&");n&&($.cookie(constant.cookieCommentKeyUserEmail,n,{expires:constant.cookieCommentExpireDays}),t+="&em="+n),window.open(t,"_blank")},initSlider:function(n,t){var u,f,i,r,e;if(t.length&&(t.empty(),u=n.find(".swipe-wrap").children().length,u>0)){for(f=$("<em/>"),i=$("<div/>"),r=0;r<u;r++)e=f.clone(),r===0&&e.addClass("on"),i.append(e);return t.append(i.html()),f.remove(),i.remove(),new Swipe(n.get(0),{callback:function(n){t.find("em").removeClass(),t.find("em:nth-child("+(n+1)+")").addClass("on")}})}return null},initPhotoSwipe:function(){var n=$(this),t={getImageCaption:function(n){var i="",t,r,u;for(n.nodeName==="IMG"&&(i=n.getAttribute("alt")),t=0,r=n.childNodes.length;t<r;t++)u=n.childNodes[t],n.childNodes[t].nodeName==="IMG"&&(i=u.getAttribute("alt"));return $("<div/>").html($("<div/>").html(i).text())},enableMouseWheel:!1,enableKeyboard:!1},i=n.find(".gallery a").photoSwipe(t)},initPhotoOverlay:function(){var n=$(this),t;$(".story img").each(function(){var n=$(this),t,i;n.parent().is("a")||(t=n.attr("src"),n.addClass("image"),i=$("<a/>").attr("href",t).addClass("imgwrap"),n.wrap(i))}),t={getImageCaption:function(n){var i="",t,r,u;for(n.nodeName==="IMG"&&(i=n.getAttribute("alt")),t=0,r=n.childNodes.length;t<r;t++)u=n.childNodes[t],n.childNodes[t].nodeName==="IMG"&&(i=u.getAttribute("alt"));return $("<div/>").html($("<div/>").html(i).text())},enableMouseWheel:!1,enableKeyboard:!1},n.find(".story a.imgwrap").length>0&&n.find(".story a.imgwrap").photoSwipe(t)},reloadGoogleAnalytics:function(n,t,i,r){var u="//www.google-analytics.com/plugins/ga/inpage_linkid.js";_gaq.push(["_require","inpage_linkid",u]),_gaq.push(["_setAccount",constant.gaqAccount]),_gaq.push(["_setDomainName",constant.gaqDomainName]),r&&_gaq.push(["_setCustomVar",4,"SolrID",r+"",3]),t&&_gaq.push(["_setCustomVar",1,"PubDate",t+"",3]),i&&_gaq.push(["_setCustomVar",3,"Author",i,3]),n?_gaq.push(["_trackPageview",n]):_gaq.push(["_trackPageview"])},reloadPiwik:function(n){n?_paq.push(["trackPageView",n]):_paq.push(["trackPageView"]),_paq.push(["enableLinkTracking"]),_paq.push(["setCookieDomain",constant.paqCookieDomain])},reloadAddThis:function(n){var t=n.find(".social-tools"),i;t.length&&(window.addthis&&(window.addthis=null),i={data_ga_property:constant.gaqAccount,data_ga_social:!0},$.getScript("http://s7.addthis.com/js/300/addthis_widget.js#pubid="+constant.addThisPubId))},makeFontSmall:function(n){$("#"+n+" section.content").removeClass("medium").removeClass("large")},makeFontMedium:function(n){$("#"+n+" section.content").removeClass("large").addClass("medium")},makeFontLarge:function(n){$("#"+n+" section.content").removeClass("medium").addClass("large")},reloadFontTools:function(n){var r=n.attr("id"),t=n.find("section.content .story"),i;t.length&&t.find(".font-resize").length===0&&(i=s(r),t.children("p img").first().length>0?t.children("p img").first().parents("p:first").after(i):t.children("p").first().before(i))},reloadNavMore:function(n){var t=n.find(".navbar-more"),i=n.find(".navbar-more-box");f(t,i),t.unbind("click").click(function(){t.hasClass("on")?f(t,i):nt(t,i)}),$(document).mouseup(function(n){t.has(n.target).length===0&&f(t,i)})},prefillNameAndEmail:function(n){n.find(".post-comment-name").val($.cookie(constant.cookieCommentKeyUserName)),n.find(".post-comment-email").val($.cookie(constant.cookieCommentKeyUserEmail)),n.find(".enews-signup-email").val($.cookie(constant.cookieCommentKeyUserEmail))},showAdIframe:function(n,t){$(".ad-"+n).height(t).parent().show()},updateAdIframeHeight:function(n,t){$(".ad-"+n).height(t)},trackEventGA:function(n,t,i){_gaq.push(["_trackEvent",n,t,i])}}}(),window.slider={};var pymMobile=new pym.BBMMobile;window.onerror=function(n,t,i){window.app.logError(n,t,i)},$(document).bind("ready",function(){$.mobile.ajaxEnabled=!1,$.mobile.pushStateEnabled=!1,$.mobile.defaultPageTransition="none";$(document).on("click",".post-comment-submit",window.app.postComment);$(document).on("click",".comments-load-all",window.app.loadAllComments);$(document).on("click",".posts-load-more",window.app.loadMorePosts);$(document).on("click",".search-posts-load-more",window.app.loadMoreSearchPosts);$(document).on("click",".enews-signup-submit",window.app.enewsSignup);$(document).on("click",".post-leadfield-submit",window.app.postLead);$(document).on("click",".btn-download-whitepaper",window.app.downloadWhitepaper);$(document).on("click",".whitepapers-load-more",window.app.loadMoreWhitepapers)});$(document).on("pageshow","[data-role=page]",function(n,t){var i=$(this);t.prevPage.attr("id")&&i.find("script").each(function(){eval($(this).html())}),pymMobile._init();var u=window.location.hash.replace("#",""),f=i.data("trackPageView"),r=f?f:u?u:window.location.pathname+window.location.search;i.hasClass("detail")&&r!="/"?window.app.reloadGoogleAnalytics(r,i.data("pubDate"),i.data("author"),i.data("solrid")):window.app.reloadGoogleAnalytics(r),window.app.reloadPiwik(r),window.app.reloadFontTools(i),window.app.reloadNavMore(i),window.app.prefillNameAndEmail(i)});$(document).on("click","#tag-list a",function(){window.app.trackEventGA("button","story-tag",$(this).data("tag"))});$(document).on("pageshow","#page-home",function(){var n=$(this);window.slider.homeTop=window.app.initSlider(n.find(".sliderHomeTop"),n.find(".sliderHomeTopPosition")),window.slider.homePhotos=window.app.initSlider(n.find(".sliderHomePhotos"),n.find(".sliderHomePhotosPosition")),window.slider.homeProducts=window.app.initSlider(n.find(".sliderHomeProducts"),n.find(".sliderHomeProductsPosition")),window.slider.homeSponsored=window.app.initSlider(n.find(".sliderHomeSponsored"),n.find(".sliderHomeSponsoredPosition")),addToHomescreen()});$(document).on("pageshow","#page-photo-detail",window.app.initPhotoSwipe);$(document).on("pageshow","#page-article-detail, #page-news-detail, #page-blogpost-detail, #page-product-detail",window.app.initPhotoOverlay);$(document).on("pageshow","#page-channel-gangs, #page-channel-swat, #page-channel-weapons, #page-channel-careers-training, #page-channel-patrol, #page-channel-technology, #page-channel-vehicles, #page-channel-women-in-law-enforcement",function(){var n=$(this);window.slider.channelTop=window.app.initSlider(n.find(".sliderChannelTop"),n.find(".sliderChannelTopPosition"))})