function startTyntApp() {
var xPathNamespaceResolver=function(A){return"http://www.w3.org/1999/xhtml";};var findNodeByXPath=(function(){var B;if(typeof document.evaluate!="undefined"){B=function(C){return document.evaluate(C,document,xPathNamespaceResolver,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;};}else{B=function(C){return xPathNodeFinder(C);};}var A=function(C){return C.replace(/\/[A-Z]*/g,function(D){return D.toLowerCase();});};return function(D){var C=B(D);if(typeof C!="object"||!C){return B(A(D));}return C;};})();var xPathNodeFinder=function(N){var J,M,O,C,H,D,L,A,G,F,K;var E=/^text()/;var I=/\[(.*)\]/;var B=/^@id='(.*)'$/;xPathNodeFinder=function(T){var S,Q=window.document;K=T.split("/");G=K.length-1;A=E.test(K[G]);for(var P=1;P<=G;P++){var R=K[P].replace(/\[.*\]/,"");L=false;C=K[P].match(I);if(C&&C.length>1){L=C[1].match(B);}if(L&&L.length>1){Q=document.getElementById(L[1]);if(Q&&Q.nodeName==R&&Q.id==L[1]){if(P==G){return Q;}}else{return null;}}else{if(C&&C.length>1){F=+C[1];}else{F=1;}F=+((C&&C[1])||"1");O=Q.childNodes;M=O.length;H=0;D=false;for(J=0;J<M&&!D;J++){S=O[J];if((A&&P==G&&S.nodeType==3)||(S.nodeType==1&&R==S.nodeName)){H++;}if(H==F){Q=S;if(P==G){return Q;}D=true;}}}}return null;};return xPathNodeFinder(N);};var recursiveXPathCreator=(function(){var A=function(F){var E=0,B,D=F.parentNode.childNodes.length,C;for(B=0;B<D;B++){C=F.parentNode.childNodes[B];if(C.nodeType===F.nodeType){if(C.nodeType==3||C.nodeName==F.nodeName){E++;}if(C==F){return(E>1)?E:undefined;}}}return null;};return function(C,E,H){var B;var G="";if(C.parentNode&&C.parentNode.nodeType==1&&E<H){G=recursiveXPathCreator(C.parentNode,E+1,H);}switch(C.nodeType){case 1:var F=C.nodeName;var D=[];if(C.id&&document.getElementById(C.id)==C){D.push("@id='"+C.id+"'");}else{B=A(C);if(B){D.push(B);}}G+="/"+F;if(D.length>0){G+="[";for(B=0;B<D.length;B++){G+=D[B];}G+="]";}break;case 3:G+="/text()";B=A(C);if(B){G+="["+B+"]";}break;default:break;}return G;};})();String.prototype.unescapedHtml=function(){var A=document.createElement("div");A.innerHTML=this;return A.innerText;};String.prototype.compressedString=function(C,A){var B=this.replace(/[\t]/g," ").replace(/^ +/,A?" ":"");if(C){B=B.replace(/ +$/,A?" ":"");}B=B.replace(/ +/g," ");B=B.replace(/(\r\n)+/g," ");B=B.replace(/\r+/g," ");return B.replace(/\n+/g," ");};String.prototype.offsetIncludingWhiteSpace=function(G){var D=this.compressedString();var F=D.charAt(G);var E=0;if(F==" "){G--;E++;F=D.charAt(G);}var C=0;for(var B=0;B<G;B++){if(D.charAt(B)==F){C++;}}var A;for(A=0;A<this.length;A++){if(this.charAt(A)==F){C--;if(C==-1){break;}}}return A+E;};String.prototype.offsetExcludingWhiteSpace=function(A){return this.substring(0,A).compressedString().length;};String.prototype.fromJSON=function(){return eval("var _e = "+this+"; _e");};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};String.prototype.wordCount=function(){var A=this.trim();return(A?A.split(/\s+/i).length:0);};String.prototype.shouldCountCharacters=function(){var A=this.trim();if(A.length>=2){return A.charAt(0).isWordlikeCharacter()||A.charAt(A.length-1).isWordlikeCharacter()||A.charAt(A.length/2).isWordlikeCharacter();}else{return A.isWordlikeCharacter();}};String.prototype.isWordlikeCharacter=function(){var A=this.charCodeAt(0);return 3584<=A&&A<=3711||11904<=A&&A<=12591||12688<=A&&A<=40959||63744<=A&&A<=64255||65072<=A&&A<=65103||131072<=A&&A<=173791||194560<=A&&A<=195103;};Number.prototype.BASE_62_CHARACTERS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";Number.prototype.toBase62=function(){var B=62;if(this<B){return this.BASE_62_CHARACTERS.charAt(this);}else{var C=Math.floor(this/B);var A=this-C*B;if(C>=B){return C.toBase62()+this.BASE_62_CHARACTERS.charAt(A);}else{return this.BASE_62_CHARACTERS.charAt(C)+this.BASE_62_CHARACTERS.charAt(A);}}};Number.prototype.toBase62WithLength=function(C){var A=this.toBase62();var B=A.length;var D=C-B;return this.BASE_62_CHARACTERS.charAt(0).times(D)+A;};String.prototype.times=function(C){var A="";for(var B=0;B<C;B++){A+=this;}return A;};function typeOfObject(A){if(typeof A=="undefined"||(typeof A=="object"&&!A)){return false;}var B=typeof A;if(B=="object"||B=="function"){switch(A.constructor){case Array:return"array";case RegExp:return"regexp";default:break;}}return B;}(function(){var C={"\n":"\\n","\r":"\\r",'"':'\\"',"\t":"\\t","\b":"\\b","\f":"\\f","\\":"\\\\"};var D=function(E){return C[E]||"\\u00"+Math.floor(E.charCodeAt()/16).toString(16)+(E.charCodeAt()%16).toString(16);};var B=function(G,F){var I=F.length;if(typeof G!="function"){throw new TypeError();}var E=new Array(I);var J=arguments[1];for(var H=0;H<I;H++){if(H in F){E[H]=G.call(J,F[H],H,F);}}return E;};var A=function(F){switch(typeOfObject(F)){case"string":return'"'+F.replace(/([\x00-\x1f\\"])/g,D)+'"';case"array":return"["+B(A,F).join(", ")+"]";case"object":var E=[];for(var G in F){E.push(A(G)+": "+A(F[G]));}return"{"+E.join(", ")+"}";case"number":if(isFinite(F)){break;}case false:return"null";default:break;}return String(F);};})();var toURI=function(D){var A=[];var C="";for(var B in D){A.push(C,B,"=",D[B]);C="&";}return A.join("");};var safeURIComponent=function(A){return encodeURIComponent(A).replace(/\'/g,"%27");};var getValuesFromUri=function(E){if(!E){return{};}var F=E.substring(E.indexOf("?")+1);var A={};var B=F.split("&");for(var C=0;C<B.length;C++){var D=B[C].split("=");if(D[0].indexOf("amp;")==0){D[0]=D[0].substring(4);}A[D[0]]=D[1];}return A;};var START_TIME=1228118400000;var generateGuid=function(E){var D=0;var B=(E.length<100?E.length:100);for(var A=0;A<B;A++){D+=E.charCodeAt(A);}var C=Math.floor(Math.random()*3844);var F=Math.abs(new Date().getTime()-START_TIME);return F.toBase62WithLength(7)+((D+C)%3844).toBase62WithLength(2);};var writeTopLevelCookie=function(C,A){var B=document.location.hostname.split(".");var D=2;do{var E=B.slice(B.length-D,B.length).join(".");document.cookie=C+";path=/;domain=."+E+";"+A;D++;}while(document.cookie.indexOf(C)==-1&&D<=B.length);if(document.cookie.indexOf(C)==-1){document.cookie=C+";path=/;"+A;}};var getValueFromCookie=function(D,C){var F=C+"=";var A=D.split(";");for(var B=0;B<A.length;B++){var E=A[B];while(E.charAt(0)==" "){E=E.substring(1,E.length);}if(E.indexOf(F)==0){return E.substring(F.length,E.length);}}return null;};var removeScriptDescendants=function(D){var C=D.getElementsByTagName("script");for(var B=C.length-1;B>=0;B--){var A=C[B];A.parentNode.removeChild(A);}};var needToAdjustForWhiteSpace=(function(){var B,A=document.createElement("ul");A.innerHTML="    <li></li>";if(typeof A.firstChild!="unknown"){B=A.firstChild.nodeType==3;}A=null;return B;})();if(typeof document.body!="undefined"&&document.body&&typeof document.body.createTextRange!="undefined"){var elementNodeOffset=function(C){var B=C.parentNode;var A=B.childNodes.length;while(A--){if(B.childNodes[A]==C){return A;}}throw new Error("Could not find child in parent node");};var nodeCharacters=(function(){var A=document.body.createTextRange();return function(B){if(B.nodeType==1){A.moveToElementText(B);return rangeCharacters(A);}else{if(B.nodeType==3){return B.nodeValue.length;}}return 0;};})();var findNodeAndOffset=(function(){var A=document.body.createTextRange();return function(H,D){var F=arguments[2]||0;var C,J,G,E,I;var B=H.childNodes.length;for(G=0;G<B;G++){C=H.childNodes[G];if(C.nodeType==1){if(F<D){A.moveToElementText(C);F+=rangeCharacters(A);E=C;continue;}return{node:H,offset:elementNodeOffset(C)};}else{if(C.nodeType==3){J=C.nodeValue.length;if(F+J<D){F+=J;E=C;I=C;continue;}return{node:C,offset:D-F};}}}if(E){if(E.nodeType==3){return{node:E,offset:E.nodeValue.length};}while(!E.firstChild&&E.previousSibling){E=E.previousSibling;}if(E.firstChild){while(E.firstChild){E=E.firstChild;}if(E){if(E.nodeType!=3){return{node:E,offset:D};}else{return{node:E,offset:E.nodeValue.length};}}}else{return{node:E,offset:D};}}throw new Error("Could not find boundary");};})();var findStartBaseOffsetByNode=function(E,C){var F=0,G,A,B=0,D=C.childNodes.length;while(!A&&B<D){G=C.childNodes[B];if(G==E){A=true;}else{F+=nodeCharacters(G);}B++;}return F;};var findEndBaseOffsetByNode=function(D,C){var E=0,F,A,B=C.childNodes.length;while(!A&&B--){F=C.childNodes[B];if(F==D){A=true;}else{E+=nodeCharacters(F);}}return E;};var rangeCharacters=function(A){throw new Error("rangeCharacters horribly inefficient.  Temporarily disabled!");};var commonAncestor=function(B,C){var D=B,A;while(D){A=C;while(A&&D!=A){A=A.parentNode;}if(D==A){if(D.nodeType==3){D=D.parentNode;}break;}D=D.parentNode;}return D||document.body;};var findStartOrEndNodeAndOffset=function(B,E){var C=B.duplicate();C.collapse(E=="start");var D=C.parentElement();var A=document.body.createTextRange();A.moveToElementText(D);var F=(Math.abs(C.move("character",-16777215))-Math.abs(A.move("character",-16777215)));return findNodeAndOffset(D,F);};}var textRange=function(C){var F,B,G,J;var A,E,L,H,I;if(arguments.length==1){if(typeof C.getRangeAt!="undefined"){G=C.getRangeAt(0);E=G.startContainer;H=G.startOffset;L=G.endContainer;I=G.endOffset;}else{try{G=C.createRange();F=findStartOrEndNodeAndOffset(G,"start");E=F.node;H=F.offset;F=findStartOrEndNodeAndOffset(G,"end");L=F.node;I=F.offset;}catch(D){E=null;H=null;L=null;I=null;}}}else{G=typeof document.createRange=="undefined"?document.body.createTextRange():document.createRange();if(typeof G.setStart!="undefined"){G.setStart(arguments[0],arguments[1]);E=arguments[0];H=arguments[1];L=arguments[2];I=arguments[3];G.setEnd(L,I);}else{if(arguments[0].nodeType==1){G.moveToElementText(arguments[0]);G.moveStart("character",arguments[1]);}else{G.moveToElementText(arguments[0].parentNode);B=findStartBaseOffsetByNode(arguments[0],arguments[0].parentNode);G.moveStart("character",arguments[1]+B);E=arguments[0];H=arguments[1];}J=G.duplicate();if(arguments[2].nodeType==1){J.moveToElementText(arguments[2]);J.moveEnd("character",arguments[3]);}else{J.moveToElementText(arguments[2].parentNode);var K=J.text.length;J.moveEnd("character",-1);if(K!=J.text.length){J=G.duplicate();J.moveToElementText(arguments[2].parentNode);}B=findEndBaseOffsetByNode(arguments[2],arguments[2].parentNode);if(arguments[1]>arguments[3]){J.moveEnd("character",-(B+(arguments[2].nodeValue.length-arguments[3]-arguments[1])));}else{J.moveEnd("character",-(B+arguments[2].nodeValue.length-arguments[3]));}G.setEndPoint("EndToEnd",J);}L=arguments[2];I=arguments[3];}}A=G.commonAncestorContainer||commonAncestor(E,L);this.range=function(){return G;};this.toString=function(){if(typeof G.text=="string"){return G.text;}else{return G.toString();}};this.startContainer=function(){return E;};this.startOffset=function(){return H;};this.endContainer=function(){return L;};this.endOffset=function(){return I;};this.commonAncestorContainer=function(){return A;};this.collapse=function(M){G.collapse(M);};this.detach=function(){if(typeof G.detach!="undefined"){G.detach();}G=null;};this.isPointInRange=(function(){if(typeof G.isPointInRange!="undefined"){return function(M,N){return G.isPointInRange(M,N);};}return function(M,N){return G.inRange(new textRange(M,N,M,M.nodeValue.length).range());};})();};var windowSelection={};windowSelection.capture=function(){if(typeof window.getSelection!="undefined"){this.selection=window.getSelection();}else{this.selection=document.selection;}return this;};windowSelection.empty=function(){if(this.selection&&typeof this.selection.empty!="undefined"){this.selection.empty();}};var convertRangeOffset=function(A,B){if(A.nodeType==3){if(B){return A.data.offsetExcludingWhiteSpace(B);}return B;}};var reconvertRangeOffset=function(A,B){if(A.nodeType==3){if(B){return A.data.offsetIncludingWhiteSpace(B);}return B;}};var spanText=function(B,H,G,F,E){var A=G.parentNode;var D=G.nextSibling;var C;B.appendChild(document.createTextNode(H.substring(F,E)));A.removeChild(G);if(F){C=document.createTextNode(H.substring(0,F));if(D){A.insertBefore(C,D);}else{A.appendChild(C);}}if(E<H.length){C=document.createTextNode(H.substring(E,H.length));if(D){A.insertBefore(C,D);}else{A.appendChild(C);}D=C;}if(D){A.insertBefore(B,D);}else{A.appendChild(B);}};var spanAllText=function(A,C,B){spanText(A,C,B,0,C.length);};var spanStartOfText=function(B,D,C,A){spanText(B,D,C,0,A);};var spanEndOfText=function(B,D,C,A){spanText(B,D,C,D.length-A,D.length);};var firstTextNodeInRange=function(D,B){var G,C,A,E=D.childNodes.length;for(C=0;C<E;C++){G=D.childNodes[C];A=G.nodeType;if(A==3){if(B.isPointInRange(G,0)&&!isElementWithoutText.test(D.tagName)){return G;}}else{if(A==1){var F=firstTextNodeInRange(G,B);if(F){return F;}}}}return null;};var lastTextNodeInRange=function(D,B){var F,A,C=D.childNodes.length;while(C--){F=D.childNodes[C];A=F.nodeType;if(A==3){if(B.isPointInRange(F,0)&&!isElementWithoutText.test(D.tagName)){return F;}return F;}else{if(A==1){var E=lastTextNodeInRange(F,B);if(E){return E;}}}}return null;};var isPreformattedText=function(A){return(/^pre$/i.test(A.parentNode.tagName));};var highlighter={};highlighter.highlight=(function(){var Y;var R,D;var A=/^(img|nobr|br|hr|tr|table|tbody|thead|tfoot|dl|dir|menu|ol|ul|select|optgroup|fieldset|col(group)?|form)$/i;var F=/[^\t\n\r ]/;var T;var L;var Z;var J,G,E;var U,I;var H;var Q,N;var M,X;var C=function(a){var c=document.createElement("span");var b=c.style;c.className="tyntHighlight";b.width="auto";b.display="inline";b.position="static";b.backgroundColor=a;c.id="TyntHighlight"+L++;return c;};var O=function(){H=Q=N=null;};var S=function(a){O();throw new Error(a);};function K(b){var c=[];var a=b.length;while(a--){c[a]=b[a];}return c;}var B=function(c,f,j,e,d){var a,b,g,k,i,h;b=K(j.childNodes);g=b.length;while(g--&&!R){k=false;a=b[g];if(typeof a.nodeType=="number"){if(a==Q){R=true;}else{if(a==N){D=true;}}switch(a.nodeType){case 1:if(a.firstChild){if(/tynt( |$)/i.test(a.className)){S("Highlight may not include Tynt elements ("+a.tagName+"."+a.className+")");}B(a,a,a,e,d);}break;case 3:if(F.test(a.nodeValue)&&!A.test(j.tagName)){i=C(d);Z=a.nodeValue;if(!isPreformattedText(a)){Z=Z.compressedString(true,true);}if(a==Q){g=T.indexOf(Z);if(!g){spanAllText(i,Z,a);}else{h=Z.substring(M,Z.length);if(!T.indexOf(h)){spanEndOfText(i,Z,a,Z.length-M);}else{if(!isPreformattedText(a)&&/^ /.test(Z)&&T.indexOf(h)==1){spanEndOfText(i,Z,a,X-1);}else{spanEndOfText(i,Z,a,Z.length-M);}}}}else{if(a==N){if(X){h=Z.substring(0,X);if(T.indexOf(h)==T.length-h.length){spanStartOfText(i,Z,a,X);}else{if(!isPreformattedText(a)&&/^ /.test(Z)&&T.indexOf(h)==T.length-h.length+1){spanStartOfText(i,Z,a,X-1);}else{spanText(i,Z,a,0,X);}}}else{k=true;}}else{if(D&&e.isPointInRange(a,0)){spanAllText(i,Z,a);}else{k=true;}}}if(!k){Y.spans.push(i.id);}}break;default:break;}}}};var P=function(a,c,b){while(Z.indexOf(b,a+1)!=-1){G.push(a);a=Z.indexOf(b,a+1);}};var W=function(e){var c=G.length;var b,a,d;while(c--){d=Math.abs(G[c]-e);if(!b||d<b){b=d;a=c;}}return a;};var V=function(c,f,e,a,d){var b=W(a);spanText(c,f,e,G[b],G[b]+d.length);};return function(c){Y=this;G=[];var a,f,b=this.range;Y=this;Y.spans=[];D=R=false;L=0;T=c.content;Q=findNodeByXPath(c.start_node_xpath);N=findNodeByXPath(c.end_node_xpath);if(typeof Q!="object"||!Q){S("Failed to find start node: "+c.start_node_xpath);}if(typeof N!="object"||!N){S("Failed to find end node "+c.end_node_xpath);}b=this.range=new textRange(Q,needToAdjustForWhiteSpace?reconvertRangeOffset(Q,c.start_offset):c.start_offset,N,needToAdjustForWhiteSpace?reconvertRangeOffset(N,c.end_offset):c.end_offset);Q=b.startContainer();N=b.endContainer();U=b.startOffset();I=b.endOffset();H=b.commonAncestorContainer();M=needToAdjustForWhiteSpace?reconvertRangeOffset(Q,c.start_offset):c.start_offset;X=needToAdjustForWhiteSpace?reconvertRangeOffset(N,c.end_offset):c.end_offset;if(Q.nodeType==1){if(A.test(Q.tagName)){var g=Q;Q=Q.nextSibling||Q.parentNode;while(Q.firstChild==g&&Q.childNodes.length==1){g=Q;Q=Q.parentNode;}}if(Q.nodeType==1){Q=firstTextNodeInRange(Q,b);}c.start_node_xpath=recursiveXPathCreator(Q,0,99);f=true;}if(N.nodeType==1){if(A.test(N.tagName)){N=N.previousSibling||N.parentNode;}if(N.nodeType==1){N=lastTextNodeInRange(N,b);}c.end_node_xpath=recursiveXPathCreator(N,0,99);f=true;}if(f){b=this.range=new textRange(Q,needToAdjustForWhiteSpace?reconvertRangeOffset(Q,c.start_offset):c.start_offset,N,needToAdjustForWhiteSpace?reconvertRangeOffset(N,c.end_offset):c.end_offset);}if(Q==N){E=X-M;var d=C(c.color);Z=Q.nodeValue;if(!isPreformattedText(Q)){Z=Z.compressedString(true,true);T=T.compressedString(true,true);}if(E==Z.length||(/^ /.test(Z)&&!(/^ /.test(T))&&E==Z.length-1)||(/ $/.test(Z)&&!(/ $/.test(T))&&E==Z.length-1)){spanAllText(d,Z,Q);}else{J=Z.indexOf(T);if(J==-1){S('Could not find content: "'+T+'" in "'+Z+'"');}else{G.push(J);P(J,Z,T);if(G.length==1){spanText(d,Z,Q,G[0],G[0]+T.length);}else{var e=G.length;while(e--&&!a){if(G[e]==M){spanText(d,Z,Q,G[e],G[e]+T.length);a=true;}else{if(/^ /.test(Z)&&G[e]==M+1){spanText(d,Z,Q,G[e]+1,G[e]+1+T.length);a=true;}}}if(!a){V(d,Z,Q,M,T);}}}}Y.spans=[d.id];}else{B(b.startContainer(),b.endContainer(),b.commonAncestorContainer(),b,c.color);}if(!this.spans.length){S("Highlight failed--no spans created");}O();};})();highlighter.render=function(A){try{this.spans=this.spans||[];if(A.start_node_xpath){this.highlight(A);if(this.spans.length){document.getElementById(this.spans[this.spans.length-1]).scrollIntoView();}}}catch(B){}};var TraceServer={};TraceServer.WRITE_URL="http://w1.tcr1.tynt.com";TraceServer.READ_URL="http://r1.tcr1.tynt.com";TraceServer.PAGE_TRACKER_URL="http://p1.tcr1.tynt.com";var userId;var sValue;var guid;var attributionsOn;var attribution2=0;var shouldNotTrace=false;var httpRequestCallBackById={};var httpRequestCurrentId=0;var COPY_WITH_ATTRIBUTION=0,COPY_WITH_NO_ATTRIBUTION=1,IMAGE=3;var MINIMUM_WORDS_FOR_COPY_WITH_ATTRIBUTION=7;var MINIMUM_CHARACTERS_FOR_COPY_WITH_ATTRIBUTION=14;var GENERATED_FROM_TRACE=1,GENERATED_FROM_ADDRESS_BAR=2,GENERATED_FROM_TYNT_COM=3,GENERATED_FROM_VISUALIZER=6,GENERATED_FROM_TWEET=7;var generatedTrafficType=null;var MAX_PACKET_SIZE=2048;var firstCopy=true;var sponsor;var sponsorText;var sponsorId;var attributionPrefix="Read more: ";var attributionSuffix="";var attribution2StaticText="Under Creative Commons License: ";var attribution2Types=["","Attribution","Attribution Share Alike","Attribution No Derivatives","Attribution Non-Commercial","Attribution Non-Commercial Share Alike","Attribution Non-Commercial No Derivatives"];var licenseUrl=["","http://creativecommons.org/licenses/by/3.0","http://creativecommons.org/licenses/by-sa/3.0","http://creativecommons.org/licenses/by-nd/3.0","http://creativecommons.org/licenses/by-nc/3.0","http://creativecommons.org/licenses/by-nc-sa/3.0","http://creativecommons.org/licenses/by-nc-nd/3.0"];var documentTitle=function(){return(document.title||window.location.hostname).trim().replace(new RegExp(window.location.hash,"g"),"");};var documentCharset=function(){return document.charset||document.characterSet;};var httpGetTrace=function(B){var A=document.createElement("script");A.id="TracerScript";A.src=B;document.getElementsByTagName("body")[0].appendChild(A);A=null;};var httpGetWithoutResponse=function(B){var A=document.createElement("img");A.src=B;A.height=0;A.width=0;if(window.addEventListener){A.addEventListener("load",function(C){(C.target||C.srcElement).parentNode.removeChild(C.target||C.srcElement);},false);A.addEventListener("error",function(C){(C.target||C.srcElement).parentNode.removeChild(C.target||C.srcElement);},false);}else{A.attachEvent("onload",function(C){(C.target||C.srcElement).parentNode.removeChild(C.target||C.srcElement);});A.attachEvent("onerror",function(C){(C.target||C.srcElement).parentNode.removeChild(C.target||C.srcElement);});}document.getElementsByTagName("body")[0].appendChild(A);A=null;};window.renderTraceResult=function(A,C){var B=document.getElementById("TracerScript");if(B){B.parentNode.removeChild(B);}if(A==200){if(generatedTrafficType!=GENERATED_FROM_TWEET){var D=C;highlighter.render(D);}}startListeningForTraces();};var getTracerScriptUri=function(){var A=document.getElementsByTagName("script");for(var B=0;B<A.length;B++){if(/\/tracer.*\?/i.test(A[B].src)){return A[B].src;}}return null;};var configureUrls=function(){var B="tcr"+sValue;TraceServer.WRITE_URL=TraceServer.WRITE_URL.replace("tcr1",B);TraceServer.READ_URL=TraceServer.READ_URL.replace("tcr1",B);TraceServer.PAGE_TRACKER_URL=TraceServer.PAGE_TRACKER_URL.replace("tcr1",B);if(typeof TraceServerPort!="undefined"){var A=TraceServerPort+(+(sValue));TraceServer.WRITE_URL+=(":"+A);TraceServer.READ_URL+=(":"+A);TraceServer.PAGE_TRACKER_URL+=(":"+A);}};var getNoTracingTag=function(){return(shouldNotTrace=/tracer=no_tracing/.test(window.location.href));};var getHeatmapTag=function(){return/tracer=heatmap/.test(window.location.href);};var verifyIfTracerTest=function(){var B=/tracer=test/.test(window.location.href);if(B){var A=TraceServer.WRITE_URL+"/script/verify/"+userId;httpGetWithoutResponse(A);}return B;};var parseTraceGuidFromUrl=function(B){var A=B.match(/ixzz=?([^?&$]*)/);return A&&A.length==2?A[1]:null;};var parseSourceFromUrl=function(A){var C=A.match(/ixzz=?([^?$]*)/);if(!C){return null;}var B=C[1].match(/&([^?$]*)/);if(!B){return null;}if(B[1]=="t"){return GENERATED_FROM_TYNT_COM;}else{if(B[1]=="p"){return GENERATED_FROM_VISUALIZER;}else{if(B[1]=="w"){return GENERATED_FROM_TWEET;}}}return null;};var parseAddressBarGuidFromUrl=function(A){var B=A.match(/axzz([^?$]*)/);return B&&B.length==2?B[1]:null;};var linkFromGuid=function(B){var A=window.location.href;A=A.replace(/#(i|a)xzz=?(.*)$/g,"");var C="ixzz"+B;return A+"#"+C;};var handleImageDragCopy=(function(B){var C;var A=function(E){var D=E.target||E.srcElement;if(D!=C){if(window.addEventListener){document.removeEventListener("dragexit",A,false);window.removeEventListener("dragleave",A,false);}else{document.getElementsByTagName("body")[0].attachEvent("ondragleave",A);}handleTracing(C);}return true;};return function(D){C=D.target||D.srcElement;if(window.removeEventListener){document.removeEventListener("dragexit",A,false);try{window.removeEventListener("dragleave",A,false);}catch(E){}}else{document.getElementsByTagName("body")[0].detachEvent("ondragleave",A);}if(C.nodeName=="IMG"){if(window.addEventListener){document.addEventListener("dragexit",A,false);window.addEventListener("dragleave",A,false);}else{document.getElementsByTagName("body")[0].attachEvent("ondragleave",A);}}return true;};})();var handleImageCopyThruContextMenu=(function(C){var B;var A=function(D){window.removeEventListener("blur",A,false);handleTracing(B);return true;};return function(D){B=D.target||D.srcElement;window.removeEventListener("blur",A,false);if(B.nodeName=="IMG"&&B.parentNode.nodeName!="A"){window.addEventListener("blur",A,false);window.setTimeout(function(){document.removeEventListener("blur",A,false);},10000);}return true;};})();var eventHandler=function(A){var B=A.target||A.srcElement||sel.selection.getRangeAt(0).startContainer;handleTracing(B);};var startListeningForTraces=function(){if(verifyIfTracerTest()){return ;}if(getNoTracingTag()){return ;}if(window.addEventListener){if(!window.navigator.userAgent.match("Firefox/2")){document.getElementsByTagName("body")[0].addEventListener("copy",eventHandler,false);}document.addEventListener("mousedown",handleImageDragCopy,false);document.addEventListener("contextmenu",handleImageCopyThruContextMenu,false);}else{document.getElementsByTagName("body")[0].attachEvent("oncopy",eventHandler);document.getElementsByTagName("body")[0].attachEvent("onmousedown",handleImageDragCopy);}};var createGeneratedTrafficCookie=function(B){var A=new Date();A.setTime(A.getTime()+(24*60*60*1000));writeTopLevelCookie("tracertraffic="+B.toString(),"expires="+A.toUTCString());};var manageGeneratedTrafficCookie=function(){var A=(document.cookie.indexOf("tracertraffic=")!=-1);if(A){if(!document.referrer||shouldDeleteCookie(document.referrer,window.location.host)){writeTopLevelCookie("tracertraffic=0","expires=Thu, 01 Jan 1970 00:00:00 GMT");}}};var manageLastTracerUrlCookie=function(){var A=new Date();A.setTime(A.getTime()+(2*60*1000));writeTopLevelCookie("tracerurl="+window.location.href,"expires="+A.toUTCString());};var lastTracerUrlFromCookie=function(){return getValueFromCookie(document.cookie,"tracerurl");};var shouldDeleteCookie=function(B,A){return B.indexOf(A)==-1;};var getAndDisplayTraceFromServer=function(B){var A=TraceServer.READ_URL+"/a/v/"+B+(/\?trace_owner_view/.test(window.location.href)?"?trace_owner_view=y&":"?")+"site="+userId+"&url="+encodeURIComponent(window.location.href)+"&referrer="+encodeURIComponent(document.referrer);httpGetTrace(A);};var showTrace=function(){guid=parseTraceGuidFromUrl(window.location.href);if(guid){getAndDisplayTraceFromServer(guid);return true;}return false;};var trackPage=function(){tracerTrafficCookie=getValueFromCookie(document.cookie,"tracertraffic");httpGetWithoutResponse(TraceServer.PAGE_TRACKER_URL+"/a/p?id="+userId+"&title="+encodeURIComponent(documentTitle())+(tracerTrafficCookie?("&et="+tracerTrafficCookie):"")+"&timestamp="+new Date().getTime()+"&_charset_="+documentCharset());};var trackAddressBar=function(A){httpGetWithoutResponse(TraceServer.WRITE_URL+"/a/a?guid="+A+"&url="+encodeURIComponent(window.location.href)+"&site_guid="+userId+"&referrer="+encodeURIComponent(document.referrer)+"&timestamp="+new Date().getTime(),function(B){});};var isNew=function(){var A=[];return function(C){for(var B=A.length-1;B>=0;B--){if(A[B]==C){return false;}}A.unshift(C);if(A.length>3){A.pop();}return true;};};var copyStringIsNew=isNew();var imageIsNew=isNew();var setupChunkedData=function(C){var A=[];A.push(["_charset_",documentCharset()],["site_guid",C.site_guid],["name",safeURIComponent(C.name.substring(0,255))],["word_count",C.word_count.toString()]);if(C.first_type){A.push(["first_type","1"]);}if(C.sponsor_id){A.push(["sponsor_id",C.sponsor_id.toString()]);}if(C.sponsor){A.push(["sponsor",safeURIComponent(C.sponsor)]);}if(C.width&&C.height){A.push(["width",C.width.toString()]);A.push(["height",C.height.toString()]);}A.push(["content",safeURIComponent(C.content)]);if((C.trace_type==COPY_WITH_ATTRIBUTION||C.trace_type==COPY_WITH_NO_ATTRIBUTION)&&C.start_node_xpath&&C.end_node_xpath&&C.start_node_xpath.length>4&&C.end_node_xpath.length>4){A.push(["start_offset",C.start_offset.toString()],["end_offset",C.end_offset.toString()],["start_node_xpath",safeURIComponent(C.start_node_xpath)],["end_node_xpath",safeURIComponent(C.end_node_xpath)]);}for(var B=A.length-1;B>=0;B--){if(typeof A[B][1]==="undefined"||(typeof A[B][1]==="string"&&A[B][1].length==0)){A.splice(B,1);}}return A;};var buildPackets=function(I){var J=setupChunkedData(I);var K=[];var E="guid=&".length+I.guid.length;var Q="packet=&".length+12;var N=(TraceServer.WRITE_URL+"/a/t/x#?").length;var L=N+E+Q;var G=MAX_PACKET_SIZE-L;var F=J.length;var C=0;var D,P,O,H,M,B;P=0;D=0;var A=0;K[A]={guid:I.guid,total:null};while(C<F){O=J[C][0];M=O.length+2;H=G-M-D;if(H>0){K[A][O]=J[C][1].substring(P,P+H);B=K[A][O].slice(-2).indexOf("%");if(B>-1){K[A][O]=J[C][1].substring(P,P+H-2+B);D+=B+2;}D+=K[A][O].length+M;P+=K[A][O].length;}else{D=G;}if(D>=G){K[++A]={guid:I.guid,packet:A};D=0;}if(P>=J[C][1].length){C++;P=0;}}K[0].total=K.length;return K;};var handleTracing=(function(){var C;var A;var F=null;var K=null;var E=null;var G=null;var H=null;var D=false;var L=function(O){var P=buildPackets(O);httpGetWithoutResponse(TraceServer.WRITE_URL+"/a/t/"+O.trace_type.toString()+"?"+toURI(P[0]));for(var N=1;N<P.length;N++){httpGetWithoutResponse(TraceServer.WRITE_URL+"/a/x/"+O.trace_type.toString()+"?"+toURI(P[N]));}};var J=function(O){var U="";if(attributionsOn){U=attributionPrefix;if(scriptValues.st&&scriptValues.st==1){U=U+'<a href="'+O+'">'+documentTitle()+"</a> ";}if(!scriptValues.su||scriptValues.su!=0){U=U+'<a href="'+O+'">'+O+"</a>";}if(attributionSuffix.length>0){U=U+"\n<br>"+attributionSuffix;}if(attribution2>0){U=U+"\n<br>"+attribution2StaticText+'<a href="'+licenseUrl[attribution2]+'">'+attribution2Types[attribution2]+"</a>";}}if(sponsor){D=true;if(U.length>0){U=U+"\n<br>";}if(sponsorId){U=U+sponsorText+' <a href="http://tcr'+sValue+".tynt.com/ads/"+sponsorId+"/"+guid+'">'+sponsor+"</a>";}else{U=U+sponsorText+' <a href="http://tcr'+sValue+".tynt.com/ads/"+sponsor+"/"+userId+"/"+guid+'">'+sponsor+"</a>";}}var V=document.getElementsByTagName("body")[0];var X,P;X=document.createElement("div");X.style.overflow="hidden";X.style.color="#000000";X.style.backgroundColor="transparent";X.style.textAlign="left";X.style.textDecoration="none";X.style.border="none";X.id="TixyyLink";if(typeof window.getSelection!="undefined"){var T=window.getSelection();if(T.toString()){if(typeof T.setBaseAndExtent!="undefined"){var W=T.getRangeAt(0);X.style.width=0.1;X.style.height=0.1;X.style.position="absolute";X.style.top="-1000px";X.style.left="-1001px";X.appendChild(W.cloneContents());X.appendChild(document.createElement("br"));X.appendChild(document.createElement("br"));var a=document.createElement("span");a.innerHTML=U;X.appendChild(a);removeScriptDescendants(X);X.appendChild(document.createElement("br"));var R=X.innerText.length;V.appendChild(X);if(X.innerText.length!=R){X.style.overflow="";}T.selectAllChildren(X);window.setTimeout(function(){X.parentNode.removeChild(X);window.getSelection().setBaseAndExtent(W.startContainer,W.startOffset,W.endContainer,W.endOffset);},0);}else{P=document.createElement("div");P.style.display="none";V.appendChild(P);X.innerHTML="<br>"+U+"<br>";P.appendChild(document.createElement("br"));P.appendChild(X);P.appendChild(document.createElement("br"));var Z=document.createRange();Z.selectNode(X);T.addRange(Z);window.setTimeout(function(){P.parentNode.removeChild(P);},0);}}}else{var S=document.documentElement.scrollLeft||document.body.scrollLeft;var Q=document.documentElement.scrollTop||document.body.scrollTop;P=document.createElement("div");P.style.visibility="hidden";P.style.overflow="hidden";P.style.position="absolute";P.style.left=S+20+"px";P.style.top=Q+20+"px";P.style.width="1px";P.style.height="1px";V.appendChild(P);var N=document.selection.createRange();X.innerHTML=N.htmlText+"<br><br>"+U+"<br>";P.appendChild(document.createElement("br"));P.appendChild(X);P.appendChild(document.createElement("br"));var Y=V.createTextRange();Y.moveToElementText(X);Y.select();window.setTimeout(function(){P.parentNode.removeChild(P);if(N.text!=""){N.select();document.documentElement.scrollLeft=S;document.body.scrollLeft=S;document.documentElement.scrollTop=Q;document.body.scrollTop=Q;}},0);}};var B=function(){try{if(F.length<=2000&&C.startContainer()!=null){K=recursiveXPathCreator(C.startContainer(),0,99);E=recursiveXPathCreator(C.endContainer(),0,99);if(!findNodeByXPath(K)){throw new Error('Anomaly detected in XPath implementation--start node Xpath: "'+K+'" failed to evaluate');}if(!findNodeByXPath(E)){throw new Error('Anomaly detected in XPath implementation--end node Xpath: "'+E+'" failed to evaluate');}G=(needToAdjustForWhiteSpace)?convertRangeOffset(C.startContainer(),C.startOffset()):C.startOffset();H=(needToAdjustForWhiteSpace)?convertRangeOffset(C.endContainer(),C.endOffset()):C.endOffset();}else{K=E=G=H=null;}}catch(N){}};var M=function(){var N=COPY_WITH_NO_ATTRIBUTION;if(attributionsOn||sponsor){var O=F.shouldCountCharacters();if(O&&F.length>MINIMUM_CHARACTERS_FOR_COPY_WITH_ATTRIBUTION||!O&&F.wordCount()>MINIMUM_WORDS_FOR_COPY_WITH_ATTRIBUTION){J(linkFromGuid(guid));if(attributionsOn){N=COPY_WITH_ATTRIBUTION;}}}return N;};var I=function(S,P,Q,O,R,T,N){var U={guid:guid,url:decodeURIComponent(window.location.href).replace(/#ixzz=?.*$/,""),site_guid:userId,referrer:decodeURIComponent(document.referrer),name:documentTitle(),word_count:F.wordCount(),trace_type:S,content:F,first_type:firstCopy};firstCopy=false;if(S==IMAGE){U.width=T;U.height=N;}else{U.start_node_xpath=P||null;U.end_node_xpath=Q||null;U.start_offset=O||0;U.end_offset=R||0;}if(D){if(sponsorId){U.sponsor_id=sponsorId;}else{U.sponsor=sponsor;}}L(U);};return function(Q){D=false;A=windowSelection.capture();var R=Q.src;if(R){if(imageIsNew(R)){F=R;guid=generateGuid(F);I(IMAGE,null,null,0,0,Q.width,Q.height);}}else{if(typeof A.selection.toString!="undefined"&&!A.selection.toString().trim()){return true;}try{C=new textRange(A.selection);if(!C.toString().trim()){return true;}}catch(P){return true;}F=(typeof A.selection.toString!="undefined")?A.selection.toString():C.toString();var N=copyStringIsNew(F);if(N){B();guid=generateGuid(F);}var O=M();if(N){I(O,K,E,G,H);}}C=null;return true;};})();var isAddressBarTrackingOn=function(A){return A.b==1;};var attribution2Value=function(A){if(A.cc&&A.cc>0&&A.cc<7){return A.cc;}return 0;};var isAttributionOn=function(A){return A.a!=0;};var googleCSEScriptUriPresent=function(){var A=document.getElementsByTagName("script");for(var B=0;B<A.length;B++){if(/\/show_afs_search\.js/i.test(A[B].src)){return true;}}return false;};var addAddressBarTracking=function(){if(googleCSEScriptUriPresent()){return ;}if(window.location.hash==""){window.location.hash="axzz"+generateGuid(window.location.href);}};var setTyntVars=function(B){sValue=B.s||1;attributionsOn=isAttributionOn(B);attribution2=attribution2Value(B);if(typeof tyntAP!="undefined"){attributionPrefix=tyntAP+" ";}if(typeof tyntAS!="undefined"){attributionSuffix=tyntAS+" ";}var A=typeof tyntVariables=="undefined"?{}:tyntVariables;if(A.ap){attributionPrefix=A.ap+" ";}if(A.as){attributionSuffix=A.as+" ";}if(A.sp){sponsorId=A.spid;sponsorText=A.spt;sponsor=A.sp;}if(B.sp){if(B.spt){sponsorText=decodeURIComponent(B.spt);}sponsor=decodeURIComponent(B.sp);}};var tracerBlocked=function(){if(/disableTracer=/.test(window.location.href)){var B=window.location.href.match(/disableTracer=([^?$]*)/)[1];var A=new Date();A.setDate((B&&B=="on")?(A.getDate()+365):(A.getDate()-2));writeTopLevelCookie("disableTracer="+userId+";expires="+A.toUTCString());document.body.innerHTML='<br><br><br><span style="font-size: 32px;">Tynt Insight has been turned '+((B&&B=="on")?"off":"on")+" in this browser.<br>You may close this window.</span>";return true;}var C=getValueFromCookie(document.cookie,"disableTracer");if(C&&C==userId){return true;}return false;};var scriptValues=getValuesFromUri(getTracerScriptUri());if(!scriptValues.user){throw new Error("Error finding Tynt Insight script values. Please check your HTML for errors.");}userId=scriptValues.user;if(!tracerBlocked()){setTyntVars(scriptValues);configureUrls();if(getHeatmapTag()){var script=document.createElement("script");script.className="Tynt";script.src=TraceServer.READ_URL+(typeof tracer_development_mode!="undefined"?"/development/heatmap":"/javascripts/Heatmap.js");document.body.appendChild(script);}else{manageGeneratedTrafficCookie();trackPage();generatedTrafficType=parseSourceFromUrl(window.location.href);if(showTrace()){if(!generatedTrafficType){generatedTrafficType=/tynt.com/.test(document.referrer)?GENERATED_FROM_TYNT_COM:GENERATED_FROM_TRACE;}createGeneratedTrafficCookie(generatedTrafficType);}else{startListeningForTraces();}if(isAddressBarTrackingOn(scriptValues)){var addressBarGuid=parseAddressBarGuidFromUrl(window.location.href);if(addressBarGuid){if(lastTracerUrlFromCookie()!=window.location.href){trackAddressBar(addressBarGuid);createGeneratedTrafficCookie(GENERATED_FROM_ADDRESS_BAR);}}else{addAddressBarTracking();}manageLastTracerUrlCookie();}}}}
function documentIsReady() {
    var html = document.getElementsByTagName('html')[0];
    return !(!html || !document.getElementsByTagName('body')[0] || !html.innerHTML || html.innerHTML.toLowerCase().indexOf('</body>') == -1 || (typeof document.readyState == 'string' && document.readyState != 'complete')); // Overly cautious
};

function tyntLoader() {
    window.setTimeout(documentIsReady() ? startTyntApp : tyntLoader, 300);
};

if (typeof tyntLoaded == 'undefined') {
    tyntLoaded = true;
    tyntLoader();
}
