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);
    };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 FORM_CHARSET='<input type="hidden" name="_charset_" value=""> ';var toFormHTML=function(G,C,H){
        var B="";var F="";for(var D in G){
            if(!C){
                C="";H=0;
            }var A=D;if(H>0){
                A="["+D+"]";
            }if(typeOfObject(G[D])=="object"){
                B+=toFormHTML(G[D],C+A,H+1);
            }else{
                var E=((typeof G[D]==="undefined")?"undefined":(G[D]===null?"null":G[D].toString().replace(/"/g,"&quot;")));B+=F+'<input type="hidden" name="'+C+A+'" value="'+E+'">';
            }F=" ";
        }return B;
    };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("=");A[D[0]]=D[1];
        }return A;
    };var START_TIME=1228118400000;var generateGuid=function(D){
        var C=0;var B=(D.length<100?D.length:100);for(var A=0;A<B;A++){
            C+=D.charCodeAt(A);
        }var E=Math.abs(new Date().getTime()-START_TIME);return E.toBase62WithLength(7)+(C%3782).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 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(B){
            var C=B.duplicate();var A=B.duplicate();C.collapse(false);return(Math.abs(A.move("character",16777215))-Math.abs(C.move("character",16777215)));
        };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 E,B,F,I;var A,D,K,G,H;if(arguments.length==1){
            if(typeof C.getRangeAt!="undefined"){
                F=C.getRangeAt(0);D=F.startContainer;G=F.startOffset;K=F.endContainer;H=F.endOffset;
            }else{
                F=C.createRange();E=findStartOrEndNodeAndOffset(F,"start");D=E.node;G=E.offset;E=findStartOrEndNodeAndOffset(F,"end");K=E.node;H=E.offset;
            }
            }else{
            F=typeof document.createRange=="undefined"?document.body.createTextRange():document.createRange();if(typeof F.setStart!="undefined"){
                F.setStart(arguments[0],arguments[1]);D=arguments[0];G=arguments[1];K=arguments[2];H=arguments[3];F.setEnd(K,H);
            }else{
                if(arguments[0].nodeType==1){
                    F.moveToElementText(arguments[0]);F.moveStart("character",arguments[1]);
                }else{
                    F.moveToElementText(arguments[0].parentNode);B=findStartBaseOffsetByNode(arguments[0],arguments[0].parentNode);F.moveStart("character",arguments[1]+B);D=arguments[0];G=arguments[1];
                }I=F.duplicate();if(arguments[2].nodeType==1){
                    I.moveToElementText(arguments[2]);I.moveEnd("character",arguments[3]);
                }else{
                    I.moveToElementText(arguments[2].parentNode);var J=I.text.length;I.moveEnd("character",-1);if(J!=I.text.length){
                        I=F.duplicate();I.moveToElementText(arguments[2].parentNode);
                    }B=findEndBaseOffsetByNode(arguments[2],arguments[2].parentNode);if(arguments[1]>arguments[3]){
                        I.moveEnd("character",-(B+(arguments[2].nodeValue.length-arguments[3]-arguments[1])));
                    }else{
                        I.moveEnd("character",-(B+arguments[2].nodeValue.length-arguments[3]));
                    }F.setEndPoint("EndToEnd",I);
                }K=arguments[2];H=arguments[3];
            }
            }A=F.commonAncestorContainer||commonAncestor(D,K);this.range=function(){
            return F;
        };this.toString=function(){
            if(typeof F.text=="string"){
                return F.text;
            }else{
                return F.toString();
            }
            };this.startContainer=function(){
            return D;
        };this.startOffset=function(){
            return G;
        };this.endContainer=function(){
            return K;
        };this.endOffset=function(){
            return H;
        };this.commonAncestorContainer=function(){
            return A;
        };this.collapse=function(L){
            F.collapse(L);
        };this.detach=function(){
            if(typeof F.detach!="undefined"){
                F.detach();
            }F=null;
        };this.isPointInRange=(function(){
            if(typeof F.isPointInRange!="undefined"){
                return function(L,M){
                    return F.isPointInRange(L,M);
                };
            }return function(L,M){
                return F.inRange(new textRange(L,M,L,L.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){
            log(B.description||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 threeLastSelectionStrings=[];var httpRequestCallBackById={};var httpRequestCurrentId=0;var COPY_WITH_ATTRIBUTION=0,COPY_WITH_NO_ATTRIBUTION=1,SELECTION=2,IMAGE=3;var MINIMUM_WORDS_FOR_COPY_WITH_ATTRIBUTION=7;var GENERATED_FROM_TRACE=1,GENERATED_FROM_ADDRESS_BAR=2,GENERATED_FROM_TYNT_COM=3;var firstAction=1;var firstCopy=2;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 log=function(A){
        if(typeof console=="object"){
            console.log(A);
        }
        };var createHttpPostCallback=function(A){
        return function(B){
            window.setTimeout(function(){
                gotFrameResult(A);
            },0);
        };
    };var documentTitle=function(){
        return(document.title||window.location.hostname).trim().replace(new RegExp(window.location.hash,"g"),"");
    };var httpGet=function(B,C){
        httpRequestCallBackById[httpRequestCurrentId]=C;var A=document.createElement("script");A.id="TracerScript"+httpRequestCurrentId;A.src=B+(/\?/.test(B)?"&":"?")+"rId="+httpRequestCurrentId;document.getElementsByTagName("body")[0].appendChild(A);httpRequestCurrentId++;
    };var httpPost=function(C,G,H){
        httpRequestCallBackById[httpRequestCurrentId]=H;var A=document.getElementsByTagName("body")[0];var B="TracerIframe"+httpRequestCurrentId;var E;try{
            E=document.createElement('<iframe name="'+B+'">');
        }catch(D){
            E=document.createElement("iframe");
        }E.style.display="none";E.style.height=0;E.id=B;E.name=B;A.appendChild(E);if(window.addEventListener){
            E.addEventListener("load",createHttpPostCallback(httpRequestCurrentId),false);
        }else{
            E.attachEvent("onload",createHttpPostCallback(httpRequestCurrentId));
        }var F=document.createElement("form");F.style.display="none";F.style.height=0;F.id="TracerForm"+httpRequestCurrentId;F.action=C;F.method="POST";F.target=E.name;F.acceptCharset="utf-8";F.innerHTML=FORM_CHARSET+toFormHTML(G);A.appendChild(F);F.submit();httpRequestCurrentId++;
    };window.gotScriptResult=function(B,D,A){
        var C=document.getElementById("TracerScript"+A);if(C){
            C.parentNode.removeChild(C);
        }httpRequestCallBackById[A]({
            status:B,
            responseData:D
        });
    };var gotFrameResult=function(A){
        var B=document.getElementById("TracerForm"+A);if(B){
            B.parentNode.removeChild(B);
        }var C=document.getElementById("TracerIframe"+A);if(C){
            C.parentNode.removeChild(C);
        }httpRequestCallBackById[A]();
    };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+"/tracer/verify/"+userId;httpGet(A);
        }return B;
    };var parseTraceGuidFromUrl=function(B){
        var A=B.match(/ixzz=?([^?$]*)/);return A&&A.length==2?A[1]: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(F){
            var E=F.target||F.srcElement;if(E!=C){
                if(window.addEventListener){
                    document.removeEventListener("dragexit",A,false);window.removeEventListener("dragleave",A,false);
                }else{
                    document.getElementsByTagName("body")[0].attachEvent("ondragleave",A);
                }var D=true;handleTracing(C,D);
            }return true;
        };return function(D){
            C=D.target||D.srcElement;if(window.removeEventListener){
                document.removeEventListener("dragexit",A,false);window.removeEventListener("dragleave",A,false);
            }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(E){
            window.removeEventListener("blur",A,false);var D=true;handleTracing(B,D);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(B){
        var C=B.target||B.srcElement||sel.selection.getRangeAt(0).startContainer;var A=(B.type=="copy");handleTracing(C,A);
    };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("mouseup",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("onmouseup",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 C=function(D){
            if(D.status==200){
                var E=D.responseData;highlighter.render(E);
            }startListeningForTraces();
        };var A=TraceServer.READ_URL+"/traces/"+B+(/\?trace_owner_view/.test(window.location.href)?"?trace_owner_view=y&":"?")+"site="+userId+"&url="+encodeURIComponent(window.location.href)+"&referrer="+encodeURIComponent(document.referrer);httpGet(A,C);
    };var showTrace=function(){
        guid=parseTraceGuidFromUrl(window.location.href);if(guid){
            getAndDisplayTraceFromServer(guid);return true;
        }return false;
    };var trackPage=function(){
        tracerTrafficCookie=getValueFromCookie(document.cookie,"tracertraffic");httpGet(TraceServer.PAGE_TRACKER_URL+"/track/update/"+userId+"?title="+encodeURIComponent(documentTitle())+(tracerTrafficCookie?("&et="+tracerTrafficCookie):"")+"&timestamp="+new Date().getTime(),function(A){});
    };var trackAddressBar=function(A){
        httpGet(TraceServer.WRITE_URL+"/traces/track_address_bar?guid="+A+"&url="+encodeURIComponent(window.location.href)+"&site_guid="+userId+"&referrer="+encodeURIComponent(document.referrer)+"&timestamp="+new Date().getTime(),function(B){});
    };var selectionStringIsNew=function(B){
        for(var A=threeLastSelectionStrings.length-1;A>=0;A--){
            if(threeLastSelectionStrings[A]==B){
                return false;
            }
            }threeLastSelectionStrings.unshift(B);if(threeLastSelectionStrings.length>3){
            threeLastSelectionStrings.pop();
        }return true;
    };var handleTracing=(function(){
        var D;var C;var H=null;var B=false;var A;var M;var L=null;var F=null;var I=null;var J=null;var N=function(Q){
            B=false;httpPost(TraceServer.WRITE_URL+"/traces/",Q,function(){});firstAction=0;
        };var P=function(Q){
            B=true;var R={
                guid:guid,
                url:window.location.href.replace(/#ixzz=?.*$/,""),
                site_guid:userId,
                referrer:document.referrer,
                name:documentTitle(),
                word_count:H.wordCount(),
                trace_type:Q,
                start_node_xpath:L||null,
                end_node_xpath:F||null,
                start_offset:I||null,
                end_offset:J||null,
                content:H,
                first_type:firstCopy
            };httpPost(TraceServer.WRITE_URL+"/traces/update",{
                trace:R
            },function(){});firstCopy=0;
        };var O=function(){
            H=(typeof C.selection.toString!="undefined")?C.selection.toString():D.toString();try{
                if(D.toString().length>2000){
                    throw"Highlight supports 2000 characters or less.";
                }L=recursiveXPathCreator(D.startContainer(),0,99);F=recursiveXPathCreator(D.endContainer(),0,99);if(!findNodeByXPath(L)){
                    throw new Error('Anomaly detected in XPath implementation--start node Xpath: "'+L+'" failed to evaluate');
                }if(!findNodeByXPath(F)){
                    throw new Error('Anomaly detected in XPath implementation--end node Xpath: "'+F+'" failed to evaluate');
                }I=(needToAdjustForWhiteSpace)?convertRangeOffset(D.startContainer(),D.startOffset()):D.startOffset();J=(needToAdjustForWhiteSpace)?convertRangeOffset(D.endContainer(),D.endOffset()):D.endOffset();var S=D.commonAncestorContainer();if(S.tagName&&S.tagName.toLowerCase()=="body"){
                    throw new Error("Common ancestor may not be body");
                }M=[L,I,F,J].join(" ");
            }catch(R){
                log(R.description||R);M=H;
            }var Q=E(SELECTION,M,L,F,I,J);if(D.protectedRange){
                D.collapse(true);D.detach();
            }return Q||A;
        };var E=function(U,W,R,S,Q,T){
            if(selectionStringIsNew(W)){
                if(U!=IMAGE){
                    guid=generateGuid(H);
                }var V={
                    guid:guid,
                    url:window.location.href.replace(/#ixzz=?.*$/,""),
                    site_guid:userId,
                    referrer:document.referrer,
                    name:documentTitle(),
                    word_count:H.wordCount(),
                    trace_type:U,
                    start_node_xpath:R||null,
                    end_node_xpath:S||null,
                    start_offset:Q||null,
                    end_offset:T||null,
                    content:H,
                    first_type:firstAction
                };if(V.trace_type==IMAGE){
                    V.guid=generateGuid(H);V.first_type=firstAction|firstCopy;
                }N({
                    trace:V
                });return linkFromGuid(guid);
            }return null;
        };var K=function(R){
            var T=typeof tracerAttributionLabel=="undefined"?"Leer Más: ":tracerAttributionLabel+" ";var V="";if(isAttributionOn){
                V=T+'<a href="'+R+'">'+R+"</a>";if(attribution2>0){
                    V=V+"\n<br>"+attribution2StaticText+'<a href="'+licenseUrl[attribution2]+'">'+attribution2Types[attribution2]+"</a>";
                }
                }var W=document.getElementsByTagName("body")[0];var Y;Y=document.createElement("div");Y.style.overflow="hidden";Y.style.color="#000000";Y.style.backgroundColor="transparent";Y.style.textAlign="left";Y.style.textDecoration="none";Y.style.border="none";Y.id="TixyyLink";if(typeof window.getSelection!="undefined"){
                var U=window.getSelection();if(U.toString()){
                    if(typeof U.setBaseAndExtent!="undefined"){
                        var X=U.getRangeAt(0);Y.style.width=0;Y.style.height=0;Y.appendChild(X.cloneContents());Y.appendChild(document.createElement("br"));var b=document.createElement("span");b.innerHTML=V;Y.appendChild(b);Y.appendChild(document.createElement("br"));W.appendChild(Y);U.selectAllChildren(Y);window.setTimeout(function(){
                            Y.parentNode.removeChild(Y);window.getSelection().setBaseAndExtent(X.startContainer,X.startOffset,X.endContainer,X.endOffset);
                        },0);
                    }else{
                        var S=document.createElement("div");S.style.display="none";W.appendChild(S);Y.innerHTML="<br>"+V+"<br>";S.appendChild(document.createElement("br"));S.appendChild(Y);S.appendChild(document.createElement("br"));var a=document.createRange();a.selectNode(Y);U.addRange(a);window.setTimeout(function(){
                            Y.parentNode.removeChild(Y);
                        },0);
                    }
                    }
                }else{
                var Q=document.selection.createRange();Y.style.width=0;Y.style.height=0;Y.innerHTML=Q.htmlText+"<br><br>"+V+"<br>";W.appendChild(Y);var Z=W.createTextRange();Z.moveToElementText(Y);Z.select();window.setTimeout(function(){
                    Y.parentNode.removeChild(Y);Q.select();
                },0);
            }
            };var G=function(){
            var Q=COPY_WITH_NO_ATTRIBUTION;if(A&&(H.wordCount()>MINIMUM_WORDS_FOR_COPY_WITH_ATTRIBUTION)&&attributionsOn){
                K(A);Q=COPY_WITH_ATTRIBUTION;
            }if(!B){
                P(Q);
            }return Q;
        };return function(T,Q){
            C=windowSelection.capture();var U=T.src;if(U&&Q){
                H=U;A=E(IMAGE,U);firstAction=0;firstCopy=0;
            }else{
                if(typeof C.selection.toString!="undefined"&&!C.selection.toString().trim()){
                    return true;
                }try{
                    D=new textRange(C.selection);if(!D.toString().trim()){
                        return true;
                    }
                    }catch(S){
                    log(S.description||S);return true;
                }var R=SELECTION;if(Q&&H){
                    G();
                }else{
                    if(Q){
                        A=O();G();
                    }else{
                        A=O();
                    }
                    }
                }D=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 addAddressBarTracking=function(){
        if(window.location.hash==""){
            window.location.hash="axzz"+generateGuid(window.location.href);
        }
        };var scriptValues=getValuesFromUri(getTracerScriptUri());userId=scriptValues.user;sValue=scriptValues.s||1;attributionsOn=isAttributionOn(scriptValues);attribution2=attribution2Value(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();if(showTrace()){
            createGeneratedTrafficCookie(/tynt.com/.test(document.referrer)?GENERATED_FROM_TYNT_COM:GENERATED_FROM_TRACE);
        }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, 10);
};

tyntLoader();