Skip to content

Instantly share code, notes, and snippets.

@textarcana
Created March 18, 2009 18:40
Show Gist options
  • Select an option

  • Save textarcana/81303 to your computer and use it in GitHub Desktop.

Select an option

Save textarcana/81303 to your computer and use it in GitHub Desktop.
JavaScript - http://prototype.nytimes.com/gst/articleSkimmer/
* Collapse All
* Expand All
http://prototype.nytimes.com/gst/articleSkimmer/
http://graphics8.nytimes.com/js/app/articleSkimmer/jquery.min.js
/*
* jQuery JavaScript Library v1.3.1
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
* Revision: 6158
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(S){return S.getAttribute("href")}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})();
http://graphics8.nytimes.com/js/app/articleSkimmer/jquery.cookie.js
/**
* Cookie plugin
*
* 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
*
*/
/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// NOTE Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};
http://graphics8.nytimes.com/js/app/articleSkimmer/config.js
Schematic = window.Schematic || {};
Schematic.Config = {
sources: {
"Sections": {
"Home Page": "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
"World": "http://www.nytimes.com/services/xml/rss/nyt/World.xml",
"U.S.": "http://www.nytimes.com/services/xml/rss/nyt/US.xml",
"Politics": "http://www.nytimes.com/services/xml/rss/nyt/Politics.xml",
"N.Y. / Region":"http://www.nytimes.com/services/xml/rss/nyt/NYRegion.xml",
"The City": "http://www.nytimes.com/services/xml/rss/nyt/TheCity.xml",
"Business": "http://www.nytimes.com/services/xml/rss/nyt/Business.xml",
"Technology": "http://www.nytimes.com/services/xml/rss/nyt/Technology.xml",
"Sports": "http://www.nytimes.com/services/xml/rss/nyt/Sports.xml",
"Science": "http://www.nytimes.com/services/xml/rss/nyt/Science.xml",
"Health": "http://www.nytimes.com/services/xml/rss/nyt/Health.xml",
"Opinion": "http://www.nytimes.com/services/xml/rss/nyt/Opinion.xml",
"Arts": "http://www.nytimes.com/services/xml/rss/nyt/Arts.xml",
"Fashion & Style":"http://www.nytimes.com/services/xml/rss/nyt/FashionandStyle.xml",
"Dining & Wine":"http://www.nytimes.com/services/xml/rss/nyt/DiningandWine.xml",
"Travel": "http://www.nytimes.com/services/xml/rss/nyt/Travel.xml",
"Most Emailed": "http://www.nytimes.com/services/xml/rss/nyt/MostEMailed.xml"
//"Search Results": "http://query.nytimes.com/svc/search/articles/igoogle.json?query="
},
"Blogs": {
"The Lede": "http://thelede.blogs.nytimes.com/?feed=rss2",
"The Caucus": "http://thecaucus.blogs.nytimes.com/?feed=rss2",
"City Room": "http://cityroom.blogs.nytimes.com/?feed=rss2",
"DealBook": "http://dealbook.blogs.nytimes.com/?feed=rss2",
"Bits": "http://bits.blogs.nytimes.com/?feed=rss2",
"Well": "http://well.blogs.nytimes.com/index.php/?feed=rss2",
"Economix": "http://economix.blogs.nytimes.com/feed/",
"The Pour": "http://thepour.blogs.nytimes.com/?feed=rss2",
"Bitten": "http://bitten.blogs.nytimes.com/?feed=rss2",
"Measure for Measure":"http://measureformeasure.blogs.nytimes.com/?feed=rss2",
"The Moment": "http://themoment.blogs.nytimes.com/index.php/?feed=rss2",
"The Times Traveler": "http://timestraveler.blogs.nytimes.com/index.php/?feed=rss2",
"Talk Show": "http://cavett.blogs.nytimes.com/?feed=rss2",
"Paper Cuts": "http://papercuts.blogs.nytimes.com/?feed=rss2",
"Wordplay": "http://wordplay.blogs.nytimes.com/index.php/?feed=rss2"
},
"Topics": {
"Economic Stimulus": "http://topics.nytimes.com/topics/reference/timestopics/subjects/u/united_states_economy/economic_stimulus/index.html?rss=1",
"Barack Obama": "http://topics.nytimes.com/topics/reference/timestopics/people/o/barack_obama/index.html?rss=1",
"Global Warming": "http://topics.nytimes.com/topics/news/science/topics/globalwarming/index.html?rss=1",
"Credit Crisis": "http://topics.nytimes.com/topics/reference/timestopics/subjects/c/credit_crisis/index.html?rss=1",
"China": "http://topics.nytimes.com/topics/news/international/countriesandterritories/china/index.html?rss=1",
"Recipes": "http://topics.nytimes.com/topics/reference/timestopics/subjects/r/recipes/index.html?rss=1",
"Restaurants": "http://topics.nytimes.com/topics/reference/timestopics/subjects/r/restaurants/index.html?rss=1",
"Physics":"http://topics.nytimes.com/topics/news/science/topics/physics/index.html?rss=1",
"Bacon":"http://topics.nytimes.com/topics/reference/timestopics/subjects/b/bacon/index.html?rss=1",
"Lost":"http://topics.nytimes.com/topics/reference/timestopics/subjects/l/lost_tv_program/index.html?rss=1",
"Manners & Ettiquette":"http://topics.nytimes.com/topics/reference/timestopics/subjects/c/customs_etiquette_and_manners/index.html?rss=1"
}/*,
"Times People": {
"Nicholas Kristof": "http://timespeople.nytimes.com/view/user/45616064/rss.xml",
"Bill Keller": "http://timespeople.nytimes.com/view/user/125718/rss.xml",
"Jonathan Landman": "http://timespeople.nytimes.com/view/user/1079/rss.xml",
"Martin Nisenholtz": "http://timespeople.nytimes.com/view/user/19383520/rss.xml",
"Marc Frons": "http://timespeople.nytimes.com/view/user/237187/rss.xml",
"Khoi Vinh": "http://timespeople.nytimes.com/view/user/3456266/rss.xml",
"Sewell Chan": "http://timespeople.nytimes.com/view/user/47019083/rss.xml",
"Derek Gottfrid": "http://timespeople.nytimes.com/view/user/52396025/rss.xml",
"Andre Behrens": "http://timespeople.nytimes.com/view/user/25941584/rss.xml"
}*/
},
clickActions: {
"#helpClose":function(event) {
Schematic.application.toggleHelp();
},
"#helpLaunch":function(event) {
Schematic.application.toggleHelp();
},
"#settingsToggle":function(event) {
Schematic.application.toggleSettings();
},
"#closeSettings":function(event) {
Schematic.application.toggleSettings();
},
"#articleCloser":function(event) {
Schematic.application.closeArticle();
},
"#articlePopOut":function(event) {
window.open($("#articleFrame").attr("src"),"articlewindow");
},
"#articlePageView":function(event) {
location.href = $("#articleFrame").attr("src");
}
},
hoverActions: {
"#articleControls th": [
function(event) {
$(event.target.nextSibling).show();
},
function(event) {
$(event.target.nextSibling).hide();
}
]
},
changeActions: {
},
mouseActions: {},
keyActions: {
// Return Key
"13": [
{ eventType: "press", handler: function() { Schematic.application.selectStory(); }},
{ eventType: "press", handler: function() { Schematic.application.selectSection(); }}
],
// Esc Key
"27": [
{ eventType: "up", handler: function() { Schematic.application.closeArticle(); }}
],
// Space Bar
"32": [
{ eventType: "press", handler: function() { Schematic.application.nextSource(); }},
{ eventType: "pressWithShift", handler: function() { Schematic.application.previousSource(); }}
],
// Left Arrow Key
"37": [
{ eventType: "press", handler: function() { Schematic.application.moveArticleSelector("left"); }}
],
// Up Arrow Key
"38": [
{ eventType: "press", handler: function() { Schematic.application.previousSource(); }},
{ eventType: "press", handler: function() { Schematic.application.moveArticleSelector("up"); }}
],
// Right Arrow Key
"39": [
{ eventType: "press", handler: function() { Schematic.application.moveArticleSelector("right"); }}
],
// Down Arrow Key
"40": [
{ eventType: "press", handler: function() { Schematic.application.nextSource(); }},
{ eventType: "press", handler: function() { Schematic.application.moveArticleSelector("down"); }}
],
// A Key
"65": [
{ eventType: "down", handler: function() { Schematic.application.listenForStory(); }},
{ eventType: "up", handler: function() { Schematic.application.cancelListenForStory(); }}
],
// H Key
"72": [
{ eventType: "press", handler: function() { Schematic.application.setCurrentSource(0); Schematic.application.view(); }}
],
// R Key
"82": [
{ eventType: "press", handler: function() { Schematic.application.refresh(); }}
],
// S Key
"83": [
{ eventType: "down", handler: function() { Schematic.application.listenForSection(); }},
{ eventType: "up", handler: function() { Schematic.application.cancelListenForSection(); }}
],
// U Key
"85": [
{ eventType: "down", handler: function() { Schematic.application.highlightRecentUpdates(); }},
{ eventType: "up", handler: function() { Schematic.application.hideRecentUpdates(); }}
],
"allLetters": [],
"allNumbers": [
{ eventType: "press", handler: function(keyCode) { Schematic.application.grabKey(keyCode); }}
]
},
currentSchemeName: "serendipity",
clickAction: "inline",
extractors: { }
};
http://graphics8.nytimes.com/js/app/articleSkimmer/app.js
if (typeof console == "undefined") { console = { log: function() {} }; }
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
tmpl(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;
};
})();
Schematic = window.Schematic || {};
// Application
Schematic.Controller = function() {
var sources = {},
sourceOrder = [],
listeningForStoryCue = false,
listeningForSectionCue = false,
singleScreenMode = true,
currentDisplayedSource = 0,
layout,
messageBar,
priorSource,
targetSource,
currentSelectedSource,
numRows,
numColumns;
this.start = function() {
jQuery(location.search.replace("?","").split("&")).each(function() {
var nameValuePair = this.split("=");
var name = nameValuePair[0];
var value = nameValuePair[1];
if (name == "scheme") {
Schematic.application.setScheme(value);
}
});
var savedScheme = jQuery.cookie("currentScheme");
var savedSource = jQuery.cookie("currentSource");
var savedClickAction = jQuery.cookie("clickAction");
if (savedScheme) {
Schematic.application.setScheme(savedScheme);
}
if (savedClickAction) {
Schematic.application.setClickAction(savedClickAction);
}
messageBar = new Schematic.MessageBar();
layout = new Schematic.ScreenLayout();
loadSources();
if (savedSource) {
setCurrentSource(savedSource);
}
layout.setupNavigation(sourceOrder);
layout.activate();
window.setTimeout(setSlideHeight, 800);
window.setTimeout(Schematic.application.view, 1000);
Schematic.Key.disableDefaults();
this.activateSettings();
};
this.currentSource = function() {
return currentSource();
};
this.setCurrentSource = function(num) {
setCurrentSource(num);
};
this.currentSourceName = function() {
return sourceOrder[currentSource()];
};
this.numVisibleRows = function() {
return numRows;
};
this.numVisibleColumns = function() {
return numColumns;
};
this.setScheme = function(name) {
Schematic.Config.currentSchemeName = name;
var newStyles = tmpl(name+"Style", {});
var stylesheet = document.getElementById("schemeStyles");
if (stylesheet.styleSheet) {
stylesheet.styleSheet.cssText = newStyles;
} else {
jQuery(stylesheet).html(newStyles);
}
jQuery.cookie("currentScheme", name, {expires: 14});
};
this.setClickAction = function(action) {
Schematic.Config.clickAction = action;
jQuery.cookie("clickAction", action, {expires:14});
};
this.view = function() {
if (listeningForStoryCue) {
return;
}
source(currentSource()).requestData();
var sourceToExpire = source(currentSource());
if (arguments[0] !== "notrack") {
dcsMultiTrack('DCS.dcssip','www.nytimes.com','DCS.dcsuri','/skimmer/screen.html','WT.ti','Skimmer Screen','WT.cg_s','Skimmer');
}
flipToCurrent();
updateStatus();
updateNavigation();
setTimeout(requestSurrounders, 1000);
setTimeout(sourceToExpire.expire, 5 * 60 * 1000);
};
this.refresh = function() {
source(currentSource()).refresh();
};
this.getSource = function(num) {
if (num < 0) {
num = 0;
}
if (num >= sourceOrder.length) {
num = sourceOrder.length - 1;
}
return source(num);
}
this.nextSource = function() {
setCurrentSource(currentSource() + 1);
this.view();
};
this.previousSource = function() {
setCurrentSource(currentSource() - 1);
this.view();
};
this.listenForStory = function() {
listeningForStoryCue = true;
messageBar.setListeningForStory();
layout.initializeStorySelector();
};
this.listenForSection = function() {
listeningForSectionCue = true;
messageBar.setListeningForSection();
layout.displaySectionCues();
};
this.grabKey = function(keyEntered) {
var displayChar = String.fromCharCode(keyEntered);
messageBar.appendCharacter(displayChar);
};
this.moveArticleSelector = function(direction) {
if (listeningForStoryCue) {
switch (direction) {
case "left":
layout.moveSelectorLeft();
break;
case "right":
layout.moveSelectorRight();
break;
case "up":
layout.moveSelectorUp();
break;
case "down":
layout.moveSelectorDown();
break;
}
}
};
this.selectStory = function() {
if (listeningForStoryCue) {
var slide = $(".selectionCursor");
var loc = slide.addClass("current").find("a").get(0).href;
Schematic.application.openArticle(loc);
this.cancelListenForStory();
}
};
this.selectSection = function() {
if (listeningForSectionCue) {
var enteredNumber = parseInt(jQuery("#skimmerMessage").get(0).innerHTML, 10);
if (enteredNumber > 0) {
setCurrentSource(enteredNumber - 1);
this.view();
}
this.cancelListenForSection();
}
};
this.cancelListenForStory = function() {
if (listeningForStoryCue) {
listeningForStoryCue = false;
messageBar.setNormal();
layout.removeStoryCues();
layout.clearStorySelector();
}
};
this.cancelListenForSection = function() {
if (listeningForSectionCue) {
listeningForSectionCue = false;
messageBar.setNormal();
layout.removeSectionCues();
}
};
this.highlightRecentUpdates = function() {
$(".recent .container").css({'background-color': '#E2F1F6', 'color':"black"});
};
this.hideRecentUpdates = function() {
$(".recent .container").css({'background-color': '', 'color':''});
};
this.visibleSlides = function() {
return source(currentSource()).slides();
}
this.enableSingleScreenMode = function() {
singleScreenMode = true;
};
this.openArticle = function(url) {
switch (Schematic.Config.clickAction) {
case "inline":
$("#skimmerShade").fadeIn("slow", function() {
$("#skimmerArticleViwer").slideDown("fast", function() {
$("#articleFrame").attr("src", url).get(0).focus();
});
$("#articleControls").fadeIn("slow");
});
break;
case "new":
window.open(url, "newArticleWindow", "");
break;
case "replace":
location.href = url;
break;
}
};
this.closeArticle = function() {
$("#articleFrame").attr("src", "");
$("#skimmerArticleViwer").slideUp("fast", function() {
$("#skimmerShade").fadeOut("slow");
$("#articleControls td").hide();
$("#articleControls").hide();
});
};
this.showSidebar = function() {
};
this.hideSidebar = function() {
};
this.setPrompt = function(text) {
messageBar.setPrompt(text);
};
this.setStatusMessage = function(message) {
messageBar.setMessage(message);
};
this.scroll = function(direction, distance) {
var slider = jQuery("#skimmerSlider");
jQuery("#skimmerScrollIndicator").show();
var scaledHeight = jQuery("#skimmerScrollIndicator").get(0).offsetHeight;
var unitHeight = Math.round(scaledHeight / sourceOrder.length);
jQuery("#skimmerSlider").css({height:unitHeight+"px"});
var distanceFromTop = unitHeight * priorSource;
jQuery("#skimmerSpacer").css({height: distanceFromTop + "px"});
var distanceToTravel = unitHeight * distance;
var newTop = distanceFromTop + distanceToTravel;
jQuery("#skimmerSpacer").animate({height:newTop+"px"});
function hideWhenDone() {
jQuery("#skimmerScrollIndicator").fadeOut("slow");
}
window.setTimeout(hideWhenDone, 1500);
};
this.toggleHelp = function() {
jQuery("#skimmerHelp").toggle();
};
this.toggleSettings = function() {
jQuery("#skimmerSettings").toggle();
};
this.activateSettings = function() {
jQuery("#schemeList").empty();
jQuery(".schemeTemplate").each(function() {
var schemeName = this.id.replace("Template","");
var label = schemeName.split("")[0].toUpperCase() + schemeName.split("").slice(1).join("");
jQuery("#schemeList").append("<li><input class='button' type='button' id='scheme-"+schemeName+"' class='schemeButton' realvalue='"+schemeName+"' value='"+label+"'></li>");
});
jQuery("#schemeList li input.button").click(function(event) {
$("#schemeList .selectedOption").removeClass("selectedOption");
$(this).addClass("selectedOption");
Schematic.application.setScheme(event.target.getAttribute("realvalue"));
Schematic.application.resetSources();
Schematic.application.view("notrack");
dcsMultiTrack('DCS.dcssip','www.nytimes.com','DCS.dcsuri','/skimmer/changeScheme.html','WT.ti','Skimmer Screen','WT.cg_s','Skimmer','dcsm','1');
event.stopImmediatePropagation();
});
$("#scheme-"+Schematic.Config.currentSchemeName).addClass("selectedOption");
$("#clickBehavior input[realvalue="+Schematic.Config.clickAction+"]").addClass("selectedOption");
jQuery("#clickBehavior li input.button").click(function(event) {
$("#clickBehavior .selectedOption").removeClass("selectedOption");
$(this).addClass("selectedOption");
Schematic.application.setClickAction(event.target.getAttribute("realvalue"));
dcsMultiTrack('DCS.dcssip','www.nytimes.com','DCS.dcsuri','/skimmer/changeClickAction.html','WT.ti','Skimmer Screen','WT.cg_s','Skimmer','dcsm','1');
event.stopImmediatePropagation();
});
}
this.setSlideHeight = function() {
setSlideHeight();
};
this.resetSources = function() {
$(sourceOrder).each(function(index) {
source(index).expire();
//source(index).empty();
});
};
this.writeGlobalStyle = function(styleString) {
jQuery("head").append("<style>"+styleString+"</style>");
};
function listeningForUserInput() {
return (listeningForStoryCue || listeningForSectionCue);
}
function setCurrentSource(num) {
if (listeningForStoryCue) {
return;
}
if (num < 0 || num > (sourceOrder.length - 1)) {
if (typeof currentSelectedSource == "undefined") {
currentSelectedSource = 0;
}
return;
}
jQuery.cookie("currentSource", num, {expires: 14});
currentSelectedSource = num;
}
function currentSource() {
if (typeof currentSelectedSource == "undefined") {
setCurrentSource(0);
}
return parseInt(currentSelectedSource, 10);
}
function source(num) {
return sources[sourceOrder[num]];
}
function sourceName(num) {
return sourceOrder[num];
}
function requestSurrounders() {
if (currentSource() < sourceOrder.length) {
source(currentSource() + 1).requestData();
}
if (currentSource() > 0) {
source(currentSource() - 1).requestData();
}
}
function expireSection(num) {
source(num).expire();
}
function itemsInCurrentSource() {
return source(currentSource()).count();
}
function updateStatus() {
messageBar.setPrompt(sourceOrder[currentSource()]);
}
function updateNavigation() {
layout.markNavigation();
}
function firstRun() {
//if (GM_getValue("firstrun", "t") == "t") {
//controller.toggleHelp();
//GM_setValue("firstrun","f");
//}
}
function hideBody() {
document.body.style.overflow = "hidden";
}
function showBody() {
document.body.style.overflow = null;
}
function categoryId(name) {
return name.replace(" ","");
}
function loadSources() {
for (var categoryName in Schematic.Config.sources) {
var idBase = categoryId(categoryName);
jQuery("#skimmerPageNavigation dl").append("<dt id='"+idBase+"Header'>"+categoryName+"</dt><dd id='"+idBase+"Content'><ol></ol></dd>");
var sourceList = Schematic.Config.sources[categoryName];
for (var name in sourceList) {
var sourceObject = new Schematic.Source(name, sourceList[name], idBase);
sources[name] = sourceObject;
sourceOrder.push(name);
sourceObject.prepare();
}
}
for (var i=0, len=sourceOrder.length; i<len; i++) {
source(i).setLayerLevel(sourceOrder.length - i);
}
}
function addMetaSource(name, selector) {
var source = new Schematic.MetaSource(name, sources, selector);
sources[name] = source;
sourceOrder.push(name);
source.prepare();
}
function calculateOffset() {
var scrollerHeight = parseInt(document.getElementById("skimmerScroller").offsetHeight, 10);
var offset = currentSource() * (scrollerHeight + 20);
return offset;
}
function showActiveSources() {
var start, finish;
if (priorSource > currentSource()) {
start = currentSource();
finish = priorSource;
} else {
start = priorSource;
finish = currentSource();
}
jQuery(".shrinkWrap ul").filter(function(index) {
return index > start || index < finish;
}).show();
}
function flipToCurrent() {
var start, finish, viewPortHeight;
viewPortHeight = parseInt(document.getElementById("skimmerScroller").offsetHeight, 10);
jQuery(".shrinkWrap")
.filter(function(index) {
var outOfScope = index < currentSource() - 1 || index > currentSource() + 1;
if (outOfScope) source(index).expire();
return outOfScope; })
.empty()
.end()
.filter(function(index) { return index > currentSource() + 1; })
.css({top: viewPortHeight+"px"})
.end()
.filter(function(index) { return index < currentSource() - 1; })
.css({top:"-"+viewPortHeight+"px"})
.end()
.filter(function(index) { return index == currentSource() -1; })
.animate({top:"-"+viewPortHeight}, 1000)
.end()
.filter(function(index){ return index == currentSource(); })
.animate({top:"0"}, 1000)
.end()
.filter(function(index){ return index == currentSource() + 1; })
.animate({top:viewPortHeight}, 1000)
.end();
}
function hideInactiveSources() {
jQuery(".shrinkWrap ul").filter(function(index) {
return index !== currentSource();
}).hide();
}
function setSlideHeight() {
var scrollerHeight = parseInt(document.getElementById("skimmerScroller").offsetHeight, 10);
var scrollerWidth = parseInt(document.getElementById("skimmerScroller").offsetWidth, 10)
numRows = Math.floor(scrollerHeight / 160);
numColumns = Math.floor(scrollerWidth / 200);
var cellHeight = Math.floor(scrollerHeight / numRows);
var cellWidth = Math.floor(scrollerWidth / numColumns);
var viewPortHeight = parseInt(document.getElementById("skimmerScroller").offsetHeight, 10);
Schematic.application.writeGlobalStyle(".shrinkWrap {height:"+scrollerHeight+"px}");
Schematic.application.writeGlobalStyle("ul.grid li {height:"+cellHeight+"px; width:"+cellWidth+"px;}");
Schematic.application.writeGlobalStyle("ul.grid li:first-child {width:"+(cellWidth * 2)+"px;}");
jQuery(".shrinkWrap")
.filter(function(index) { return index > currentSource()})
.css({top: viewPortHeight+"px"})
.end()
.filter(function(index) { return index < currentSource()})
.css({top:"-"+viewPortHeight+"px"})
.end();
}
};
Schematic.MessageBar = function() {
this.setPrompt = function(text) {
messagePrompt().html(text);
};
this.setMessage = function(text) {
message().html(text);
};
this.appendCharacter = function(char) {
message().append(char);
};
this.setNormal = function() {
this.setPrompt(Schematic.application.currentSourceName());
this.setMessage('');
mast().removeClass("loading");
mast().removeClass("listeningForStories");
mast().removeClass("listeningForSections");
};
this.setLoading = function() {
mast().addClass("loading");
};
this.setListeningForStory = function() {
mast().addClass("listeningForStories");
this.setPrompt("Select Story with Arrow Keys and Hit Return to Select");
};
this.setListeningForSection = function() {
mast().addClass("listeningForSections");
this.setPrompt("View Section # ");
};
function mast() {
return jQuery("#skimmerMast");
}
function message() {
return jQuery("#skimmerMessage");
}
function messagePrompt() {
return jQuery("#skimmerPrompt");
}
};
Schematic.ScreenLayout = function() {
var navigationItems = [];
this.setupNavigation = function(sourceOrder) {
var nav = jQuery("#skimmerPageNavigation");
for (var i in sourceOrder) {
var source = Schematic.application.getSource(i);
var sourceName = jQuery("<li id='skimmerNavigationItem-"+i+"'></li>")
.html("<span class='ordinal'>"+(parseInt(i,10) + 1)+". </span> "+sourceOrder[i])
.click((function(number) {
return function() {
Schematic.application.setCurrentSource(number);
Schematic.application.view();
}
})(i));
jQuery("#"+source.sourceType()+"Content ol").append(sourceName);
navigationItems.push(sourceName);
}
nav.find("dt").click(function() {
$(this).parent("dl").find("dd").slideUp("fast");
$(this).next().slideDown("fast");
});
nav.find("dd").hide().eq(0).slideDown("fast");
};
this.markNavigation = function() {
for (var i=0, len=navigationItems.length; i<len; i++) {
var item = jQuery(navigationItems[i]);
if (i == Schematic.application.currentSource()) {
item.addClass("selected");
if(item.parents("dd").get(0).style.display == "none") {
item.parents("dd").prev().triggerHandler("click");
//$("#skimmerPageNavigation").find("dd").slideUp("fast");
}
} else {
item.removeClass("selected");
}
}
}
this.activate = function() {
var mouseIsDown = false;
var currentSource;
var nextSource;
var previousSource;
var currentTop;
var previousTop;
var nextTop;
var yOrigin;
var yCurrent;
var conf = Schematic.Config;
for (var selector in conf.clickActions) { jQuery(selector).click(conf.clickActions[selector]); }
for (var selector in conf.changeActions) { jQuery(selector).click(conf.changeActions[selector]); }
for (var selector in conf.hoverActions) { jQuery(selector).hover(conf.hoverActions[selector][0], conf.hoverActions[selector][1]); }
$(window).resize(function() {
Schematic.application.setSlideHeight();
});
function startDrag(event) {
if (event.touches && event.touches[0].target.parentNode.tagName === "A") { Schematic.application.setClickAction("new"); return };
if (jQuery(event.target).parents("div.shrinkWrap").length < 1) {return}
mouseIsDown = true;
yOrigin = event.touches ? event.touches[0].pageY : event.pageY;
currentSource = Schematic.application.getSource(Schematic.application.currentSource()).getNode();
nextSource = Schematic.application.getSource(Schematic.application.currentSource() + 1).getNode();
previousSource = Schematic.application.getSource(Schematic.application.currentSource() - 1).getNode();
currentTop = parseInt(currentSource.css("top"), 10);
previousTop = parseInt(previousSource.css("top"), 10);
nextTop = parseInt(nextSource.css("top"), 10);
if (event.touches) {
event.preventDefault();
}
}
function doDrag(event) {
if (mouseIsDown) {
yCurrent = event.touches ? event.touches[0].pageY : event.pageY;
var diff = yCurrent - yOrigin;
currentSource.css("top", currentTop + diff);
nextSource.css("top", nextTop + diff);
previousSource.css("top", previousTop + diff);
if (event.touches) {
event.preventDefault();
}
}
}
function endDrag(event) {
if (mouseIsDown) {
mouseIsDown = false;
yCurrent = event.touches ? yCurrent : event.pageY;
var diff = yCurrent - yOrigin;
var margin = event.touches ? 15 : 5;
if (diff > margin) {
Schematic.application.previousSource();
} else if (diff < -margin) {
Schematic.application.nextSource();
} else if (diff != 0) {
Schematic.application.view();
}
yOrigin = null;
if (event.touches && diff > margin && !event.target.tagName == "A") {
event.preventDefault();
}
}
}
// Drag to scroll feature.
$(document).mousedown(startDrag);
$(document).mousemove(doDrag);
$(document).mouseup(endDrag);
try {
document.addEventListener("touchstart", startDrag, false);
document.addEventListener("touchmove", doDrag, false);
document.addEventListener("touchend", endDrag, false);
} catch(e) { }
setupKeyCommands();
};
this.initializeStorySelector = function() {
Schematic.application.visibleSlides().eq(0).addClass("selectionCursor");
};
this.clearStorySelector = function() {
$(".selectionCursor").removeClass("selectionCursor");
};
this.moveSelectorLeft = function() {
var current = $(".selectionCursor");
if (current.prev().length > 0) {
current.removeClass("selectionCursor").prev().addClass("selectionCursor");
}
};
this.moveSelectorRight = function() {
var current = $('.selectionCursor');
if (current.next().length > 0) {
current.removeClass("selectionCursor").next().addClass("selectionCursor");
}
};
this.moveSelectorUp = function() {
var targets = determinePosition();
if (targets.up.length > 0) {
jQuery(".selectionCursor").removeClass("selectionCursor");
targets.up.addClass("selectionCursor");
}
};
this.moveSelectorDown = function() {
var targets = determinePosition();
if (targets.down.length > 0) {
jQuery(".selectionCursor").removeClass("selectionCursor");
targets.down.addClass("selectionCursor");
}
};
this.removeStoryCues = function() {
Schematic.application.visibleSlides().find(".selectorCue").remove();
Schematic.application.visibleSlides().attr({id:""});
};
this.displaySectionCues = function() {
Schematic.application.writeGlobalStyle("#skimmerPageNavigation li .ordinal { display: inline; }");
};
this.removeSectionCues = function() {
Schematic.application.writeGlobalStyle("#skimmerPageNavigation li .ordinal { display: none; }");
};
function determinePosition() {
var set = Schematic.application.visibleSlides();
var current = $('.selectionCursor');
var num = set.index(current);
var total = set.length;
var numColumns = Schematic.application.numVisibleColumns();
var remainder = (total + 1) % numColumns;
if (num <= 0) { // First Item
return {up:null, down: set.eq(numColumns - 1)};
} else if (num == numColumns - 1 || num == numColumns) {
return {up: set.eq(0), down: set.eq(num + numColumns)}
} else {
return {up: set.eq(num - numColumns), down: set.eq(num + numColumns)};
}
}
function setupKeyCommands() {
for (var key in Schematic.Config.keyActions) {
var actionBundle = Schematic.Config.keyActions[key];
jQuery(actionBundle).each(function() {
if (key == "allLetters") {
// Listen to all letter keys...
} else if (key == "allNumbers") {
Schematic.Key.range(48, 57, this.handler);
//Schematic.Key.range(96, 105, this.handler);
} else {
activateKeyCommand(key, this.eventType, this.handler);
}
});
}
}
function activateKeyCommand(keyNum, type, handler) {
switch (type) {
case "pressWithShift":
Schematic.Key.pressWithShift(keyNum, handler);
break;
case "down":
Schematic.Key.down(keyNum, handler);
break;
case "up":
Schematic.Key.up(keyNum, handler);
break;
case "press":
Schematic.Key.press(keyNum, handler);
break;
}
}
};
Schematic.Scheme = function(items, container, id) {
var pageHtml = tmpl(Schematic.Config.currentSchemeName+"Template", {items:items, id:id});
$(container).html(pageHtml);
};
Schematic.Source = function(displayName, dataSource, sourceType) {
var boxes = {},
collection = [],
collectionRoots = [],
dataArray = [],
tmpItems = [],
sourceLookup = {},
currentUrl = "",
currentItem = 0,
converterUrl = "/svc/widgets/dataservice.html?uri=",
built = false,
postRenderCallback = false;
this.prepare = function() {
jQuery("<div class='shrinkWrap' id='shrinkwrap-"+displayId()+"'></div>")
.appendTo("#scrollPlain");
};
this.requestData = function() {
if (dataSource && !built) {
built = true;
clearList();
fetch();
}
};
this.getNode = function() {
return $("#shrinkwrap-"+displayId());
};
this.expire = function() {
built = false;
};
this.empty = function() {
if (list()) {
window.setTimeout(clearList, 1500);
}
};
this.emptyFast = function() {
clearList();
};
this.setLayerLevel = function(num) {
wrapper().css("zIndex","2010"+num);
};
this.refresh = function() {
built = false;
this.requestData();
};
this.show = function() {
wrapper().show();
};
this.hide = function() {
wrapper().hide();
};
this.count = function() {
return dataArray.length;
};
this.visible = function() {
return wrapper().css("display") == "block";
};
this.slides = function() {
return list().find("li");
};
this.sourceType = function() {
return sourceType;
};
function fetch() {
dataArray = [];
if (window.CONVERTER_URL_OVERIDE) {
converterUrl = CONVERTER_URL_OVERIDE;
}
jQuery.getJSON(converterUrl+dataSource, function(data) {
try{
var items = data.channel.items.slice(0, 20);
} catch(e) {}
for (var i=0, len=items.length; i<len; i++) {
dataArray.push(extractItem(i, items[i]));
}
var scheme = new Schematic.Scheme(dataArray, wrapper(), displayId());
activateList();
});
}
function wrapper() {
return jQuery("#shrinkwrap-"+displayId());
}
function list() {
return jQuery("#set-"+displayId());
}
function displayId() {
return displayName.replace(/[^a-zA-Z0-9]/g,"");
}
function clearList() {
list().empty();
}
function extractItem(itemNumber, jsonNode) {
dataItem = {
link: jsonNode.link.split("?")[0]+"?src=sch",
title: jsonNode.title,
datePublished: jsonNode.pubDate,
byline: jsonNode["dc:creator"],
summary: jsonNode.description.replace(/\<span class=\"advertisement\"\>.*\<\/span\>/,"")
};
try {
dataItem.thumbnailUrl = jsonNode["media:content"]["url"];
} catch(e) {
dataItem.thumbnailUrl = null;
}
var baseUrlParts = dataItem.link.split("?");
var baseUrl = baseUrlParts[0];
return dataItem;
}
function activateList() {
list().find("li").each(function() {
var li = jQuery(this);
var index = list().find("li").index(li);
var itemData = dataArray[list().find("li").index(li)];
Schematic.Mouse.moveWithShift(li, function(target) {
showDetailView(target, itemData);
});
Schematic.Mouse.move(li, function(target) {
hideDetailView(target);
});
markArticleAge(li, itemData);
});
list().find("a").click(function(e) {
if (e.metaKey || e.shiftKey || e.ctrlKey) {
return true;
} else {
Schematic.application.openArticle(e.target.href);
}
return false;
});
Schematic.application.setStatusMessage("");
}
function showDetailView(node, data) {
node = jQuery(node);
var detailViewer = jQuery("#skimmerDetailView");
while (node.get(0).nodeName !== "LI") {
node = node.parent();
}
var width = node.width() + 40;
var height = node.height() + 40;
var offset = node.offset();
var top = offset.top - 20 - document.documentElement.scrollTop;
var left = offset.left - 20;
detailViewer.css({
"width": width+"px",
"top":top+"px",
"left":left+"px",
"min-height":height+"px"
}).html(node.html());
detailViewer.fadeIn("fast");
offset = detailViewer.offset();
height = detailViewer.height();
var viewportOverflow = (offset.top - document.documentElement.scrollTop + height) - window.innerHeight;
if (viewportOverflow > 0) {
detailViewer.css("top", top - viewportOverflow);
}
Schematic.Mouse.move(detailViewer, function() {
hideDetailView();
});
}
function hideDetailView() {
jQuery("#skimmerDetailView").hide();
}
function markArticleAge(li, data) {
var secs = Date.parse(data.datePublished);
var today = new Date();
var todaySecs = today.getTime();
var diff = todaySecs - secs;
var daysAgo = diff / 1000 / 60 / 60 / 24;
var subtractor = 0.05 * daysAgo;
if (subtractor > 0.5) {
subtractor = 0.5;
}
if ((diff / 1000 / 60 ) < 30) {
li.addClass("recent");
} else {
li.css("opacity", 1 - subtractor);
}
}
};
Schematic.Key = {
press : function(keyCode, fn) {
jQuery(document).keyup(function(evt) {
if (evt.which == keyCode && !evt.shiftKey) {
fn();
evt.preventDefault();
}
});
},
down : function(keyCode, fn) {
jQuery(document).keydown(function(evt) {
if (evt.which == keyCode) {
fn();
evt.preventDefault();
}
});
},
up : function(keyCode, fn) {
jQuery(document).keyup(function (evt) {
if (evt.which == keyCode) {
fn();
evt.preventDefault();
}
});
},
range : function(startKey, endKey, fn) {
jQuery(document).keydown(function(evt) {
if (evt.which >= startKey && evt.which <= endKey) {
fn(evt.which);
evt.preventDefault();
}
});
},
pressWithShift : function(keyCode, fn) {
jQuery(document).keyup(function(evt) {
if (evt.shiftKey && evt.which == keyCode) {
fn();
evt.preventDefault();
}
});
},
disableDefaults : function() {
jQuery(document).keypress(function(evt) {
if (!evt.metaKey) {
evt.preventDefault();
}
});
},
enableDefaults : function() {
jQuery(document).unbind("keypress");
}
};
Schematic.Mouse = {
move : function(node, fn) {
jQuery(node).mousemove(function(evt) {
if (!evt.shiftKey) {
fn(evt.target);
}
});
},
moveWithShift : function(node, fn) {
jQuery(node).mousemove( function(evt) {
if (evt.shiftKey) {
fn(evt.target);
}
});
}
};
// Initialize Application.
$(function() {
Schematic.application = new Schematic.Controller();
Schematic.application.start();
});
http://graphics8.nytimes.com/js/app/analytics/controller_v1.1.js
/*
$Id: controller_v1.1.js 7228 2008-12-15 18:00:14Z mbango $
*/
// SET GLOBAL VARS
var nyt_url = document.URL;
var nyt_domain = document.domain;
var nyt_path = window.location.pathname;
var wt_dcsidArray = {"General":"dcsym57yw10000s1s8g0boozt_9t1x",
"Homepage":"dcsa5pgfq10000c9zuysqk0lm_6i8y",
"World":"dcspjt2na00000wcnvo8wdaeo_7q9o",
"U.S.":"dcsypfq3j00000gsclwfljaeo_6i3w",
"Politics":"dcsa23rmv10000wowiejpwx86_4v7j",
"N.Y./Region":"dcsj5tb4n100000sl76culaeo_4f3w",
"Business":"dcsc32upj10000c58n7kgpaeo_8i3g",
"Technology":"dcs591klg00000c97pblfraeo_7p3p",
"Science":"dcsaon9rw0000008ifmgqtaeo_2f9c",
"Health":"dcsfj6l0t100008ijt0irzaeo_2k8f",
"Sports":"dcss4vytr000000kbuy6j8beo_6f7s",
"Opinion":"dcs5ydwfq100008me456mabeo_1z2v",
"Books":"dcss90tjf00000knzmux6hbeo_8r8y",
"Dance":"dcs9ihxq600000w842mebkbeo_9r6q",
"Movies":"dcsyoaqvl00000wc34qfambeo_4q3b",
"Music":"dcsrioyse100000kjghaqubeo_2d4x",
"TV":"dcsghn1j900000gs8yfgfwbeo_3r9l",
"Theater":"dcsxl9f4810000oub8mfiybeo_5l8v",
"Arts":"dcsnu1k8n00000oi2prv9fbeo_2w5s",
"T:Style":"dcs31c2fd10000w8wjmo22ceo_5x6n",
"Style":"dcs2dla2i00000431qkl70ceo_3j4r",
"Travel":"dcsktwey810000kfp9nsv3ceo_6n1r",
"Jobs":"dcsxmnyde100000oerlyk5ceo_6k5k",
"Real Estate":"dcsuvvccp000000sdtpzj7ceo_3j2x",
"Great Homes":"dcszwassu10000w8cogv42y86_8h8v",
"Autos":"dcs3i2ttw0000043xyk839ceo_2v6n",
"Classifieds":"dcso5eb2r10000cpz9bq5cceo_3j5e",
"Video":"dcs1j460r100008uw7es2eceo_6c4w",
"TimesSelect":"dcsqdkcdj100004zt5huzfceo_3b7v",
"Times Topics":"dcs3baftr1000008q5oxvjceo_4r9g",
"Member Center":"dcst9xior10000wo45l9anceo_4u9e",
"Crosswords/Games":"dcsepujaa100000s5bq9bpceo_7w6k",
"Sunday Magazine":"dcsrmsj6n10000wok933qrceo_1x8d",
"Most Popular":"dcsvmgcs910000o2ubv1z1deo_8b5s",
"Learning Network":"dcslh0e4x00000ggzmnn3ldeo_6f8k",
"Knowledge Network":"dcs69r7oi100004nscorwmdeo_7r4i",
"Week In Review":"dcsvfceih10000o610i65qdeo_7y5r",
"Weather":"dcsker4wf10000wszj8b32eeo_4m7u",
"News Tracker":"dcsa1h2mn00000oacf4of5eeo_5f2m",
"Multimedia":"dcsvs34dy000000chtbmk7eeo_3f9p",
"Cartoons / Humor":"dcsc1dh4600000oiajcqd9eeo_9l2m",
"Cartoons":"dcsc1dh4600000oiajcqd9eeo_9l2m",
"AP/Reuters":"dcs15dnk9100004r7jamfwu0p_3v8n",
"Search":"dcsmcntzl00000wwyhty30deo_8o2v",
"Blogrunner":"dcs9rqdr610000082j6e7xceo_1c8r",
"MyTimes":"dcsctlxlp10000chdjl4jlceo_2d1n",
"Times File":"dcs91tz2300000c1p17hs3eeo_4o7e",
"Email This":"dcsy6xxc210000g07639fkkvs_7b7o",
"Archive":"dcssxc7tw10000ggrcqca1cbr_1v1i",
"Olympics":"dcs3oivag100004zd9xgx1mfh_4f9w",
"Widget":"dcsoy2de300000ch9g4qg9oct_9j4x",
"Self Service":"dcs1tovv3100004rjcdl3h79j_7p9f"};
var wt_cgArray = {"aponline":"AP/Reuters",
"arts":"Arts",
"automobiles":"Autos",
"books":"Books",
"business":"Business",
"crosswords":"Crosswords/Games",
"dining":"Style",
"education":"U.S.",
"fashion":"Style",
"garden":"Style",
"greathomesanddestinations":"Great Homes",
"health":"Health",
"jobs":"Jobs",
"magazine":"Sunday Magazine",
"movies":"Movies",
"multimedia":"General",
"nyregion":"N.Y./Region",
"olympics":"Olympics",
"opinion":"Opinion",
"podcasts":"General",
"publiceditor":"Opinion",
"realestate":"Real Estate",
"reuters":"AP/Reuters",
"science":"Science",
"sports":"Sports",
"style":"Style",
"technology":"Technology",
"theater":"Theater",
"timestopics":"Times Topics",
"todayspaper":"General",
"travel":"Travel",
"us":"U.S.",
"washington":"U.S.",
"weekinreview":"Week in Review",
"world":"World"};
var wt_scgArray = {"design":"Art and Design",
"boxoffice":"Box Office",
"autoreviews":"New Cars",
"collectibles":"Collectibles",
"review":"Sunday Book Review",
"bestseller":"Best-Seller Lists",
"chapters":"First Chapters",
"media":"Media and Advertising",
"worldbusiness":"World Business",
"smallbusiness":"Small Business",
"yourmoney":"Your Money",
"research":"Research",
"nutrition":"Fitness and Nutrition",
"policy":"Money and Policy",
"views":"Views",
"guide":"Health Guide",
"currentreleases":"In Theaters",
"homevideo":"On DVD",
"criticspicks":"Critics Pick",
"thecity":"The City",
"nyregionspecial2":"The Region",
"nyregionopinions":"NY/Region Opinions",
"earth":"Environment",
"space":"Space and Cosmos",
"baseball":"Baseball",
"football":"Pro Football",
"ncaafootball":"College Football",
"basketball":"Pro Basketball",
"ncaabasketball":"College Basketball",
"hockey":"Hockey",
"soccer":"Soccer",
"golf":"Golf",
"tennis":"Tennis",
"othersports":"Other Sports",
"fashion":"Fashion",
"dining":"Dining",
"garden":"Home and Garden",
"weddings":"Weddings",
"tmagazine":"T Magazine",
"personaltech":"Personal Tech",
"broadway":"Broadway",
"offbroadway":"Off Broadway",
"offoffbroadway":"Off Off Broadway",
"london":"London",
"reviews":"Reviews",
"washington":"Washington",
"education":"Education",
"africa":"Africa",
"americas":"Americas",
"asia":"Asia Pacific",
"europe":"Europe",
"middleeast":"Middle East",
"editorials":"Editorials",
"contributors":"Contributors",
"nyregionopinions":"NY/Region Opinions",
"communities":"Communities",
"commercial":"Commercial",
"podcasts":"Podcasts",
"dealbookjobs":"Dealbook Jobs"};
// POPULATE META TAGS
// Get content group
var wt_contentGroup = getMetaTag("WT.cg_n");
var wt_cgTag;
if (wt_contentGroup == "") {
wt_cgTag = getMetaTag("CG");
wt_tempcontentGroup = wt_cgArray[wt_cgTag];
if (wt_tempcontentGroup != undefined) {
wt_contentGroup = wt_tempcontentGroup;
} else {
wt_contentGroup = wt_cgTag;
}
if (wt_contentGroup == "") {
wt_contentGroup = getContentGroup(nyt_url, nyt_domain, nyt_path);
}
}
// Get subcontent group
wt_scgTag = getMetaTag("SCG");
wt_tempsubcontentGroup = wt_scgArray[wt_scgTag];
if (wt_tempsubcontentGroup != undefined) {
wt_scgTag = wt_tempsubcontentGroup;
}
wt_subcontentGroup = wt_scgTag;
// Update content and subcontent groups
handleCGExceptions();
addMetaTag("WT.cg_n", wt_contentGroup);
addMetaTag("WT.cg_s", wt_subcontentGroup);
// Read generic tags from page
readPageTags();
// Get content specific info
setContentInfo();
// Set referrer info
setReferrerInfo();
// Set Section Front
setSectionFront();
// Set gdcsid (default to General if there is no match)
gdcsid = wt_dcsidArray[wt_contentGroup];
if (gdcsid == undefined) {
gdcsid = "dcsym57yw10000s1s8g0boozt_9t1x";
}
// Set dcsvid
var dcsvid;
if (dcsvid != undefined && dcsvid != "0") {
addMetaTag("WT.dcsvid", dcsvid);
}
// Set registration status
var regstatus;
if (regstatus != undefined) {
addMetaTag("WT.rv", (regstatus == "registered") ? "1" : "0");
}
// Set article information
var metaArticleId = getMetaTag("articleid");
if (metaArticleId != "" && getMetaTag("WT.z_gpst") != "Comments Overflow") {
setArticleInfo(metaArticleId);
} else {
setCommentOverflowInfo(metaArticleId);
}
// Set pub date range; NB - this needs to be after setArticleInfo
var pub_date = getMetaTag("WT.z_pud");
if (pub_date != "") {
setPubDateInfo(pub_date);
}
// Set interactive information
var tomMetaTag = getMetaTag("tom");
if (tomMetaTag == "interactive_graphic" || tomMetaTag == "interactive_feature") {
setInteractiveGraphicInfo();
}
// Set imagepages
if (/^\/imagepages/.test(nyt_path)) {
addMetaTag("PT", "Multimedia");
addMetaTag("PST", "Image");
}
// Set slideshow information
var tomMetaTag = getMetaTag("tom");
if ((tomMetaTag == "Slideshow") || (/^\/slideshow\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\//.test(nyt_path))) {
setSlideshowInfo();
}
// Set campaign information
var metaEmailCampId = getQueryParameter("emc");
addMetaTag("WT.mc_id", metaEmailCampId);
var externalCampId = getQueryParameter("excamp");
if (externalCampId != "") {
addMetaTag("WT.mc_id", externalCampId);
addMetaTag("WT.srch", "1");
}
if (getMetaTag("WT.mc_id") != "") {
addMetaTag("WT.mc_ev", "click");
}
// Set no_interstitial param
if (queryParameterExists("no_interstitial")) {
addMetaTag("WT.z_dirlnk", "1");
}
// Set the click tracking variable for specific pages
setTrackEvents();
// Set onsite search information
setSearchInfo();
// Set default information
setDefaultTags();
// Include WebTrends wtinit.js
var wtinitFile = js_host+"wtinit.js";
includeFile(wtinitFile);
// Include WebTrends wtbase.js
var wtbaseFile = js_host+"wtbase.js";
includeFile(wtbaseFile);
// FUNCTIONS
function getContentGroup(wt_url, wt_domain, wt_path) {
var contentGroup = getMetaTag("contentGroup");
if (contentGroup == "") {
// homepage
if(/^http:\/\/(www\.)?(nytimes|times)\.com\/(\/|index\.html|pages\/|pages\/partners\/aol\/homepage\/|yr\/mo\/day\/)?$/.test(wt_url)) {
contentGroup = "Homepage";
// world
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/\b(world|international)\b\//.test(wt_path)
|| /^\/international\//.test(wt_path)
|| /\/packages\/html\/\b(world|international)\b\//.test(wt_path)
|| /^\/\b(pages|ref|reuters|aponline|cfr)\b\/world\//.test(wt_path)) {
contentGroup = "World";
// politics
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/\b(us\/politics|politics)\b\//.test(wt_path)
|| /\/packages\/html\/politics\//.test(wt_path)
|| /^\/pages\/politics\//.test(wt_path)
|| /^\/yr\/mo\/day\/politics\//.test(wt_path)
|| /^\/politics\//.test(wt_path)
|| /^\/ref\/politics\//.test(wt_path)
|| /^\/ref\/us\/politics\//.test(wt_path)
|| /\/election-guide\//.test(wt_path)) {
contentGroup = "Politics";
// us
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/\b(us|education|washington|national)\b\//.test(wt_path)
|| /\/packages\/html\/\b(us|education|washington|national)\b\//.test(wt_path)
|| /^\/pages\/\b(us|education|washington|national)\b\//.test(wt_path)
|| /^\/yr\/mo\/day\/\b(us|education|washington|national)\b\//.test(wt_path)
|| /^\/\b(us|education|washington|national)\b\//.test(wt_path)
|| /^\/aponline\/us\//.test(wt_path)
|| /^\/reuters\/us\//.test(wt_path)
|| /^\/ref\/\b(us|education|washington|national)\b\//.test(wt_path)
|| /^\/cq\//.test(wt_path)) {
contentGroup = "U.S.";
// ny region - check this before opinion
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/nyregion\//.test(wt_path)
|| /^\/packages\/khtml\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/nyregion\//.test(wt_path)
|| /\/packages\/html\/nyregion\//.test(wt_path)
|| /^\/pages\/nyregion\//.test(wt_path)) {
contentGroup = "N.Y./Region";
// business
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/business\//.test(wt_path)
|| /\/packages\/html\/business\//.test(wt_path)
|| /^\/pages\/business\//.test(wt_path)
|| /^\/yr\/mo\/day\/business\//.test(wt_path)
|| /^\/business\//.test(wt_path)
|| /^\/aponline\/business\//.test(wt_path)
|| /^\/reuters\/business\//.test(wt_path)
|| /^\/ref\/business\//.test(wt_path)
|| /^\/allbusiness\//.test(wt_path)
|| /^\/inc_com\//.test(wt_path)) {
contentGroup = "Business";
// technology
} else if (wt_domain == "tech.nytimes.com"
|| wt_domain == "tech2.nytimes.com"
|| wt_domain == "download.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/technology\//.test(wt_path)
|| /\/packages\/html\/technology\//.test(wt_path)
|| /^\/pages\/technology\//.test(wt_path)
|| /^\/tech\//.test(wt_path)
|| /^\/aponline\/technology\//.test(wt_path)
|| /^\/reuters\/technology\//.test(wt_path)
|| /^\/ref\/technology\//.test(wt_path)
|| /^\/pages\/cnet\//.test(wt_path)
|| /^\/cnet\//.test(wt_path)
|| /^\/paidcontent\//.test(wt_path)
|| /^\/idg\//.test(wt_path)
|| (/^\/gst\/fullpage\.html/.test(wt_path) && getQueryParameter("sec") == "technology")) {
contentGroup = "Technology";
// science
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/science\//.test(wt_path)
|| /\/packages\/html\/science\//.test(wt_path)
|| /^\/ref\/science\//.test(wt_path)
|| /^\/pages\/science\//.test(wt_path)) {
contentGroup = "Science";
// health
} else if (wt_domain == "health.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/health\//.test(wt_path)
|| /\/packages\/html\/health\//.test(wt_path)
|| /^\/pages\/health\//.test(wt_path)
|| /^\/aponline\/health\//.test(wt_path)
|| /^\/reuters\/health\//.test(wt_path)
|| /^\/ref\/health\//.test(wt_path)) {
contentGroup = "Health";
// sports
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/sports\//.test(wt_path)
|| /\/packages\/html\/sports\//.test(wt_path)
|| /^\/yr\/mo\/day\/sports\//.test(wt_path)
|| /^\/sports\//.test(wt_path)
|| /^\/pages\/sports\//.test(wt_path)
|| /^\/aponline\/sports\//.test(wt_path)
|| /^\/reuters\/sports\//.test(wt_path)) {
contentGroup = "Sports";
// opinion
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/opinion\//.test(wt_path)
|| /\/packages\/html\/opinion\//.test(wt_path)
|| /^\/pages\/opinion\//.test(wt_path)
|| /^\/pages\/readersopinions\//.test(wt_path)
|| /^\/opinion\//.test(wt_path)
|| /^\/top\/opinion\//.test(wt_path)
|| /^\/ref\/opinion\//.test(wt_path)) {
contentGroup = "Opinion";
// books
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/books\//.test(wt_path)
|| /\/packages\/html\/books\//.test(wt_path)
|| /^\/pages\/books\//.test(wt_path)
|| /^\/ref\/books\//.test(wt_path)) {
contentGroup = "Books";
// dance
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/arts\/dance\//.test(wt_path)
|| /\/packages\/html\/dance\//.test(wt_path)
|| /^\/pages\/arts\/dance\//.test(wt_path)) {
contentGroup = "Dance";
// movies
} else if (wt_domain == "movies.nytimes.com"
|| wt_domain == "movies2.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/movies\//.test(wt_path)
|| /\/packages\/html\/movies\//.test(wt_path)
|| /^\/pages\/movies\//.test(wt_path)
|| /^\/ref\/movies\//.test(wt_path)) {
contentGroup = "Movies";
// music
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/arts\/music\//.test(wt_path)
|| /\/packages\/html\/music\//.test(wt_path)
|| /^\/pages\/arts\/music\//.test(wt_path)) {
contentGroup = "Music";
// television
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/arts\/television\//.test(wt_path)
|| /\/packages\/html\/television\//.test(wt_path)
|| /^\/pages\/arts\/television\//.test(wt_path)) {
contentGroup = "TV";
// theater
} else if (wt_domain == "theater.nytimes.com"
|| wt_domain == "theater2.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/theater\//.test(wt_path)
|| /\/mem\/theater\//.test(wt_path)
|| /\/mem\/ticketwatch\.html/.test(wt_path)
|| /\/packages\/html\/theater\//.test(wt_path)
|| /^\/pages\/theater\//.test(wt_path)
|| /^\/readersreviews\/theater\//.test(wt_path)) {
contentGroup = "Theater";
// art - must appear after its subsections
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/arts\//.test(wt_path)
|| /\/packages\/html\/arts\//.test(wt_path)
|| /^\/aponline\/arts\//.test(wt_path)
|| /^\/reuters\/arts\//.test(wt_path)
|| /^\/pages\/arts\//.test(wt_path)) {
contentGroup = "Arts";
// tstyle - check this before style
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/style\/\b(t|tmagazine)\b\//.test(wt_path)
|| /^\/pages\/style\/(t|tmagazine)\//.test(wt_path)) {
contentGroup = "T:Style";
// style
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/\b(style|fashion|dining|garden)\b\//.test(wt_path)
|| /\/packages\/html\/\b(style|fashion|dining|garden)\b\//.test(wt_path)
|| /^\/pages\/\b(style|fashion|dining|garden)\b\//.test(wt_path)
|| /^\/ref\/fashion\//.test(wt_path)) {
contentGroup = "Style";
// travel
} else if (wt_domain == "travel.nytimes.com"
|| wt_domain == "travel2.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/travel\//.test(wt_path)
|| /^\/pages\/travel\//.test(wt_path)
|| /^\/travel\//.test(wt_path)
|| /^\/map\/travel\//.test(wt_path)
|| /^\/packages\/html\/travel\//.test(wt_path)
|| /^\/gst\/travel\/travsearch\.html/.test(wt_path)
|| (/^\/gst\/fullpage\.html/.test(wt_path) && getQueryParameter("sec") == "travel")) {
contentGroup = "Travel";
// jobs
} else if (wt_domain == "jobmarket.nytimes.com"
|| wt_domain == "salary.nytimes.com"
|| /\/packages\/html\/jobs\//.test(wt_path)
|| /^\/pages\/jobs\//.test(wt_path)
|| /^\/marketing\/jobmarket\//.test(wt_path)) {
contentGroup = "Jobs";
// greathomes
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/\b(realestate\/greathomes|greathomesanddestinations)\b\//.test(wt_path)
|| /^\/pages\/great-homes-and-destinations\//.test(wt_path)
|| /^\/pages\/greathomes\//.test(wt_path)
|| /^\/top\/great-homes-and-destinations\//.test(wt_path)) {
contentGroup = "Real Estate";
// realestate
} else if (wt_domain == "realestate.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/realestate\//.test(wt_path)
|| /\/packages\/html\/realestate\//.test(wt_path)
|| /^\/pages\/realestate\//.test(wt_path)
|| /^\/ref\/realestate\//.test(wt_path)) {
contentGroup = "Real Estate";
// autos
} else if (wt_domain == "autos.nytimes.com"
|| wt_domain == "collectiblecars.nytimes.com"
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/automobiles\//.test(wt_path)
|| /^\/pages\/automobiles\//.test(wt_path)
|| /^\/ref\/automobiles\//.test(wt_path)
|| /^\/automobiles\//.test(wt_path)
|| /^\/autos\//.test(wt_path)
|| /^\/packages\/html\/automobiles\//.test(wt_path)) {
contentGroup = "Autos";
// search
} else if (/^\/search\/query/.test(wt_path)) {
contentGroup = "Search";
// classifieds
} else if (wt_domain == "listings.nytimes.com"
|| wt_domain == "placead.nytimes.com"
|| /^\/top\/classifieds\//.test(wt_path)
|| /^\/gst\/personals.html/.test(wt_path)) {
contentGroup = "Classifieds";
// video
} else if (wt_domain == "video.on.nytimes.com") {
contentGroup = "Video";
// timestopics
} else if (/^\/top\/reference\/timestopics\//.test(wt_path)
|| /^\/top\/news\/business\//.test(wt_path)
|| /^\/top\/news\/international\//.test(wt_path)
|| /^\/top\/news\/national\//.test(wt_path)
|| /^\/top\/classifieds\/realestate\//.test(wt_path)) {
contentGroup = "Times Topics";
// email this
} else if (/^\/mem\/emailthis.html/.test(wt_path)) {
contentGroup = "Email This";
// newstracker
} else if (/^\/mem\/tnt.html/.test(wt_path)) {
contentGroup = "News Tracker";
// membercenter
} else if (/^\/membercenter\//.test(wt_path)
|| /^\/mem\/email\.html/.test(wt_path)
|| /^\/mem\/profile\.html/.test(wt_path)
|| /^\/ref\/membercenter\//.test(wt_path)
|| /^\/auth\/login/.test(wt_path)
|| /^\/forgot/.test(wt_path)
|| /^\/commerce\/jsp\//.test(wt_path)
|| /^\/gst\/(regi|forgot|confirmem|betamail|signout|purchase_gc)\.html/.test(wt_path)) {
contentGroup = "Member Center";
// crosswordsgames
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/crosswords\//.test(wt_path)
|| /^\/pages\/crosswords\//.test(wt_path)
|| /^\/ref\/crosswords\//.test(wt_path)
|| /^\/premium\/xword\//.test(wt_path)
|| /^\/premiumproducts\/crosswords\/index.html/.test(wt_path)) {
contentGroup = "Crosswords/Games";
// sundaymagazine
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/magazine\//.test(wt_path)
|| /^\/pages\/magazine\//.test(wt_path)
|| /^\/ref\/magazine\//.test(wt_path)
|| /^\/packages\/html\/magazine\//.test(wt_path)) {
contentGroup = "Sunday Magazine";
// mostpopular
} else if (/^\/gst\/most(popular|emailed|blogged|searched|popularmovies)\.html/.test(wt_path)) {
contentGroup = "Most Popular";
// learningnetwork
} else if (/^\/learning\//.test(wt_path)
|| /\/packages\/html\/learning\//.test(wt_path)) {
contentGroup = "Learning Network";
// knowledgenetwork
} else if (wt_domain == "college.nytimes.com"
|| /\/packages\/html\/college\//.test(wt_path)
|| /^\/college\//.test(wt_path)
|| /\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/college\//.test(wt_path)) {
contentGroup = "Knowledge Network";
// weekinreview
} else if (/\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/weekinreview\//.test(wt_path)
|| /\/packages\/html\/weekinreview\//.test(wt_path)
|| /^\/pages\/weekinreview\//.test(wt_path)
|| /^\/weekinreview\//.test(wt_path)) {
contentGroup = "Week In Review";
// weather
} else if (/^\/gst\/weather.html/.test(wt_path)
|| /^\/mem\/weather.html/.test(wt_path)
|| /\/packages\/html\/weather\//.test(wt_path)
|| /^\/weather/.test(wt_path)) {
contentGroup = "Weather";
// multimedia
} else if (/^\/pages\/multimedia\//.test(wt_path)
|| /\/packages\/html\/multimedia\//.test(wt_path)
|| /^\/ref\/multimedia\//.test(wt_path)) {
contentGroup = "Multimedia";
// cartoons
} else if (/^\/pages\/cartoons\//.test(wt_path)
|| /\/packages\/html\/cartoons\//.test(wt_path)) {
contentGroup = "Cartoons";
// apreuters
} else if (/^\/pages\/\b(aponline|reuters)\b\//.test(wt_path)) {
contentGroup = "AP/Reuters";
// pictures of the day
} else if (/^\/slideshow\/[0-9][0-9][0-9][0-9]\/[0-1][0-9]\/[0-3][0-9]\/nytfrontpage\//.test(wt_path)) {
contentGroup = "Homepage";
// selfservice
} else if (wt_domain == "nytimes.adready.com") {
contentGroup = "Self Service";
// default to General
} else {
contentGroup = "General";
}
}
return contentGroup;
}
function readPageTags() {
addMetaTag("WT.z_gpt", getMetaTag("PT")); // page type
addMetaTag("WT.z_gpst", getMetaTag("PST")); // page subtype
addMetaTag("WT.z_gpsst", getMetaTag("PSST")); // page sub 2 type
addMetaTag("WT.z_gpssst", getMetaTag("PSSST")); // page sub 3 type
addMetaTag("WT.z_pc", getMetaTag("PC")); // partner content
addMetaTag("WT.z_ps", getMetaTag("PS")); // partner supplied
addMetaTag("WT.z_puv", getMetaTag("PUV")); // publish view
addMetaTag("WT.z_gosst", getMetaTag("GOOST")); // global onsite search
addMetaTag("WT.z_gosst", getMetaTag("GOSST")); // global onsite search
addMetaTag("WT.z_gsac", getMetaTag("GSAC")); // global search auto complete
addMetaTag("WT.z_gtn", getMetaTag("GTN")); // global topic name
addMetaTag("WT.gcom", getMetaTag("GCOM")); // global - community page
addMetaTag("WT.z_clmst", getMetaTag("CLMST")); // blogs off About
addMetaTag("WT.z_bn", getMetaTag("BN")); // blogs off About
addMetaTag("WT.z_pud", getMetaTag("PUD")); // blogs off About
addMetaTag("WT.z_tvt", getMetaTag("TVT")); // travel meta tag
addMetaTag("WT.z_tvn", getMetaTag("TVN")); // travel meta tag
addMetaTag("WT.z_tvid", getMetaTag("TVID")); // travel meta tag
addMetaTag("WT.z_tDest", getMetaTag("TDES")); // travel meta tag
addMetaTag("WT.z_tRegion",getMetaTag("TDREG")); // travel meta tag
addMetaTag("WT.cre", getMetaTag("cre")); // creator meta tag
addMetaTag("WT.z_nyts", getCookie("NYT-S")); // NYT-S cookie
addMetaTag("WT.z_nytd", getCookie("nyt-d")); // nyt-d cookie
addMetaTag("WT.z_rmid", getCookie("RMID")); // RMID cookie
addMetaTag("WT.z_gblc", getMetaTag("GBLC")); // global - blogs
addMetaTag("WT.z_hpt", getMetaTag("HPT")); // home page type - Extra
}
function getCookie ( cookie_name )
{
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
if ( results )
return ( unescape ( results[2] ) );
else
return null;
}
function setContentInfo() {
// read page tags for content groups
if (wt_contentGroup == "Health") {
addMetaTag("WT.z_hgst", getMetaTag("HGST")); // health guide subject type
addMetaTag("WT.z_hgsn", getMetaTag("HGSN")); // health guide subject name
} else if (wt_contentGroup == "Times Topics") {
addMetaTag("WT.z_gpt", "Topic");
} else if (wt_contentGroup == "Books") {
addMetaTag("WT.z_bper", getMetaTag("per"));
addMetaTag("WT.z_ebk", getMetaTag("ttl"));
} else if (wt_contentGroup == "Real Estate" || wt_contentGroup == "Great Homes") {
addMetaTag("WT.z_resz", getMetaTag("RESZ")); // real estate search zip codes
addMetaTag("WT.z_res", getMetaTag("RES")); // real estate state
addMetaTag("WT.z_reco", getMetaTag("RECO")); // real estate counties
addMetaTag("WT.z_rer", getMetaTag("RER")); // real estate region
} else if (wt_contentGroup == "Theater") {
addMetaTag("WT.z_eplay", getMetaTag("ttl"));
} else if (wt_contentGroup == "Travel") {
includeFile(js_host+"content/travel_v1.1.js");
} else if (wt_contentGroup == "Movies") {
includeFile(js_host+"content/movies_v1.1.js");
} else if (wt_contentGroup == "Member Center") {
includeFile(js_host+"content/membercenter_v1.1.js");
} else if (wt_contentGroup == "Email This") {
includeFile(js_host+"content/emailthis_v1.1.js");
}
}
function setReferrerInfo() {
var refUrl = document.referrer;
if (refUrl != undefined && refUrl != "" ) {
var refDom = refUrl.match( /:\/\/(www\.)?([^\/:]+)/ );
refDom = refDom[2]?refDom[2]:'';
addMetaTag("WT.z_ref", refDom);
addMetaTag("WT.z_sorg", isSearchEngine(refDom));
}
}
function getReferrerQuery() {
var refQuery = "";
var url_parts = document.referrer.split('?');
if (url_parts[1]){
var url_args = url_parts[1].split('&');
for(var i=0; i<url_args.length; i++){
var keyval = url_args[i].split('=');
if (keyval[0] == 'q'){
refQuery = keyval[1];
}
}
}
return refQuery;
}
function isSearchEngine(refDom) {
var refType = "";
if((/google\./.test(refDom) && getReferrerQuery() != "")
||(/search\./.test(refDom))
||(/ask.com/.test(refDom))
||(/altavista.com/.test(refDom))) {
refType = "1";
}
return refType;
}
function handleCGExceptions() {
// promote to content group
if (wt_subcontentGroup == "dance") {
wt_contentGroup = "Dance";
wt_subcontentGroup = "";
} else if (wt_subcontentGroup == "music") {
wt_contentGroup = "Music";
wt_subcontentGroup = "";
} else if (wt_subcontentGroup == "television") {
wt_contentGroup = "TV";
wt_subcontentGroup = "";
} else if (wt_subcontentGroup == "olympics") {
wt_contentGroup = "Olympics";
wt_subcontentGroup = "";
} else if (wt_subcontentGroup == "politics") {
wt_contentGroup = "Politics";
wt_subcontentGroup = "";
}
// demote to subcontent group
if (wt_cgTag == "education") {
wt_subcontentGroup = "Education";
} else if (wt_cgTag == "washington") {
wt_subcontentGroup = "Washington";
} else if (wt_cgTag == "fashion") {
wt_subcontentGroup = "Fashion";
} else if (wt_cgTag == "dining") {
wt_subcontentGroup = "Dining";
} else if (wt_cgTag == "garden") {
wt_subcontentGroup = "Garden";
} else if ((wt_cgTag == "Your Money") || (wt_cgTag == "your-money")) {
if(getMetaTag("PT") == "Article") { addMetaTag("WT.z_gtn", wt_subcontentGroup); }
wt_contentGroup = "Business";
wt_subcontentGroup = "Your Money";
}
// rewrite content group based on subcontentgroup
if (wt_scgTag == "Weddings") {
wt_contentGroup = "Style";
wt_subcontentGroup = "Weddings";
}
if (wt_subcontentGroup == "Dealbook Jobs") {
wt_contentGroup = "Business";
}
// rewrite content group
if (wt_cgTag == "xword") {
wt_contentGroup = "Crosswords/Games";
}
}
function setSectionFront() {
if ( (getMetaTag("WT.z_gpt") == "Section Front") && getMetaTag("WT.cg_s")) {
tempWTVal = "Subsection Front";
addMetaTag("WT.z_gpst", "Subsection Front");
}
}
function setInteractiveGraphicInfo() {
addMetaTag("WT.z_gpt", "Multimedia");
addMetaTag("WT.z_gpst", "Flash");
addMetaTag("WT.z_pud", getMetaTag("pdate"));
}
function setSlideshowInfo() {
addMetaTag("WT.z_gpt", "Multimedia");
addMetaTag("WT.z_gpst", "Slideshow");
addMetaTag("WT.z_pud", getMetaTag("pdate"));
}
function setArticleInfo(articleID) {
if (articleID != "") {
addMetaTag("WT.z_gpt", "Article");
addMetaTag("WT.z_gpst", getMetaTag("tom"));
addMetaTag("WT.z_hdl", getMetaTag("hdl"));
addMetaTag("WT.z_aid", articleID);
var pubDate = getMetaTag("pdate");
addMetaTag("WT.z_pud", pubDate);
addMetaTag("WT.z_put", "web");
var pubType = getPubTypeFromDate(pubDate);
addMetaTag("WT.z.gsg", pubType);
if (pubType == "Archive") {
addMetaTag("WT.z_gat", "1987-Present");
}
addMetaTag("WT.z_pua", "free");
var bylVal = getMetaTag("byl");
bylVal = bylVal.replace("&#8217;","'");
if (bylVal.indexOf("By ") != -1) {
bylVal = bylVal.substring(3);
bylValInd = bylVal.indexOf(" and ");
if (bylValInd != -1) {
bylVal = bylVal.substring(0, bylValInd) + ";" + bylVal.substring(bylValInd+5);
}
}
addMetaTag("WT.z_clmst", bylVal);
setXTS(bylVal);
var pageWanted = getQueryParameter("pagewanted");
if (pageWanted == "") {
addMetaTag("WT.z_puv", "Normal");
} else {
addMetaTag("WT.z_puv", pageWanted);
}
}
}
function setPubDateInfo(pdate) {
setPubDateRange(pdate);
addMetaTag("WT.z_pyr", pdate.substring(0, 4));
}
function setPubDateRange(pdate) {
var relativePubDate = "No Pub Date";
var currentDate = new Date();
var currentDateMs = currentDate.getTime();
var pubDate = new Date();
if (pdate.length==8) {
var tYear = pdate.substring(0,4);
var tMonth = pdate.substring(4,6);
var tDay = pdate.substring(6,8);
pubDate.setFullYear(tYear,tMonth-1,tDay);
}
var pubDateMs = pubDate.getTime();
var publicDomainStartDate = new Date();
publicDomainStartDate.setYear(1851);
publicDomainStartDate.setMonth(0);
publicDomainStartDate.setDate(1);
var publicDomainStartDateMs = publicDomainStartDate.getTime();
var payArchiveStartDate = new Date();
payArchiveStartDate.setYear(1923);
payArchiveStartDate.setMonth(0);
payArchiveStartDate.setDate(1);
var payArchiveStartDateMs = payArchiveStartDate.getTime();
var payArchiveEndDate = new Date();
payArchiveEndDate.setYear(1986);
payArchiveEndDate.setMonth(11);
payArchiveEndDate.setDate(31);
var payArchiveEndDateMs = payArchiveEndDate.getTime();
var dateDiffMs = currentDateMs - pubDateMs;
if(dateDiffMs < 0) {
relativePubDate = "Tomorrow";
} else if(0 <= dateDiffMs && dateDiffMs < 86400000) {
relativePubDate = "Same Day";
} else if(86400000 <= dateDiffMs && dateDiffMs < 172800000) {
relativePubDate = "1 Day";
} else if(172800000 <= dateDiffMs && dateDiffMs < 259200000) {
relativePubDate = "2 Day";
} else if(259200000 <= dateDiffMs && dateDiffMs < 345600000) {
relativePubDate = "3 Day";
} else if(345600000 <= dateDiffMs && dateDiffMs < 432000000) {
relativePubDate = "4 Day";
} else if(432000000 <= dateDiffMs && dateDiffMs < 518400000) {
relativePubDate = "5 Day";
} else if(518400000 <= dateDiffMs && dateDiffMs < 604800000) {
relativePubDate = "6 Day";
} else if(604800000 <= dateDiffMs && dateDiffMs < 691200000) {
relativePubDate = "7 Day";
} else if(691200000 <= dateDiffMs && dateDiffMs < 2678400000) {
relativePubDate = "Month";
} else if(2678400000 <= dateDiffMs && dateDiffMs < 7776000000) {
relativePubDate = "90 Day";
} else if(7776000000 <= dateDiffMs && dateDiffMs < 31536000000) {
relativePubDate = "1 Year";
} else if(31536000000 <= dateDiffMs && dateDiffMs < 157680000000) {
relativePubDate = "5 Years";
} else if(157680000000 <= dateDiffMs && dateDiffMs < 315360000000) {
relativePubDate = "10 Years";
} else if(315360000000 <= dateDiffMs && pubDateMs > payArchiveEndDateMs) {
relativePubDate = "Post 86";
} else if(315360000000 <= dateDiffMs && (payArchiveStartDateMs <= pubDateMs && pubDateMs <= payArchiveEndDateMs)) {
relativePubDate = "Pay Archive";
} else if(315360000000 <= dateDiffMs && (publicDomainStartDateMs <= pubDateMs && pubDateMs <= payArchiveStartDateMs)) {
relativePubDate = "Public Domain";
}
addMetaTag("WT.z_pudr", relativePubDate);
}
function setCommentOverflowInfo(articleID) {
addMetaTag("WT.z_aid", articleID);
addMetaTag("WT.z_hdl", getMetaTag("hdl"));
if (getMetaTag("WT.z_gpst") == "Comments Overflow") {
addMetaTag("WT.gcom", "Com");
}
// Set article comment page number
addMetaTag("WT.z_acpn", getMetaTag("ACPN"));
// Set article comment overview sort
addMetaTag("WT.z_acos", getMetaTag("ACOS"));
}
function getPubTypeFromDate(pdate) {
if (pdate != undefined && pdate.length == 8) {
var currentDate = new Date();
var articleDate = new Date();
articleDate.setDate(pdate.substring(6));
articleDate.setMonth(pdate.substring(4,6)-1);
articleDate.setFullYear(pdate.substring(0,4));
if (articleDate < currentDate) {
return "Archive";
} else {
return "web";
}
} else {
return "web";
}
}
function setXTS(clmst) {
if (/DAVID BROOKS/.test(clmst)
||/MAUREEN DOWD/.test(clmst)
||/ROGER COHEN/.test(clmst)
||/THOMAS L. FRIEDMAN/.test(clmst)
||/BOB HERBERT/.test(clmst)
||/NICHOLAS D. KRISTOF/.test(clmst)
||/PAUL KRUGMAN/.test(clmst)
||/FRANK RICH/.test(clmst)
||/DAVE ANDERSON/.test(clmst)
||/PETER APPLEBOME/.test(clmst)
||/HARVEY ARATON/.test(clmst)
||/DAN BARRY/.test(clmst)
||/JIM DWYER/.test(clmst)
||/CLYDE HABERMAN/.test(clmst)
||/ADAM LIPTAK/.test(clmst)
||/GRETCHEN MORGENSON/.test(clmst)
||/JOE NOCERA/.test(clmst)
||/JOSEPH NOCERA/.test(clmst)
||/FLOYD NORRIS/.test(clmst)
||/WILLIAM C. RHODEN/.test(clmst)
||/SELENA ROBERTS/.test(clmst)
||/GEORGE VECSEY/.test(clmst)
||/JOHN VINOCUR/.test(clmst)) {
addMetaTag("WT.z_gts", "XTS");
}
}
function setSearchInfo() {
var searchResults;
var wt_oss = "";
var wt_oss_r = "";
var wt_gosst = "";
var ossName = "";
var ossrName = "";
// for global searches
if (/^\/search\/query/.test(nyt_path)) {
wt_oss = getQueryParameter("query");
searchResults = document.getElementById("sortBy");
wt_gosst = getQueryParameter("srchst");
ossName = "WT.oss";
ossrName = "WT.oss_r";
}
// for tech search only
if (/\/gst\/technology\/techsearch.html/.test(nyt_path)) {
wt_oss = getQueryParameter("query");
searchResults = getElementsByClass("div", "result_summary");
ossName = "WT.z_toss";
ossrName = "WT.z_toss_r";
}
// for movie search only
if (/\/gst\/movies\/msearch.html/.test(nyt_path)) {
wt_oss = getQueryParameter("query");
searchResults = document.getElementById("resultsWell");
ossName = "WT.z_moss";
ossrName = "WT.z_moss_r";
}
// for health search only
if (/\/gst\/health\/healthsearch.html/.test(nyt_path)) {
wt_oss = getQueryParameter("query");
if (wt_oss == "") {
wt_oss = getQueryParameter("term");
}
searchResults = document.getElementById("sortBy");
ossName = "WT.z_hoss";
ossrName = "WT.z_hoss_r";
}
if (null == searchResults) {
wt_oss_r = "0";
} else {
wt_oss_r = "1";
if (wt_oss == "" ) {
wt_oss = "No Term";
}
}
if (wt_oss != "") {
addMetaTag(ossName, wt_oss);
addMetaTag(ossrName, wt_oss_r);
}
if (wt_gosst != "") {
var wt_osstArray = {"nyt":"Search > Articles 1981-Present",
"p":"Search > Articles 1851-1980",
"g":"Search > Google Web Results",
"m":"Search > Multimedia",
"nycks":"Search > NYC Events & Venues",
"ref":"Search > Reference",
"blog":"Search > Blogs"}
var searchType = wt_osstArray[wt_gosst];
if (searchType == undefined) {
searchType = wt_gosst;
}
addMetaTag("WT.z_gosst", searchType);
}
}
function setTrackEvents() {
var wt_section = getMetaTag("WT.cg_n");
var wt_subsection = getMetaTag("WT.cg_s");
var wt_pagetype = getMetaTag("WT.z_gpt");
var wt_pagesubtype = getMetaTag("WT.z_gpst");
if ((wt_pagetype == "Homepage" && wt_pagesubtype != "Times Extra") ||
(wt_section == "Technology" && wt_pagetype == "Section Front") ||
(wt_section == "Autos" && wt_pagetype == "Section Front") ||
(wt_section == "Search" && wt_subsection == "nyt")) {
gtrackevents = true;
}
}
// helper functions used by this and other content javascript files
function addMetaTag(tagName, tagContent) {
var tempValue = getMetaTag(tagName);
if (tempValue == "") {
tempValue = getQueryParameter(tagName);
}
if (tempValue == "" && tagContent != "") {
var newMetaTag = document.createElement('meta');
newMetaTag.id = tagName;
newMetaTag.name = tagName;
newMetaTag.content = tagContent;
document.getElementsByTagName('head').item(0).appendChild(newMetaTag);
}
}
function overwriteMetaTag(tagName, tagContent) {
var newMetaTag = document.createElement('meta');
newMetaTag.name = tagName;
newMetaTag.content = tagContent;
document.getElementsByTagName('head').item(0).appendChild(newMetaTag);
}
function getMetaTag(tagName) {
var metaTagContent = "";
var metaTagElement = document.getElementById(tagName);
var tempString = "";
if (metaTagElement == null || metaTagElement == undefined) {
var metaTags = document.getElementsByTagName("meta");
for(var i=0;i<metaTags.length;i++) {
if(metaTags[i].name == tagName) {
metaTagContent = metaTags[i].content;
}
}
} else {
metaTagContent = metaTagElement.content;
}
return metaTagContent;
}
function getQueryParameter(name) {
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) {
return "";
} else {
return results[1];
}
}
function queryParameterExists(name) {
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name;
var regex = new RegExp( regexS );
return regex.test( window.location.href );
}
function setDefaultTags() {
if (getMetaTag("WT.z_gpt") == "") {
addMetaTag("WT.z_gpt", "Other");
}
}
function getElementsByClass(tagName, className) {
var resultArray = new Array();
var classRegExp = new RegExp('\\b'+className+'\\b');
var elementsByTag = document.getElementsByTagName(tagName);
for(var i=0,j=elementsByTag.length; i<j; i++) {
if(classRegExp.test(elementsByTag[i].className)) {
resultArray.push(elementsByTag[i]);
}
}
if (resultArray.length == 0) resultArray = null;
return resultArray;
}
function includeFile(incFilename) {
var incFileJS = document.createElement('script');
incFileJS.setAttribute('language', 'javascriptcontent');
incFileJS.setAttribute('type', 'text/javascript');
incFileJS.setAttribute('src', incFilename);
document.getElementsByTagName('head').item(0).appendChild(incFileJS);
}
s_code_linktrack = s_code_linktrack_classifieds = s_code_linktrack_indiv = function(desc) {
try { dcsMultiTrack('DCS.dcssip', 'www.nytimes.com', 'DCS.dcsuri', '/' + desc + '.html', 'WT.ti', desc, 'WT.z_dcsm', '1'); }
catch(err) { }
}
http://graphics8.nytimes.com/js/app/analytics/gw.js?csid=H07707
/*
* Build version UW-11.1.0-94
*/
var rsi_k;
var rsi_now = new Date();
var rsi_csid = 'H07707';
//<!--
// v3 //
// Start Config //
var DM_CSID = "H07707";
var DM_PIX = "pix01.revsci.net";
var DM_DREF = 0;
var DM_MULT = 0;
var DM_REF_ON = 1;
var DM_TIT_ON = 0;
// End Config //
var DM_TEST = 0;var _DM_DTE = new Date();var _DM_UDC = document;var _DM_CHR = null;var _DM_sImg = new Array();var _DM_hexc = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");var _DM_BCL1 = "?&=%.()";var _DM_GCL2 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";var _DM_TGID = "b" + _DM_hexc[(DM_TEST<<3 | 0x3)];var _DM_EURI = typeof(encodeURIComponent)=="function";var _DM_CCA = typeof("".charCodeAt)=="function";for(_DM_CHR="",i=0;i<256;i++) { _DM_CHR += String.fromCharCode(i); }var _DM_ASCII = _DM_CHR.substr(0,128);var _DM_UTZ = (-1*_DM_DTE.getTimezoneOffset())+720;var _DM_CNV, _DM_LOC, _DM_REF;var _DM_CLD = 0;_DM_rstReq();function DM_tag() { if (_DM_CLD == 0 || DM_MULT == 1) { _DM_CLD = 1; if(DM_DREF==1) { _DM_addNV("DM_LOC",_DM_encd(_DM_REF,_DM_BCL1,0)); } else { _DM_addNV("DM_LOC",_DM_encd(_DM_LOC,_DM_BCL1,0)); } if(DM_REF_ON==1){ _DM_addNV("DM_REF",_DM_encd(_DM_REF,_DM_BCL1,0)); } if(DM_TIT_ON==1){ _DM_addNV("DM_TIT",_DM_encd(_DM_UDC.title.toString(),_DM_BCL1,0)); } _DM_CNV+="&DM_EOM=1"; _DM_pack(_DM_CNV); } _DM_rstReq();}function _DM_pack(d) { var rdte = new Date(); var rid = _DM_toHex(Math.floor(rdte)); var bse="",hdr="",dat=""; var prt=location.protocol+"//"; var mrl=2000,usd=0; d=_DM_encd(d,_DM_GCL2,1); hdr="/"+DM_CSID+"/"+_DM_TGID+"/0/3/"+_DM_UTZ+"/1/0/"+rid+"/0/0/00000000"; bse="/"+Math.floor(Math.random()*Math.pow(10,9))+".gif?D="; usd=(prt+DM_PIX+hdr+bse).length; dat=d.substr(0,(mrl-usd-(d.charAt(mrl-usd-1)=='%'?1:(d.charAt(mrl-usd-2)=='%'?2:0)))); _DM_ship(_DM_toHex(Math.floor(Math.random()*Math.pow(10,9))),prt,DM_PIX,hdr+bse+dat,0); return 1;}function _DM_ship(srl,p,s1,u,t) { _DM_sImg[srl]=new Image(2,3); _DM_sImg[srl].src = p+s1+u;}function _DM_addNV(n,v) { _DM_CNV += (_DM_CNV?"&":"")+n+"="+v; }function _DM_hexesc(i) { return "%"+_DM_pad(_DM_toHex(i),2);}function _DM_esc(c) { if(_DM_EURI){ return encodeURIComponent(c); }else{ var ci=_DM_CCA?c.charCodeAt(0):_DM_CHR.indexOf(c); if(ci<0){ return ""; } if(ci<=0x007f){ return _DM_hexesc(ci); }else if(ci<=0x07ff){ return _DM_hexesc(0xc0|(ci>>6))+_DM_hexesc(0x80|(ci&0x3f)); }else{ return _DM_hexesc(0xe0|(ci>>12))+_DM_hexesc(0x80|((ci>>6)&0x3f))+_DM_hexesc(0x80|(ci&0x3f)); } }}function _DM_encd(s,chrs,b){ for(var i=0,ns="",c="";i<s.length;i++){ c=s.charAt(i); if((b==1 ? chrs.indexOf(c)>=0 : chrs.indexOf(c)<0)){ ns+=c; }else{ ns+=_DM_esc(c); } } return ns;}function _DM_asciiOnly(s){ for (var i=0,ns="",c="";i<s.length;++i){ c=s.charAt(i); if(_DM_ASCII.indexOf(c)>=0) ns+=c; } return ns;}function _DM_appendToUrl(u,n,v) { return u+((u.indexOf("?")==-1)?"?":"&")+_DM_asciiOnly(n)+"="+_DM_asciiOnly(v);}function _DM_toHex(n){ var rmd=0,quo=0,hex=""; if(n < 16) { return _DM_hexc[n]; }else{ rmd = (n%16); quo = Math.floor((n - rmd)/16); return (_DM_toHex(quo)+_DM_toHex(rmd)); }}function _DM_pad(d,p){ d += ""; while(d.length < p){ d = "0"+d; } return d;}function _DM_deFrag(u){ var i=u.indexOf('#'); if(i>=0){ return u.substr(0,i); } return u;}function _DM_rstReq() { _DM_CNV = ""; _DM_LOC = _DM_deFrag(_DM_UDC.location.toString()); _DM_REF = _DM_deFrag(_DM_UDC.referrer.toString());}function DM_cat(cat) { _DM_addNV("DM_CAT",_DM_encd(cat,_DM_BCL1,0))}function DM_name(f) { _DM_addNV("DM_NAM",_DM_encd(f,_DM_BCL1,0))}function DM_keywords(k) { _DM_addNV("DM_KYW",_DM_encd(k,_DM_BCL1,0))}function DM_addToLoc(n,v) { _DM_LOC=_DM_appendToUrl(_DM_LOC,n,v); if(DM_DREF==1) { _DM_REF=_DM_appendToUrl(_DM_REF,n,v); }}function DM_addEncToLoc(n,v) { DM_addToLoc(_DM_encd(n,_DM_GCL2,1),_DM_encd(v,_DM_GCL2,1));}function DM_setLoc(u) { _DM_LOC=u; if(DM_DREF==1) { _DM_REF=u; }}//-->
var rsi_td=rsi_now.getFullYear()+'_'+(rsi_now.getMonth()+1)+'_'+rsi_now.getDate();
var rsi_ct=0;
var rsi_beg=document.cookie.indexOf('rsi_ct=');
if(rsi_beg>=0){
rsi_beg=document.cookie.indexOf('=',rsi_beg)+1;
if(rsi_beg>0){
if(rsi_td==document.cookie.substring(rsi_beg,rsi_beg+rsi_td.length)){
rsi_beg+=(rsi_td.length+1);
var rsi_end=document.cookie.indexOf(';',rsi_beg);
if(rsi_end==-1)
rsi_end=document.cookie.length;
var rsi_par=parseInt(document.cookie.substring(rsi_beg,rsi_end));
if(!isNaN(rsi_par))
rsi_ct=rsi_par;
}}}
var rsi_tom=new Date(rsi_now.getTime()+86400000);
var rsi_dom=location.hostname;
rsi_dom=rsi_dom.replace(/.*(\.[\w\-]+\.[a-zA-Z]{3}$)/,'$1');
rsi_dom=rsi_dom.replace(/.*(\.[\w\-]+\.\w+\.[a-zA-Z]{2}$)/,'$1');
rsi_dom=rsi_dom.replace(/.*(\.[\w\-]{3,}\.[a-zA-Z]{2}$)/,'$1');
document.cookie=('rsi_ct='+rsi_td+':'+(rsi_ct+1)+';expires='+rsi_tom.toGMTString()+';path=/;domain='+rsi_dom);
rsi_k = '&ko=' + rsi_td + '__' + Math.floor((rsi_ct+2)/3);
var revSc = document.createElement('script');
revSc.setAttribute('language', 'javascript');
revSc.setAttribute('type', 'text/javascript');
revSc.setAttribute('src', location.protocol + '//js.revsci.net/common/pcx.js?tmpl=cm&csid=H07707' + rsi_k);
document.getElementsByTagName('head').item(0).appendChild(revSc);
http://graphics8.nytimes.com/js/app/analytics/revenuescience.js
/*
$Id: revenuescience.js 10005 2008-06-16 14:33:39Z utzc $
*/
function getMetaTag(tagName) {
var metaTags=document.getElementsByTagName("meta");
for(var i in metaTags){
if(metaTags[i].name == tagName) {
return metaTags[i].content;
}
}
return "";
}
function addCategory(category, valueToAppend) {
if (valueToAppend != "")
return category + " > " + valueToAppend;
else
return category;
}
function revenuescienceInit() {
var contentGroup = getMetaTag("WT.cg_n");
if (contentGroup != "Homepage") {
var catValue = "NYTimesglobal";
catValue = addCategory(catValue, contentGroup);
catValue = addCategory(catValue, getMetaTag("WT.cg_s"));
DM_cat(catValue);
DM_tag();
}
}
if (/MSIE/.test(navigator.userAgent)) {
// In IE, wrapping this code block in setTimeout is needed because in certain cases,
// it will execute before other script files needed are fully loaded.
window.setTimeout(revenuescienceInit, 1);
} else {
revenuescienceInit();
}
http://graphics8.nytimes.com/js/app/analytics/wtinit.js
function DcsInit(){
this.enabled=true;
this.trackevents=gtrackevents;
this.dcsid=gdcsid;
this.fpcdom=gfpcdom;
this.domain=gdomain;
this.exre=(function(){
if (window.RegExp){
return(new RegExp("dcs(uri)|(ref)|(aut)|(met)|(sta)|(sip)|(pro)|(byt)|(dat)|(p3p)|(cfg)|(redirect)|(cip)","i"));
}
else{
return("");
}
})();
this.fpc="WT_FPC";
this.i18n=false;
this.images=[];
this.index=0;
this.qp=[];
this.re=(function(){
if (window.RegExp){
return(this.i18n?{"%25":/\%/g}:{"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g});
}
else{
return("");
}
})();
this.timezone=-5;
// var t=this;
// (function(){
// if (t.enabled&&(document.cookie.indexOf(t.fpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
// document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+t.domain+"/"+t.dcsid+"/wtid.js"+"'><\/scr"+"ipt>");
// }
// })();
}
var DCS={};
var WT={};
var DCSext={};
var dcsInit=new DcsInit();
http://graphics8.nytimes.com/js/app/analytics/wtbase.js
/*
$Id: wtbase.js 10005 2008-06-16 14:33:39Z utzc $
*/
function dcsCQP(){
var qry=window.location.search.toLowerCase();
if ( (qry && (qry.indexOf("wt.mc_id")!=-1) && (qry.indexOf("wt.mc_ev")==-1)) || ((WT.mc_id!=null) && (WT.mc_id.toString()!="")) ) {
return "click";
}
else{
return "";
}
}
function dcsCookie(){
if (typeof(dcsOther)=="function"){
dcsOther();
}
else if (typeof(dcsFPC)=="function"){
dcsFPC(dcsInit.timezone);
}
}
function dcsGetCookie(name){
var cookies=document.cookie.split("; ");
var cmatch=[];
var idx=0;
var i=0;
var namelen=name.length;
var clen=cookies.length;
for (i=0;i<clen;i++){
var c=cookies[i];
if ((c.substring(0,namelen+1))==(name+"=")){
cmatch[idx++]=c;
}
}
var cmatchCount=cmatch.length;
if (cmatchCount>0){
idx=0;
if ((cmatchCount>1)&&(name==dcsInit.fpc)){
var dLatest=new Date(0);
for (i=0;i<cmatchCount;i++){
var lv=parseInt(dcsGetCrumb(cmatch[i],"lv"));
var dLst=new Date(lv);
if (dLst>dLatest){
dLatest.setTime(dLst.getTime());
idx=i;
}
}
}
return unescape(cmatch[idx].substring(namelen+1));
}
else{
return null;
}
}
function dcsGetCrumb(cval,crumb){
var aCookie=cval.split(":");
for (var i=0;i<aCookie.length;i++){
var aCrumb=aCookie[i].split("=");
if (crumb==aCrumb[0]){
return aCrumb[1];
}
}
return null;
}
function dcsGetIdCrumb(cval,crumb){
var id=cval.substring(0,cval.indexOf(":lv="));
var aCrumb=id.split("=");
for (var i=0;i<aCrumb.length;i++){
if (crumb==aCrumb[0]){
return aCrumb[1];
}
}
return null;
}
function dcsFPC(offset){
if (typeof(offset)=="undefined"){
return;
}
if (document.cookie.indexOf("WTLOPTOUT=")!=-1){
return;
}
var name=dcsInit.fpc;
var dCur=new Date();
var adj=(dCur.getTimezoneOffset()*60000)+(offset*3600000);
dCur.setTime(dCur.getTime()+adj);
var dExp=new Date(dCur.getTime()+315360000000);
var dSes=new Date(dCur.getTime());
WT.co_f=WT.vt_sid=WT.vt_f=WT.vt_f_a=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";
if (document.cookie.indexOf(name+"=")==-1){
if ((typeof(gWtId)!="undefined")&&(gWtId!="")){
WT.co_f=gWtId;
}
else if ((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){
WT.co_f=gTempWtId;
WT.vt_f="1";
}
else{
WT.co_f="2";
var cur=dCur.getTime().toString();
for (var i=2;i<=(32-cur.length);i++){
WT.co_f+=Math.floor(Math.random()*16.0).toString(16);
}
WT.co_f+=cur;
WT.vt_f="1";
}
if (typeof(gWtAccountRollup)=="undefined"){
WT.vt_f_a="1";
}
WT.vt_f_s=WT.vt_f_d="1";
WT.vt_f_tlh=WT.vt_f_tlv="0";
}
else{
var c=dcsGetCookie(name);
var id=dcsGetIdCrumb(c,"id");
var lv=parseInt(dcsGetCrumb(c,"lv"));
var ss=parseInt(dcsGetCrumb(c,"ss"));
if ((id==null)||(id=="null")||isNaN(lv)||isNaN(ss)){
return;
}
WT.co_f=id;
var dLst=new Date(lv);
WT.vt_f_tlh=Math.floor((dLst.getTime()-adj)/1000);
dSes.setTime(ss);
if ((dCur.getTime()>(dLst.getTime()+1800000))||(dCur.getTime()>(dSes.getTime()+28800000))){
WT.vt_f_tlv=Math.floor((dSes.getTime()-adj)/1000);
dSes.setTime(dCur.getTime());
WT.vt_f_s="1";
}
if ((dCur.getDay()!=dLst.getDay())||(dCur.getMonth()!=dLst.getMonth())||(dCur.getYear()!=dLst.getYear())){
WT.vt_f_d="1";
}
}
WT.co_f=escape(WT.co_f);
WT.vt_sid=WT.co_f+"."+(dSes.getTime()-adj);
var expiry="; expires="+dExp.toGMTString();
document.cookie=name+"="+"id="+WT.co_f+":lv="+dCur.getTime().toString()+":ss="+dSes.getTime().toString()+expiry+"; path=/"+(((dcsInit.fpcdom!=""))?("; domain="+dcsInit.fpcdom):(""));
if (document.cookie.indexOf(name+"=")==-1){
WT.co_f=WT.vt_sid=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";
WT.vt_f=WT.vt_f_a="2";
}
}
function dcsTypeMatch(pth, typelist){
var type=pth.substring(pth.lastIndexOf(".")+1,pth.length);
var types=typelist.split(",");
for (var i=0;i<types.length;i++){
if (type==types[i]){
return true;
}
}
return false;
}
function dcsEvt(evt,tag){
var e=evt.target||evt.srcElement;
while (e.tagName&&(e.tagName!=tag)){
e=e.parentElement||e.parentNode;
}
return e;
}
function dcsSetVar(){
if ((arguments.length%2==0)&&(navigator.appVersion.indexOf("MSIE")!=-1)){
for (var i=0;i<arguments.length;i+=2){
if (arguments[i].indexOf('WT.')==0){
WT[arguments[i].substring(3)]=arguments[i+1];
}
else if (arguments[i].indexOf('DCS.')==0){
DCS[arguments[i].substring(4)]=arguments[i+1];
}
else if (arguments[i].indexOf('DCSext.')==0){
DCSext[arguments[i].substring(7)]=arguments[i+1];
}
}
}
}
function dcsSetVarCap(e){
var gCap = e.onclick.toString();
var gStart = gCap.substring(gCap.indexOf("dcsSetVar(")+10,gCap.length);
var gEnd = gStart.substring(0,gStart.indexOf(");")).replace(/\s"/gi,"").replace(/"/gi,"");
var gSplit = gEnd.split(",");
if (gSplit.length!=-1){
for (var i=0;i<gSplit.length;i+=2){
if (gSplit[i].indexOf('WT.')==0){
WT[gSplit[i].substring(3)]=gSplit[i+1];
}
else if (gSplit[i].indexOf('DCS.')==0){
DCS[gSplit[i].substring(4)]=gSplit[i+1];
}
else if (gSplit[i].indexOf('DCSext.')==0){
DCSext[gSplit[i].substring(7)]=gSplit[i+1];
}
}
}
}
function dcsNavigation(wtnode){
try{
var wtCount=0;
while(wtCount!=1){
if(wtnode.parentNode.tagName!="DIV"){
wtnode=wtnode.parentNode;
}
if(wtnode.parentNode.tagName=="DIV"){
if(wtnode.parentNode.getAttribute('id')){
WT.nav = wtnode.parentNode.getAttribute("id");
wtCount=1;
}
else{
wtnode=wtnode.parentNode;
}
}
}}
catch(error){}
}
function dcsBind(event,func){
if ((typeof(window[func])=="function")&&document.body){
if (document.body.addEventListener){
document.body.addEventListener(event, window[func], true);
}
else if(document.body.attachEvent){
document.body.attachEvent("on"+event, window[func]);
}
}
}
function dcsET(){
var e=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";
dcsBind(e,"dcsDownload");
dcsBind(e,"dcsDynamic");
dcsBind(e,"dcsFormButton");
dcsBind("keypress","dcsFormButton");
dcsBind(e,"dcsImageMap");
}
function dcsMultiTrack(){
if (arguments.length%2==0){
for (var i=0;i<arguments.length;i+=2){
if (arguments[i].indexOf('WT.')==0){
WT[arguments[i].substring(3)]=arguments[i+1];
}
else if (arguments[i].indexOf('DCS.')==0){
DCS[arguments[i].substring(4)]=arguments[i+1];
}
else if (arguments[i].indexOf('DCSext.')==0){
DCSext[arguments[i].substring(7)]=arguments[i+1];
}
}
var dCurrent=new Date();
DCS.dcsdat=dCurrent.getTime();
dcsFunc("dcsCookie");
dcsTag();
}
}
function dcsQP(N){
if (typeof(N)=="undefined"){
return "";
}
var qry=location.search.substring(1);
if (qry!=""){
var pairs=qry.split("&");
for (var i=0;i<pairs.length;i++){
var pos=pairs[i].indexOf("=");
if (pos!=-1){
if (pairs[i].substring(0,pos)==N){
dcsInit.qp[dcsInit.qp.length]=(i==0?"":"&")+pairs[i];
return pairs[i].substring(pos+1);
}
}
}
}
return "";
}
// Add event handlers here
// Code section for Track clicks to download links.
function dcsDownload(evt){
evt=evt||(window.event||"");
if (evt&&((typeof(evt.which)!="number")||(evt.which==1))){
var e=dcsEvt(evt,"A");
if (e){
var gclick=e.onclick?e.onclick.toString():e.mousedown?e.mousedown.toString():"";
if (e.hostname&&e.href&&e.protocol&&(e.protocol.indexOf("http")!=-1)&&(gclick.indexOf("dcsMultiTrack")==-1)){
if((navigator.appVersion.indexOf("MSIE")==-1)&&(e.onclick)){dcsSetVarCap(e);}
dcsNavigation(e);
var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
var pth=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
var ttl="";
var text=document.all?e.innerText:e.text;
var img=dcsEvt(evt,"IMG");
if (img.alt){
ttl=img.alt;
}
else if (text){
ttl=text;
}
else if (e.innerHTML){
ttl=e.innerHTML;
}
dcsMultiTrack("DCS.dcssip",e.hostname,"DCS.dcsuri",pth,"DCS.dcsqry",e.search||"","WT.ti","Link:"+ttl,"WT.dl","20");
DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.nv="";
}
}
}
}
// Code section for Track form button clicks.
function dcsFormButton(evt){
evt=evt||(window.event||"");
if (evt&&((typeof(evt.which)!="number")||(evt.which==1)||(evt.which==13))){
var tags=["INPUT","BUTTON"];
for (var j=0;j<tags.length;j++){
var e=dcsEvt(evt,tags[j]);
var type=e.type||"";
var gclick=e.onclick?e.onclick.toString():e.mousedown?e.mousedown.toString():"";
if ((gclick.indexOf("dcsMultiTrack")==-1)&&type&&((type=="submit")||(type=="image")||(type=="button")||(type=="reset"))||((type=="text")&&((evt.which||evt.keyCode)==13))){
if((navigator.appVersion.indexOf("MSIE")==-1)&&(e.onclick)){dcsSetVarCap(e);}
dcsNavigation(e);
var uri="";
var ttl="";
var qry="";
var id=0;
if (e.form){
var elems=e.form.elements;
for (var i=0;i<elems.length;i++){
var etype=elems[i].type;
if ((etype=="text")||(etype=="textarea")||(etype=="hidden")||(etype=="select-one")){
qry+=((qry=="")?"":"&")+escape(elems[i].name)+"="+escape(elems[i].value);
}
}
uri=e.form.action||window.location.pathname;
ttl=e.form.id||e.form.name||e.form.className||"Unknown";
id=(e.form.method&&(e.form.method.toLowerCase()=="post"))?27:26;
}
else{
uri=window.location.pathname;
ttl=e.name||e.id||"Unknown";
id=(tags[j].toLowerCase()=="input")?28:29;
}
if (uri&&ttl&&(evt.keyCode!=9)){
dcsMultiTrack("DCS.dcsuri",uri,"DCS.dcsqry",qry,"WT.ti","FormButton:"+ttl,"WT.dl",id,"WT.nv",dcsNavigation(evt));
}
DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.nv="";
break;
}
}
}
}
// Code section for clicks to image maps.
function dcsImageMap(evt){
evt=evt||(window.event||"");
if (evt){
var e=dcsEvt(evt,"AREA");
var gclick=e.onclick?e.onclick.toString():e.mousedown?e.mousedown.toString():"";
if ((gclick.indexOf("dcsMultiTrack")==-1)&&e.hostname&&e.href&&e.protocol&&(e.protocol.indexOf("http")!=-1)){
if((navigator.appVersion.indexOf("MSIE")==-1)&&(e.onclick)){dcsSetVarCap(e);}
dcsNavigation(e);
var pth=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
dcsMultiTrack("DCS.dcssip",e.hostname,"DCS.dcsuri",pth,"DCS.dcsqry",e.search||"","WT.ti","ImageMap:","WT.dl","30");
DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=WT.nv="";
}
}
}
// Code section for Enable custom meta tag capture.
function dcsMetaCap(){
var namelst="METATA";
var elems;
if (document.all){
elems=document.all.tags("meta");
}
else if (document.documentElement){
elems=document.getElementsByTagName("meta");
}
if (typeof(elems)!="undefined"){
var names=namelst.toLowerCase().split(",");
var nlen=names.length;
var elen=elems.length;
for (var i=0;i<elen;i++){
var name=elems.item(i).name.toLowerCase();
var content=elems.item(i).content;
if ((name.length>0)&&(content.length>0)){
for(var j=0;j<nlen;j++){
if (name==names[j]){
DCSext["meta_"+names[j]]=content;
break;
}
}
}
}
}
}
function dcsAdv(){
if (dcsInit.trackevents){
if (window.addEventListener) {window.addEventListener('load', dcsET, false);} // mozilla and friends
else if (window.attachEvent) {window.attachEvent('onload', dcsET);} // IE
}
dcsFunc("dcsCookie");
dcsFunc("dcsAdSearch");
dcsFunc("dcsTP");
dcsFunc("dcsMetaCap");
}
// Add customizations here
function dcsVar(){
var dCurrent=new Date();
WT.tz=dCurrent.getTimezoneOffset()/60*-1;
if (WT.tz==0){
WT.tz="0";
}
WT.bh=dCurrent.getHours();
WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
if (typeof(screen)=="object"){
WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;
WT.sr=screen.width+"x"+screen.height;
}
if (typeof(navigator.javaEnabled())=="boolean"){
WT.jo=navigator.javaEnabled()?"Yes":"No";
}
if (document.title){
WT.ti=document.title;
}
WT.js="Yes";
WT.jv=dcsJV();
if (document.body&&document.body.addBehavior){
document.body.addBehavior("#default#clientCaps");
WT.ct=document.body.connectionType||"unknown";
document.body.addBehavior("#default#homePage");
WT.hp=document.body.isHomePage(location.href)?"1":"0";
}
else{
WT.ct="unknown";
}
if (parseInt(navigator.appVersion)>3){
if ((navigator.appName=="Microsoft Internet Explorer")&&document.body){
WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight;
}
else if (navigator.appName=="Netscape"){
WT.bs=window.innerWidth+"x"+window.innerHeight;
}
}
WT.fi="No";
if (window.ActiveXObject){
for(var i=10;i>0;i--){
try{
var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
WT.fi="Yes";
WT.fv=i+".0";
break;
}
catch(e){
}
}
}
else if (navigator.plugins&&navigator.plugins.length){
for (var i=0;i<navigator.plugins.length;i++){
if (navigator.plugins[i].name.indexOf('Shockwave Flash')!=-1){
WT.fi="Yes";
WT.fv=navigator.plugins[i].description.split(" ")[2];
break;
}
}
}
if (dcsInit.i18n){
WT.em=(typeof(encodeURIComponent)=="function")?"uri":"esc";
if (typeof(document.defaultCharset)=="string"){
WT.le=document.defaultCharset;
}
else if (typeof(document.characterSet)=="string"){
WT.le=document.characterSet;
}
}
WT.tv="1.0.7";
// WT.sp="@@SPLITVALUE@@";
WT.dl=0;
DCS.dcsdat=dCurrent.getTime();
DCS.dcssip=window.location.hostname;
DCS.dcsuri=window.location.pathname;
WT.es=DCS.dcssip+DCS.dcsuri;
if (window.location.search){
DCS.dcsqry=window.location.search;
if (dcsInit.qp.length>0){
for (var i=0;i<dcsInit.qp.length;i++){
var pos=DCS.dcsqry.indexOf(dcsInit.qp[i]);
if (pos!=-1){
var front=DCS.dcsqry.substring(0,pos);
var end=DCS.dcsqry.substring(pos+dcsInit.qp[i].length,DCS.dcsqry.length);
DCS.dcsqry=front+end;
}
}
}
}
if ((window.document.referrer!="")&&(window.document.referrer!="-")){
if (!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){
DCS.dcsref=window.document.referrer;
}
}
}
function dcsA(N,V){
if (dcsInit.i18n&&(dcsInit.exre!="")&&!dcsInit.exre.test(N)){
if (N=="dcsqry"){
var newV="";
var params=V.substring(1).split("&");
for (var i=0;i<params.length;i++){
var pair=params[i];
var pos=pair.indexOf("=");
if (pos!=-1){
var key=pair.substring(0,pos);
var val=pair.substring(pos+1);
if (i!=0){
newV+="&";
}
newV+=key+"="+dcsEncode(val);
}
}
V=V.substring(0,1)+newV;
}
else{
V=dcsEncode(V);
}
}
return "&"+N+"="+dcsEscape(V, dcsInit.re);
}
function dcsEscape(S, REL){
if (REL!=""){
var retStr = new String(S);
for (var R in REL){
if (typeof(REL[R])!="function"){
retStr = retStr.replace(REL[R],R);
}
}
return retStr;
}
else{
return escape(S);
}
}
function dcsEncode(S){
return (typeof(encodeURIComponent)=="function")?encodeURIComponent(S):escape(S);
}
function dcsCreateImage(dcsSrc){
if (document.images){
dcsInit.images[dcsInit.index]=new Image;
dcsInit.images[dcsInit.index].src=dcsSrc;
dcsInit.index++;
}
else{
document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
}
}
function dcsMeta(){
var elems;
if (document.all){
elems=document.all.tags("meta");
}
else if (document.documentElement){
elems=document.getElementsByTagName("meta");
}
if (typeof(elems)!="undefined"){
var length=elems.length;
for (var i=0;i<length;i++){
var name=elems.item(i).name;
var content=elems.item(i).content;
var equiv=elems.item(i).httpEquiv;
if (name.length>0){
if (name.indexOf("WT.")==0){
WT[name.substring(3)]=content;
}
else if (name.indexOf("DCSext.")==0){
DCSext[name.substring(7)]=content;
}
else if (name.indexOf("DCS.")==0){
DCS[name.substring(4)]=content;
}
}
else if (dcsInit.i18n&&(equiv=="Content-Type")){
var pos=content.toLowerCase().indexOf("charset=");
if (pos!=-1){
WT.mle=content.substring(pos+8);
}
}
}
}
}
function dcsTag(){
if (document.cookie.indexOf("WTLOPTOUT=")!=-1){
return;
}
var P="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+dcsInit.domain+(dcsInit.dcsid==""?'':'/'+dcsInit.dcsid)+"/dcs.gif?";
for (var N in DCS){
if ((typeof DCS[N]!="function")&&DCS[N]){
P+=dcsA(N,DCS[N]);
}
}
var keys=["co_f","vt_sid","vt_f_tlv"];
for (var i=0;i<keys.length;i++){
var key=keys[i];
if (WT[key]){
P+=dcsA("WT."+key,WT[key]);
delete WT[key];
}
}
for (N in WT){
if ((typeof WT[N]!="function")&&WT[N]){
P+=dcsA("WT."+N,WT[N]);
}
}
for (N in DCSext){
if ((typeof DCSext[N]!="function")&&DCSext[N]){
P+=dcsA(N,DCSext[N]);
}
}
if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
P=P.substring(0,2040)+"&WT.tu=1";
}
dcsCreateImage(P);
WT.ad="";
}
function dcsJV(){
var agt=navigator.userAgent.toLowerCase();
var major=parseInt(navigator.appVersion);
var mac=(agt.indexOf("mac")!=-1);
var ff=(agt.indexOf("firefox")!=-1);
var ff0=(agt.indexOf("firefox/0.")!=-1);
var ff10=(agt.indexOf("firefox/1.0")!=-1);
var ff15=(agt.indexOf("firefox/1.5")!=-1);
var ff2up=(ff&&!ff0&&!ff10&!ff15);
var nn=(!ff&&(agt.indexOf("mozilla")!=-1)&&(agt.indexOf("compatible")==-1));
var nn4=(nn&&(major==4));
var nn6up=(nn&&(major>=5));
var ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
var ie4=(ie&&(major==4)&&(agt.indexOf("msie 4")!=-1));
var ie5up=(ie&&!ie4);
var op=(agt.indexOf("opera")!=-1);
var op5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);
var op6=(agt.indexOf("opera 6")!=-1||agt.indexOf("opera/6")!=-1);
var op7up=(op&&!op5&&!op6);
var jv="1.1";
if (ff2up){
jv="1.7";
}
else if (ff15){
jv="1.6";
}
else if (ff0||ff10||nn6up||op7up){
jv="1.5";
}
else if ((mac&&ie5up)||op6){
jv="1.4";
}
else if (ie5up||nn4||op5){
jv="1.3";
}
else if (ie4){
jv="1.2";
}
return jv;
}
function dcsFunc(func){
if (typeof(window[func])=="function"){
window[func]();
}
}
function wtbaseInit() {
if (dcsInit.enabled){
dcsVar();
dcsMeta();
WT.mc_ev=dcsCQP();
dcsFunc("dcsAdv");
dcsTag();
}
}
if (/MSIE/.test(navigator.userAgent)) {
// In IE, wrapping this code block in setTimeout is needed because in certain cases,
// it will execute before other script files needed are fully loaded.
window.setTimeout(wtbaseInit, 1);
} else {
wtbaseInit();
}
http://js.revsci.net/common/pcx.js?tmpl=cm&csid=H07707&ko=2009_3_18__2
/*
* Build version Vermont-12.0.0-122
*/
rsinetsegs=['H07707_10056','H07707_10063','H07707_10105','H07707_10193','H07707_10194','H07707_10195','H07707_10264','H07707_50028','H07707_50104','H07707_50127','H07707_50140','H07707_50237'];
var rsiExp=new Date((new Date()).getTime()+2419200000);
var rsiDom=location.hostname;
rsiDom=rsiDom.replace(/.*(\.[\w\-]+\.[a-zA-Z]{3}$)/,'$1');
rsiDom=rsiDom.replace(/.*(\.[\w\-]+\.\w+\.[a-zA-Z]{2}$)/,'$1');
rsiDom=rsiDom.replace(/.*(\.[\w\-]{3,}\.[a-zA-Z]{2}$)/,'$1');
var rsiSegs="";
var rsiPat=/.*_5.*/;
for(x=0;x<rsinetsegs.length;++x){if(!rsiPat.test(rsinetsegs[x]))rsiSegs+='|'+rsinetsegs[x];}
document.cookie="rsi_segs="+(rsiSegs.length>0?rsiSegs.substr(1):"")+";expires="+rsiExp.toGMTString()+";path=/;domain="+rsiDom;
if(typeof(DM_onSegsAvailable)=="function"){DM_onSegsAvailable(['H07707_10056','H07707_10063','H07707_10105','H07707_10193','H07707_10194','H07707_10195','H07707_10264','H07707_50028','H07707_50104','H07707_50127','H07707_50140','H07707_50237'],'H07707');}
http://graphics8.nytimes.com/js/app/analytics/trackingTags_v1.1.js
// START WEBTRENDS JS TAG
var gtrackevents=false;
var gdcsid="dcsym57yw10000s1s8g0boozt_9t1x";
var gfpcdom=".nytimes.com";
var gdomain="wt.o.nytimes.com";
var js_host;
if (window.location.protocol.indexOf('https:')==-1) {
js_host = "http://graphics8.nytimes.com/js/app/analytics/";
} else {
js_host = "https://select.nytimes.com/js/app/analytics/";
}
// Include WebTrends wtid.js
var wt_initObj = { enabled:true, fpc:"WT_FPC", domain:gdomain, dcsid:gdcsid };
if (wt_initObj.enabled&&(document.cookie.indexOf(wt_initObj.fpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
var wtid_js_host="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+wt_initObj.domain+"/"+wt_initObj.dcsid+"/"
var wtidjs = document.createElement('script');
wtidjs.setAttribute('type', 'text/javascript');
wtidjs.setAttribute('src', wtid_js_host+'wtid.js');
document.getElementsByTagName('head').item(0).appendChild(wtidjs);
}
var wtInc = document.createElement('script');
wtInc.setAttribute('language', 'javascript');
wtInc.setAttribute('type', 'text/javascript');
wtInc.setAttribute('src', js_host+'controller_v1.1.js');
document.getElementsByTagName('head').item(0).appendChild(wtInc);
// END WEBTRENDS JS TAG
// START REVENUE SCIENCE PIXELLING CODE
var revSc = document.createElement('script');
revSc.setAttribute('language', 'javascript');
revSc.setAttribute('type', 'text/javascript');
revSc.setAttribute('src', js_host+'gw.js?csid=H07707');
document.getElementsByTagName('head').item(0).appendChild(revSc);
var customRevSci = document.createElement('script');
customRevSci.setAttribute('language', 'javascript');
customRevSci.setAttribute('type', 'text/javascript');
customRevSci.setAttribute('src', js_host+'revenuescience.js');
document.getElementsByTagName('head').item(0).appendChild(customRevSci);
// END REVENUE SCIENCE PIXELLING CODE
// Load TimesPeople
var NYTD = NYTD || {};
NYTD.Hosts = NYTD.Hosts || {
imageHost: 'http://graphics8.nytimes.com',
jsHost: 'http://graphics8.nytimes.com',
cssHost: 'http://graphics8.nytimes.com'
}
NYTD.require = NYTD.require || function(url) {
document.write('<script src="'+ NYTD.Hosts.jsHost + url +'" type="text/javascript" charset="utf-8"><\/script>');
}
if (navigator.userAgent.indexOf('AppleWebKit/41') == -1 && !window.opera) {
if(!window.TimesPeople) {
NYTD.require('/js/app/timespeople_1.1/preloader.js', function() { NYTD.require('/js/app/timespeople_1.1/loader.js'); });
}
else {
NYTD.require('/js/app/timespeople_1.1/loader.js');
}
}
http://graphics8.nytimes.com/js/app/timespeople_1.1/preloader.js
/*
$Id: preloader.js 13995 2009-01-29 17:32:23Z santep $
(c) 2008 The New York Times Company
*/
var NYTD = NYTD || {};
NYTD.Hosts = NYTD.Hosts || {
imageHost: 'http://graphics8.nytimes.com',
jsHost: 'http://graphics8.nytimes.com',
cssHost: 'http://graphics8.nytimes.com'
}
NYTD.require = NYTD.require || function(url) {
document.write('<script src="'+ NYTD.Hosts.jsHost + url +'" type="text/javascript" charset="utf-8"><\/script>');
}
NYTD.require('/js/app/timespeople_1.1/config/config.js');
NYTD.require('/js/app/lib/NYTD/0.0.1/cookie.js');
NYTD.require('/js/app/timespeople_1.1/lib/console.js');
NYTD.require('/js/app/timespeople_1.1/urilist.js');
NYTD.require('/js/app/timespeople_1.1/marginfix.js');
http://graphics8.nytimes.com/js/app/timespeople_1.1/config/config.js
/*
$Id: urilist.js 6659 2008-12-10 09:42:44Z donohoe $
(c) 2008 The New York Times Company
*/
var TimesPeople = {
version: '1.0',
Config: {
host: 'http://timespeople.nytimes.com',
css_host: NYTD.Hosts.cssHost,
image_host: NYTD.Hosts.imageHost,
js_host: NYTD.Hosts.jsHost,
ad_host: 'http://www.nytimes.com',
user_image_host : 'http://pimage.timespeople.nytimes.com',
image_path: '/images/apps/timespeople/',
css_path: '/css/0.1/screen/timespeople_1.1/',
css_build_path: '/css/0.1/screen/build/timespeople_1.1/',
service: '/svc/timespeople/toolbar/1.0/',
image_service: 'http://tp-upload.nytimes.com/postpic.php',
xpi: false,
RMID: /RMID=([^;]+)/.test(unescape(document.cookie)) ? RegExp.$1 : '',
get_started_uri: 'http://timespeople.nytimes.com/getstarted'
}
};
// DEPRECATED! in use by older version of userpages.js (/js/app/timespeople/userpages/userpages_1.1.js)
TPCONFIG = {
"service": "/svc/timespeople/fe/fe_svc.html"
};
/*
Determining page group, type, title and descriptions based on META tags
*/
TimesPeople.Config.Page = {
Group:
[
{ value: 'articleid', alias: 'article' },
{ value: 'PT' },
{ value: 'WT.z_gpt', alias: 'article' }
],
Type:
{
"article":
{
"tom" :
[
{ value: "biography" },
{ value: "editor's note" },
{ value: "editorial" },
{ value: "interview" },
{ value: "recipe" },
{ value: "special report" },
{ value: "review" }
]
},
"topic":
{
"SCG":
[
{ value: "movie pages", alias: "movie guide" }
],
"PST":
[
{ value: "movie details", alias: "movie guide" },
{ value: "health guide" },
{ value: "travel guide" }
]
},
"community":
{
"PST":
[
{ value: "comments overflow", alias: "article" },
{ value: "rate-review", alias: "movie guide" }
]
},
"multimedia":
{
"SCG":
[
{ value: "election guide" }
],
"PST":
[
{ value: "interactive", alias: "interactive graphic" },
{ value: "interactive features", alias: "interactive feature" },
{ value: "image", alias: "graphic"},
{ value: "video" }
],
"tom":
[
{ value: "slideshow", alias: "slide show" }
]
},
"blogs":
{
"PST":
[
{ value: "blog main", alias: "blog" },
{ value: "blog post" }
]
},
"venue":
{
"tom":
[
{ value: "attraction" },
{ value: "dining", alias: "restaurant" },
{ value: "accommodation", alias: "hotel" },
{ value: "shopping", alias: "attraction" },
{ value: "night life", alias: "attraction" }
]
}
},
Title:
{
"article":
{
"default": [ "meta[name='hdl']", "div.header h1:not(h1.movie)", "div.header h1", "#aColumn #article h1", "title"],
"article": [ "meta[name='hdl']", "div.header h1:not(h1.movie)", "div.header h1", "#aColumn #article h1"]
},
"topic":
{
"default" : [ "meta[name='name']", "meta[name='GTN']", "#subHdr h1", "title" ],
"topic" : [ "meta[name='name']", "meta[name='GTN']", "#subHdr h1" ],
"movie guide" : [ "#header div.title h1", "meta[name='MTI']" ],
"health guide": [ "meta[name='HGSN']" ],
"travel guide": [ "h5.fn", "meta[name='name']" ]
},
"multimedia":
{
"default": [ "meta[name='hdl']", "title" ],
"interactive graphic": [ "meta[name='hdl']" , "title" ],
"interactive feature": [ "meta[name='hdl']" , "title" ],
"slide show": [ "meta[name='hdl']", "title" ],
"graphic": [ "meta[name='dsk']", "title" ],
"election guide": [ "h1", "#masthead h2 a", "title" ],
"video": [ "#libraryPlayerTitleName h1" ]
},
"blogs":
{
"default": [ "h2.entry-title", "title" ],
"blog post": [ "h2.entry-title" ]
} ,
"venue":
{
"default": [ "meta[name='name']", "title" ],
"hotel": [ "meta[name='name']" ],
"restaurant": [ "meta[name='name']" ],
"attraction": [ "meta[name='name']" ]
},
"community":
{
"default": [ "#header div.title h1", "meta[name='MTI']", "title" ],
"movie guide": [ "#header div.title h1", "meta[name='MTI']" ]
}
},
Description:
{
"article":
{
"default": [ "#aColumn #article p:not(p:empty)", "meta[name='description']", "meta[name='lp']" ],
"article": [ "#aColumn #article p:not(p:empty)", "meta[name='description']", "meta[name='lp']" ],
"editorial": [ "#aColumn #article p:not(p:empty)", "meta[name='description']", "meta[name='lp']" ]
},
"topic":
{
"default": [ "meta[name='description']" ],
"topic" : [ "div.companyInformation", "meta[name='description']", "meta[name='summary']" ],
"movie guide" : [ "p[class='review']", "meta[name='description']" ],
"health guide": [ "#definition p", "meta[name='Description']" ],
"travel guide": [ "#topStoryHorizontal p", "meta[name='description']" ]
},
"multimedia":
{
"default": [ "meta[name='description']" ],
"interactive graphic": [ "meta[name='description']" ],
"interactive feature": [ "meta[name='description']" ],
"slide show": [ "div.story", "div[class='caption']", "meta[name='description']" ],
"graphic": [ "td font[size='-1']", "meta[name='byl']", "meta[name='description']" ],
"election guide": [ "meta[name='description']" ],
"video": [ "#libraryPlayerDesc p" ]
},
"blogs":
{
"default": [ "meta[name='description']" ],
"blog post": [ "div.entry-content p", "meta[name='description']" ]
} ,
"venue":
{
"default": [ "meta[name='description']" ],
"hotel": [ "p.description", "span.description", "meta[name='description']" ],
"restaurant": [ "p.description", "span.description", "meta[name='description']" ],
"attraction": [ "p.description", "span.description", "meta[name='description']" ]
},
"community":
{
"default": [ "meta[name='description']" ],
"movie guide" : [ "div.result]", "meta[name='description']" ]
}
}
};
/*
Config Actions
- condition to satisfy, location in page, element type, element style, position (first/last), HTML for action within element
*/
TimesPeople.Config.HTML = {
Recommend:
{
standard : "<a class='timespeople_recommend_link' href='javascript:void(0);' style='background-image:url(__ICON__); background-repeat:no-repeat; padding:2px 0 3px 20px; font-size:1em;'>Recommend</a>",
uppercase : "<a class='timespeople_recommend_link' href='javascript:void(0);' style='background-image:url(__ICON__); background-repeat:no-repeat; padding:1px 0 3px 20px; font-size:1em; color:#333333; text-transform:uppercase;'>Recommend</a>",
blog : "<a class='timespeople_recommend_link' href='javascript:void(0);' style='background-image:url(__ICON__); background-repeat:no-repeat; padding:1px 0 3px 20px; color:#004276;'>Recommend</a>"
}
};
TimesPeople.Config.Style = {
Recommend:
{
standard : "padding-right:10px;border-right:1px solid #CCCCCC;margin-right:10px"
}
};
/*
Structure:
btnConfig = {
PAGE_GROUP: {
PAGE_TYPE: { key: IF_THIS_ELM_EXISTS, target: PLACE_HERE, type: TAG, style: CSS, position: first_OR_last, html: BUTTON_HTML }
...
where key and target are are prototpe css selectors, and evaluates as $$(IF_THIS_ELM_EXISTS)[0]
*/
TimesPeople.Config.Action = {
Recommend:
{
"article":
{
"article": { key: "#toolsList", target: "#toolsList", type: "li", style: {}, position: "first", html: TimesPeople.Config.HTML.Recommend.standard },
"editorial": { key: "#toolsList", target: "#toolsList", type: "li", style: {}, position: "first", html: TimesPeople.Config.HTML.Recommend.standard },
"default": { key: "#toolsList", target: "#toolsList", type: "li", style: {}, position: "first", html: TimesPeople.Config.HTML.Recommend.standard }
},
"topic":
{
"topic" : { key: "#tools", target: "#tools", type: "span", style: 'padding-right:10px;border-right:1px solid #CCCCCC;margin-right:10px', position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"movie guide" : { key: "#tools", target: "#menu", type: "span", style: 'float: right; margin: 5px 0 0 4px; padding-left: 2px;', position: "last", html: TimesPeople.Config.HTML.Recommend.uppercase },
"health guide": { key: "#tools", target: "#breadcrumb", type: "span", style: 'float:right;', position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"travel guide": { key: "#tools", target: "#tools", type: "span", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"default" : { key: "#tools", target: "#tools", type: "span", style: 'padding-right:10px;border-right:1px solid #CCCCCC;margin-right:10px', position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase }
},
"multimedia":
{
"interactive graphic": { key: "#articleTools", target: "#articleTools", type: "li", style: '', position: "last", html: TimesPeople.Config.HTML.Recommend.standard },
"slide show": { key: "#toolsList", target: "#toolsList", type: "li", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"graphic": { key: "table", target: "font[size='-2']", type: "div", style: 'padding-top:4px; font-family:Arial,Helvetica;', position: "last", html: TimesPeople.Config.HTML.Recommend.uppercase },
"election guide": { key: "#toolsList", target: "#toolsList", type: "li", style: '', position: "first", html: "<a class='timespeople_recommend_link' href='javascript:void(0);' style='color:#333; background-position:4px; font-size:1em; text-transform:uppercase; background-image:url(__ICON__); background-repeat:no-repeat;'>Recommend</a>" },
"default": { key: "#toolsList", target: "#toolsList", type: "li", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase }
},
"blogs":
{
"blog post": { key: "#content", target: "ul.entry-tools", type: "li", style: "padding-right:10px; margin-right:10px", position: "last", html: TimesPeople.Config.HTML.Recommend.blog },
"default" : { key: "#content", target: "ul.entry-tools", type: "li", style: "padding-right:10px; margin-right:10px", position: "last", html: TimesPeople.Config.HTML.Recommend.blog }
},
"venue":
{
"hotel": { key: "#tools", target: "#tools", type: "span", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"restaurant": { key: "#tools", target: "#tools", type: "span", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"attraction": { key: "#tools", target: "#tools", type: "span", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase },
"default": { key: "#tools", target: "#tools", type: "span", style: TimesPeople.Config.Style.Recommend.standard, position: "first", html: TimesPeople.Config.HTML.Recommend.uppercase }
}
}
};
http://graphics8.nytimes.com/js/app/lib/NYTD/0.0.1/cookie.js
var NYTD = window.NYTD || {};
/*
* Standard class to work with unencrypted cookies in JS.
* Use the NYTD.Cookies.getOrCreate() method to receive a cookie
* object to work with. Details of cookie setting and parsing
* are private for protection. Can only modify existing cookies
* if this same class was the one that created it.
*/
NYTD.Cookies = {
getOrCreate: function (cookieName) {
var cookies = document.cookie.split(';');
var nameSearchString = cookieName + '=';
var cookieValueString = '';
for (var c=0, len=cookies.length; c<len; ++c) {
var cur = cookies[c];
cur = cur.replace(/^ */, '');
if (cur.indexOf(nameSearchString) == 0) {
cookieValueString = cur.substring(nameSearchString.length,cur.length);
}
}
var Cookie = function (name,str) {
var checkKey = 'creator';
var checkVal = 'NYTD.Cookies';
var cookieName = name;
var cookieString = str || "";
var keyValPairs = {};
if (str != "") {
var checkStr = checkKey + '|' + checkVal;
if (cookieString.indexOf(checkStr) == -1) {
throw(name + " cookie was NOT created by the NYTD.Cookies class and can't be modified.");
return null;
}
else {
var regex = new RegExp(checkStr, "g");
cookieString.replace(regex, "");
}
var pairs = cookieString.split('^');
for (var p=0, len=pairs.length; p<len; ++p) {
var cur = pairs[p];
var vals = cur.split('|');
keyValPairs[vals[0]] = vals[1];
}
}
var set = function(expirationMillis) {
var exp = new Date();
var expirationOffset = expirationMillis || 31536000000; // 1 year default
var len = 0;
var keyvals = [];
if (keyValPairs[checkKey]) {
delete keyValPairs[checkKey];
}
for (key in keyValPairs) {
if (keyValPairs.hasOwnProperty(key)){
keyvals.push(key + "|" + keyValPairs[key]);
len++;
}
}
keyvals.push(checkKey + "|" + checkVal);
if (len > 0) {
exp.setTime(exp.getTime() + expirationOffset);
}
else {
exp.setTime(exp.getTime() - 86400000); // set to yesterday, to expire cookie
}
var expires = "; expires=" + exp.toGMTString();
document.cookie = cookieName + "=" + keyvals.join('^') + expires + "; domain=nytimes.com; path=/";
};
/*
* The following functions are the interface for the Cookie object.
*/
this.lookup = function (key) {
return keyValPairs[key];
};
this.add = function (obj, expiration) {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
keyValPairs[key] = obj[key];
}
}
set(expiration);
};
this.remove = function () {
for (var i=0, arg; arg = arguments[i]; ++i) {
if (keyValPairs[arg]) {
delete keyValPairs[arg];
}
}
set();
};
/* End public interface */
};
return new Cookie(cookieName, cookieValueString);
}
};
http://graphics8.nytimes.com/js/app/timespeople_1.1/lib/console.js
TimesPeople.console = {};
if (NYTD.Hosts.jsHost == 'graphics8.nytimes.com') {
TimesPeople.console.log = TimesPeople.console.warn = TimesPeople.console.error = function() {};
} else {
if (window.console && console.firebug) {
TimesPeople.console = console;
}
else if (window.console && console.log) {
var names = ["debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
for (var i = 0; i < names.length; ++i) {
console[names[i]] = function() {}
}
TimesPeople.console = console;
} else {
if (window.debugService) {
TimesPeople.console.log = TimesPeople.console.warn = TimesPeople.console.error = function(msg) {window.debugService.trace(msg)};
// TimesPeople.console.time = function(name){window.tp_time = new Date().getMilliseconds();};
// TimesPeople.console.timeEnd = function(name){ TimesPeople.console.log(name);TimesPeople.console.log((new Date().getMilliseconds()) - window.tp_time)};
} else {
TimesPeople.console.log = TimesPeople.console.warn = TimesPeople.console.error = function() {};
}
}
}
http://graphics8.nytimes.com/js/app/timespeople_1.1/urilist.js
/*
$Id: urilist.js 15939 2009-03-11 17:45:09Z santep $
(c) 2008 The New York Times Company
*/
TimesPeople.URIList = {
allowedHosts: {
'www.nytimes.com': 1,
'nytimes.com': 1,
'community.nytimes.com': 1,
'elections.nytimes.com': 1,
'events.nytimes.com': 1,
'movies.nytimes.com': 1,
'movies2.nytimes.com': 1,
'my.nytimes.com': 1,
'politics.nytimes.com': 1,
'tech2.nytimes.com': 1,
'tech.nytimes.com': 1,
'travel.nytimes.com': 1,
'travel2.nytimes.com': 1,
'topics.nytimes.com': 1,
'theater.nytimes.com': 1,
'jobmarket.nytimes.com': 1,
'projects.nytimes.com': 1,
'prototype.nytimes.com': 1,
'query.nytimes.com': 1,
'health.nytimes.com': 1,
'timesmachine.nytimes.com': 1,
'timespeople.nytimes.com': 1,
'www.sea1.nytimes.com': 1,
'tv.nytimes.com': 1,
'nyt.com': 1,
'www.nyt.com': 1,
'oscars.nytimes.com': 1,
'documents.nytimes.com': 1,
'ncaabracket.nytimes.com': 1
},
allowedHostsPatterns: [
/.*\.blogs\.nytimes\.com/
],
deniedURIs:[
/.*?glogin.*/, /.*?\/auth\/login.*/, /.*?gst\/signout.*/, /.*?pagewanted=print.*/, /.*?pagemode=print.*/,
/.*?\/style\/t\/.*/, /.*?archive\/pdf.*/, /.*?markets.on.nytimes.com.*/,
/.*?\/learning.*/, /.*?\/membercenter.*/, /.*?\/mem\/.*/, /.*?\/gst\/forgot.*/, /.*?\/gst\/emailus.*/,
/.*?\/gst\/unsub.*/, /.*?\/gst\/regi.*/, /.*?\/regi.*/, /.*?\/ref\/crosswords\/setpuzzle.*/,
/.*?\/gst\/mostblogged.*/, /.*?\/gst\/mostsearched.*/, /.*?\/gst\/mostemailed.*/,
/.*?\/marketing\/.*/, /.*?jobmarket.nytimes.com.*/, /.*?\/packages\/html\/style\/.*?/,
/.*?\/gst\/litesub_insert.*/, /.*?\/ref\/classifieds\/.*?/
],
deniedMetaTags:[
{"PST": "Audio Slideshow"},
{"TimesPeople": "disallow"}
],
deniedPlatforms: [
/Android|dream/
],
allowsCurrentPlatform: function() {
for (var i = 0, pattern; pattern = this.deniedPlatforms[i]; i++) {
if (pattern.test(navigator.userAgent)) {return false;}
};
return true;
},
allowsCurrentHost: function() {
if (this.allowedHosts[window.location.host]) {
return true;
}
else {
for (var i = 0, pattern; pattern = this.allowedHostsPatterns[i]; i++) {
if (pattern.test(window.location.host)) return true;
else return false;
}
}
},
allowsCurrentType: function() {
for (var i = 0, pair; pair = this.deniedMetaTags[i]; i++) {
for(var key in pair) {
var matches = document.getElementsByName(key);
for (var j = 0, match; match = matches[j]; j++) {
if(match.content == pair[key]) {return false;}
}
}
}
return true;
},
allowsCurrentURI: function() {
for (var i = 0, pattern; pattern = this.deniedURIs[i]; i++) {
if (pattern.test(window.location.href)) {return false;}
};
return true;
},
allowsCurrentPage: function() {
return this.allowsCurrentPlatform() && this.allowsCurrentHost() && this.allowsCurrentURI() && this.allowsCurrentType();
}
};
if (NYTD.Hosts.jsHost != 'http://graphics8.nytimes.com') {
TimesPeople.URIList.allowsCurrentHost = function() {
return true;
};
}
http://graphics8.nytimes.com/js/app/timespeople_1.1/marginfix.js
/*
$Id: marginfix.js 14814 2009-02-13 21:30:55Z santep $
(c) 2008 The New York Times Company
*/
(function(){
function run() {
if(TimesPeople.URIList.allowsCurrentPage()){
loadCSS();
restoreState();
TimesPeople.preInitialized = true;
}
else {
delete TimesPeople;
}
}
function restoreState(){
if (NYTD.Cookies.getOrCreate('tpstate').lookup('minimized') != 'YES') {
addMargin();
drawPlaceHolder();
}
}
function addMargin() {
// FIXME
// fast way, for baked in toolbar
document.write('<style>html body {padding-top:51px;}<\/style>');
// pre dom-ready way (for greasemonkey plugin)
// document.body.style.paddingTop = '40px';
}
function drawPlaceHolder() {
if(document.body && document.body.firstChild){
if (!document.getElementById('TP_container')) {
var container = document.createElement('div')
container.id = 'TP_container';
var shadow = document.createElement('div')
shadow.id = 'TP_container_shadow';
shadow.className = 's_shadow';
document.body.insertBefore(container, document.body.firstChild);
document.body.insertBefore(shadow, container);
}
}
else {
setTimeout(arguments.callee, 10);
}
}
function loadCSS() {
//TODO use documentFragment?
var ie6 = (!!(window.attachEvent && !window.opera) && (parseFloat(navigator.appVersion.split(';')[1].split(' ')[2]) < 7));
var head = document.getElementsByTagName('head')[0];
function createLink(uri) {
link = document.createElement('link');
link.href = uri;
link.type = 'text/css';
link.rel = 'stylesheet';
head.appendChild(link);
link = null;
}
createLink(TimesPeople.Config.css_host + TimesPeople.Config.css_build_path + 'styles.css');
if(ie6) {
createLink(TimesPeople.Config.css_host + TimesPeople.Config.css_path + 'timespeople_ie6.css');
}
}
run();
})();
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<ul class="blocks grid" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<% if (this.thumbnailUrl) { %>
<img src="<%= this.thumbnailUrl %>" height="60" width="60" />
<% } %>
<a href="<%= this.link %>"><%= this.title %></a>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
table { background-color: white; border-bottom: 1px solid #999; }
.ledes { width: 40%; }
.ledes li a { font-size: 18px; }
.mids { width: 35%; }
.ends { width: 25%; }
.ends li a {font-size: 12px; }
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<div class="pageScroller">
<table cellspacing="0">
<tr valign="top">
<td class="ledes">
<ul class="blocks ledeSet" id="set-<%= id %>">
<% $(items.slice(0,5)).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container">
<% if (this.thumbnailUrl) { %>
<img src="<%= this.thumbnailUrl %>" height="75" width="75" />
<% } %>
<a href="<%= this.link %>"><%= this.title %></a>
<p class="byline"><%= this.byline %></p>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
</td>
<td class="mids">
<ul class="blocks midSet" id="set-<%= id %>">
<% $(items.slice(5, 10)).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container">
<a href="<%= this.link %>"><%= this.title %></a>
<p class="byline"><%= this.byline %></p>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
</td>
<td class="ends">
<ul class="blocks endSet" id="set-<%= id %>">
<% $(items.slice(10)).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container">
<a href="<%= this.link %>"><%= this.title %></a>
</div>
</li>
<% }); %>
</ul>
</td>
</tr>
</table>
</div>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<div class="pageScroller">
<ul class="blocks stack" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<% if (this.thumbnailUrl) { %>
<img src="<%= this.thumbnailUrl %>" height="60" width="60" />
<% } %>
<a href="<%= this.link %>"><%= this.title %></a>
<p class="byline"><%= this.byline %></a>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
</div>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.lines li { display: block; clear: both; float: none; position: relative; height: 25px; }
.lines li .container { border-bottom: 1px solid #999; padding: 3px; overflow: hidden; }
.lines li .container span { color: silver; }
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<div class="pageScroller">
<ul class="blocks lines" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<a href="<%= this.link %>"><%= this.title %></a>
<span class="byline"><%= this.byline %></span>
<span><%= this.summary %></span>
</div>
</li>
<% }); %>
</ul>
</div>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.giant { padding: 0; margin: 0}
.giant li { height: 100px;display: block; clear: both; float: none; position: relative; }
.giant li .container {border-bottom: 1px solid #999; padding: 10px; overflow: hidden;}
.giant li a {font-size: 24px;}
.giant li p {font-size: 18px;}
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<div class="pageScroller">
<ul class="blocks giant" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<% if (this.thumbnailUrl) { %>
<img src="<%= this.thumbnailUrl %>" height="75" width="75" />
<% } %>
<a href="<%= this.link %>"><%= this.title %></a>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
</div>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.swiss li a {font-family: helvetica;}
.swiss li p {font-family: helvetica;}
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<ul class="blocks grid swiss" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<% if (this.thumbnailUrl) { %>
<img src="<%= this.thumbnailUrl %>" height="60" width="60" />
<% } %>
<a href="<%= this.link %>"><%= this.title %></a>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.fridge {padding:0; margin: 0;}
.fridge li { display: block; clear: both; float: none; position: relative; height: 105px; background-color: black; }
.fridge li .container { border-bottom: 1px solid #999; padding: 3px; overflow: hidden; background-color: #333; }
.byline {color: black; line-height: 2em;}
.word {border: 1px solid black; border-bottom: 2px solid black; border-right: 2px solid right; color: black; background-color: white; margin: 5px; padding: 3px; line-height: 2em;}
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<% function wordify(text) { var content = []; $(text.split(" ")).each(function() { content.push("<span class='word'>"+this+"</span>"); } ); return content.join("") } %>
<div class="pageScroller">
<ul class="blocks fridge" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<a href="<%= this.link %>"><%= wordify(this.title) %></a>
<span class="byline"><%= wordify(this.byline) %></span>
<span><%= wordify(this.summary) %></span>
</div>
</li>
<% }); %>
</ul>
</div>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.waterfall {padding:0; margin: 0; font-size: 18px}
.waterfall li { display: block; float: left; position: relative; width: 3em; height: 2000px; background-color: black; }
.waterfall li .container { font-size: 18px; padding: 3px; overflow: hidden; background-color: #000; }
.waterfall li .container a { font-size: 18px; text-shadow: green 1px 1px 15px}
.waterfall li .container p { font-size: 18px; text-shadow: green 1px 1px 15px}
.byline {color: black; line-height: 2em;}
.letter {color: green; margin: 5px; padding: 3px; width: 1em; text-align: center}
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<% function letterfy(text) { var content = []; $(text.split("")).each(function() { content.push("<div class='letter'>"+this+"</div>"); } ); return content.join("") } %>
<div class="pageScroller">
<ul class="blocks waterfall" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<a href="<%= this.link %>"><%= letterfy(this.title) %></a>
<span class="byline"><%= letterfy(this.byline) %></span>
<span><%= letterfy(this.summary) %></span>
</div>
</li>
<% }); %>
</ul>
</div>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.shrinkWrap { background-color: #333 !important; }
.blackout li .container {background-color: #333; color: white;}
.blackout li .container a {font-family: helvetica; color: white}
.blackout li p {font-family: helvetica; color: white}
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<ul class="blocks grid blackout" id="set-<%= id %>">
<% $(items).each( function() { %>
<li id="slide-<%= this.link %>">
<div class="container fill">
<% if (this.thumbnailUrl) { %>
<img src="<%= this.thumbnailUrl %>" height="60" width="60" />
<% } %>
<a href="<%= this.link %>"><%= this.title %></a>
<p><%= this.summary %></p>
</div>
</li>
<% }); %>
</ul>
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
.flow { font-size: 36px; font-family: Georgia, Helvetica, Arial, sans-serif; background-color: white; padding: 10px; line-height: 0.9em; text-transform: lowercase;}
.flow a { color: #004276; text-decoration: none; font-weight: bold;}
.flow .byline { padding: 3px; overflow: hidden; color: #ccc }
.flow span { color: #bbb; letter-spacing: -0.1em; font-family: helvetica, arial, sans-serif }
Inline Script from http://prototype.nytimes.com/gst/articleSkimmer/
<div class="pageScroller flow blocks">
<% $(items).each( function() { %>
<a href="<%= this.link %>"><%= this.title %></a>
<span class="byline"><%= this.byline %></span>
<span><%= this.summary %></span>
<% }); %>
</div>
about:blank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment