(function(D){var C=function(){return new C.prototype.init()
};
C.prototype={init:function(){return this
},processInit:function(){this.source=[];
this.jqFiltered=[];
var B=this.opt;
this.jq=this.jq.not("script, "+B.not);
if(B.walk===true){this.jq=this.jq.add(this.jq.find("*").not("script, "+B.not));
if(B.not.length){var A=D(B.not).get(0);
var F=false;
A?A=A.firstChild:A=null;
while(A){if(A.nodeType==1){F=true;
break
}A=A.nextSibling
}if(F){this.jq=this.jq.not(D(B.not).find("*"))
}}}this.split={};
this.split.jqFiltered=[];
this.split.source=[];
this.split.translation=[];
this.split.numberOfRequests=0;
this.nct={};
this.nct.jqFiltered=[];
this.nct.source=[];
this.jqLength=this.jq.length;
this.n=-1;
return this.process()
},process:function(){this.n++;
var B=this.opt;
if(this.n==this.jqLength){if(B.translate!==false&&(!B.split||this.nn===true)){return this.translateInit()
}if(B.split){this.jqFiltered=this.split.jqFiltered;
this.numberOfRequests=this.split.numberOfRequests;
this.translation=this.split.translation;
this.source=this.split.source;
if(this.from.length<2&&this.detectedSourceLanguage){var O=this.detectedSourceLanguage
}else{var O=this.from
}this.opt.complete.call(this,this.jqOriginal,D(this.jqFiltered),this.translation,this.source,O,this.to,this.opt,this.numberOfRequests)
}if(typeof B.nct!="undefined"){this.opt.complete.call(this,D(this.nct.jqFiltered),this.nct.source)
}if(B.walk===false){return this.jqOriginal
}if(B.returnAll===true){return D(this.jqFiltered)
}else{return this.jqOriginal
}}var N="";
var S=false;
var T=false;
var A=this.jq[this.n];
if(!A){return this.process()
}var Q=D(A);
if(typeof B.subject=="string"){N=Q.attr(B.subject)||""
}else{if(B.altAndVal&&(A.tagName.toLowerCase()=="img"||A.tagName.toLowerCase()=="input")){if(A.tagName.toLowerCase()=="img"){N=Q.attr("alt")||""
}else{var P=Q.attr("type")||"";
P=P.toLowerCase();
if(P=="text"||P=="button"||P=="submit"){N=Q.val()||""
}}}else{if(A.tagName.toLowerCase()=="textarea"){N=Q.val()
}else{var M=A.firstChild;
B.walk===true?"":T=true;
while(M){if(M.nodeType==1){T=true;
break
}M=M.nextSibling
}if(!T){N=Q.text()
}else{B.walk===true?"":S=true;
M=A.firstChild;
while(M){if(M.nodeType==3&&M.nodeValue.match(/\S/)!==null){if(M.nodeValue.match(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/)!==null){if(M.nodeValue.match(/(\S+(?=.*<))|(>(?=.*\S+))/)!==null){S=true;
break
}}else{S=true;
break
}}M=M.nextSibling
}if(S){N=Q.html();
this.jq=this.jq.not(Q.find("*"))
}else{N=""
}}}}}if(!N){return this.process()
}this.jqFiltered.push(A);
if(B.comments===false){N=this.strip(N)
}this.source.push(N);
this.nn=true;
if(!B.split||!(this.n%B.split==0)){if(B.async){var R=this;
setTimeout(function(){R.process()
},B.async);
if(typeof B.nct!="undefined"){console.log("each");
this.nct.jqFiltered.push(A);
this.nct.source.push(N);
B.each.call(this,this.jqFiltered.length-1,A,N)
}}else{return this.process()
}}else{this.nn=false;
if(B.translate!==false){return this.translateInit()
}}},translateInit:function(){if(typeof this.source=="string"){this.fullText="<div>"+this.source+"</div>";
this.isString=true
}else{this.fullText="<div>"+this.source.join("</div><div>")+"</div>";
this.isString=false
}this.rawTranslation="";
this.correctedText="";
this.start=0;
this.divs=0;
this.translation=[];
this.numberOfRequests=0;
return this.translate()
},translate:function(){if(this.stopped===true){return 
}var a=this;
this.end=this.start*1+this.opt.limit;
this.splitText=this.fullText.substring(this.start,this.end);
var Q=/<(?![^<]*>)/.exec(this.splitText);
if(!Q){var R=/>\s*$j/.exec(this.splitText);
if(!R){var S=/[\.\?\!;:](?![^\.\?\!;:]*[\.\?\!;:])/.exec(this.splitText);
if(S){var V=/>(?![^>]*<)/.exec(this.splitText);
if(V){if(S.index>V.index){this.correctedText=this.splitText.substring(0,(S.index+1))
}else{this.correctedText=this.splitText.substring(0,(V.index+1))
}}else{this.correctedText=this.splitText.substring(0,(S.index+1))
}}else{this.correctedText=this.splitText
}}else{this.correctedText=this.splitText
}}else{this.correctedText=this.splitText.substring(0,(Q.index))
}this.start=this.start+this.correctedText.length;
var b=this.rawTranslation.length;
while(this.rawTranslation.lastIndexOf("</div>",b)>-1){b=this.rawTranslation.lastIndexOf("</div>",b)-1;
var Y=this.rawTranslation.substr(0,b);
if(Y.match(/<div(>|( style=";))/gi)){var T=Y.match(/<div(>|( style=";))/gi).length
}if(Y.match(/<\/div>/gi)){var Z=Y.match(/<\/div>/gi).length
}if(typeof T=="undefined"){T=0
}if(typeof Z=="undefined"){Z=0
}if(T==Z+1){var W=D(this.rawTranslation.substr(0,(b+7)));
var B=W.length;
if(this.divs!=B){var X=W.slice(this.divs,B);
X.each(function(F,E){(function(){if(this.stopped!==true){var H=this.divs+F;
var I=D.trim(D(E).html());
this.translation[H]=I;
if(this.from.length<2&&this.detectedSourceLanguage){var G=this.detectedSourceLanguage
}else{var G=this.from
}if(this.calledFromFunction){this.isString?this.source=[this.source]:"";
this.opt.each.call(this,H,I,this.source[H],G,this.to,this.opt,this.numberOfRequests)
}else{this.translateMethodEach(H,this.jqFiltered[H],I,this.source[H],G,this.to,this.opt,this.numberOfRequests);
this.opt.each.call(this,H,this.jqFiltered[H],I,this.source[H],G,this.to,this.opt,this.numberOfRequests);
this.split.jqFiltered.push(this.jqFiltered[H]);
this.split.source.push(this.source[H]);
this.split.translation.push(I)
}}}).call(a)
});
this.divs=B
}break
}}if(this.correctedText.length>0){google.language.translate(this.correctedText,this.from,this.to,function(E){(function(){if(E.error){return this.opt.error.call(this,E.error,this.correctedText,this.from,this.to,this.opt,this.numberOfRequests)
}this.rawTranslation=this.rawTranslation+E.translation;
this.detectedSourceLanguage=E.detectedSourceLanguage;
var F=/[\.\?\!;:]$j/.exec(this.rawTranslation);
if(F){this.rawTranslation=this.rawTranslation+" "
}this.translate()
}).call(a)
});
this.numberOfRequests+=1;
this.split.numberOfRequests+=1
}else{if(this.opt.split&&(this.n<this.jq.length)){var A=this.n;
this.jq=D(D.grep(this.jq,function(E,F){return(F>A)
}));
this.jqFiltered=[];
this.source=[];
this.n=-1;
return this.process()
}if(!this.rawTranslation){return 
}this.rawTranslation=this.rawTranslation.replace(/\s*$j/,"");
if(this.from.length<2&&this.detectedSourceLanguage){var U=this.detectedSourceLanguage
}else{var U=this.from
}this.timeout?clearTimeout(this.timeout):"";
if(this.calledFromFunction){if(this.isString){this.translation=this.translation[0];
this.source=this.source[0]
}this.opt.complete.call(this,this.translation,this.source,U,this.to,this.opt,this.numberOfRequests)
}else{this.opt.complete.call(this,this.jqOriginal,D(this.jqFiltered),this.translation,this.source,U,this.to,this.opt,this.numberOfRequests)
}}},translateMethod:function(A,O,P,B){var K=this;
this.calledFromFunction=false;
this.stopped=false;
this.jq=A;
this.jqOriginal=A;
var N={};
if(typeof O!="string"){return this.warn("Destination language is not set")
}if(!P&&!B){this.from="";
this.to=O
}if(!B&&P){if(typeof P=="object"){this.from="";
this.to=O;
N=P
}else{this.from=O;
this.to=P
}}if(typeof O=="string"&&P&&B){this.from=O;
this.to=P;
N=B
}var L=this.from;
var M=this.to;
this.opt=N=D.extend({walk:true,returnAll:false,replace:true,translate:true,limit:500,rebind:true,data:false,setLangAttr:false,subject:true,not:"",comments:false,altAndVal:true,split:false,async:false,start:function(){},error:function(){},each:function(){},complete:function(){},onTimeout:function(){},timeout:0},D.fn.translate.defaults,N);
if(N.rebind===true&&N.replace===true&&!D.isFunction(D.event.copy)){this.warn("You have to include the copyEvents plugin to enable rebinding events on all elements: http://plugins.jquery.com/project/copyEvents");
this.opt.rebind=N.rebind=false
}if(N.timeout>0){this.timeout=setTimeout(function(){N.onTimeout.call(K,A,L,M,N)
},N.timeout)
}N.async===true?N.async=2:"";
N.start.call(this,this.jqOriginal,L,M,N);
if(N.async||N.split){this.processInit();
return this.jqOriginal
}else{return this.processInit()
}},translateMethodEach:function(Y,d,b,T,S,R,A,Z){var W=this;
var V=D(d);
if(A.data===true){if(typeof A.subject=="string"){D.data(d,"translation."+S+"."+A.subject,T);
D.data(d,"translation."+R+"."+A.subject,b)
}else{if(A.altAndVal&&(d.tagName.toLowerCase()=="img"||d.tagName.toLowerCase()=="input")){if(d.tagName.toLowerCase()=="img"){D.data(d,"translation."+S+".alt",T);
D.data(d,"translation."+R+".alt",b)
}else{var U=V.attr("type")||"";
U=U.toLowerCase();
if(U=="text"||U=="button"||U=="submit"){D.data(d,"translation."+S+".value",T);
D.data(d,"translation."+R+".value",b)
}}}else{if(d.tagName.toLowerCase()=="textarea"){D.data(d,"translation."+S+".value",T);
D.data(d,"translation."+R+".value",b)
}else{D.data(d,"translation."+S+".html",T);
D.data(d,"translation."+R+".html",b)
}}}}A.setLangAttr===true?V.attr("lang",R):"";
typeof A.setLangAttr=="string"?V.attr(A.setLangAttr,R):"";
if(A.replace===true){if(typeof A.subject=="string"){V.attr(A.subject,b)
}else{S=="ar"?V.css("direction","ltr"):"";
R=="ar"?V.css("direction","rtl"):"";
if(V.css("text-align")==("right"||"left")){S=="ar"?V.css("text-align","right"):"";
R=="ar"?V.css("text-align","right"):""
}if(A.altAndVal&&(d.tagName.toLowerCase()=="img"||d.tagName.toLowerCase()=="input")){if(d.tagName.toLowerCase()=="img"){V.attr("alt",b)
}else{var U=V.attr("type")||"";
U=U.toLowerCase();
if(U=="text"||U=="button"||U=="submit"){V.val(b)
}}}else{if(d.tagName.toLowerCase()=="textarea"){V.val(b)
}else{if(A.rebind===true){var a=V.find("*").not("script").clone(true);
var B=a.length;
V.html(b);
var X=V.find("*").not("script");
for(var c=0;
c<B;
c++){X.eq(c).copyEvents(a.get(c))
}}else{V.html(b)
}}}}}},translateFunction:function(L,O,P,Q){var R=this;
this.calledFromFunction=true;
this.stopped=false;
var B={};
if(typeof O!="string"){return this.warn("Destination language is not set")
}if(!P&&!Q){this.from="";
this.to=O
}if(!Q&&P){if(typeof P=="object"){this.from="";
this.to=O;
B=P
}else{this.from=O;
this.to=P
}}if(typeof O=="string"&&P&&Q){this.from=O;
this.to=P;
B=Q
}var N=this.from;
var M=this.to;
this.opt=B=D.extend({limit:500,comments:false,start:function(){},error:function(){},each:function(){},complete:function(){},onTimeout:function(){},timeout:0},D.translate.defaults,B);
if(B.timeout>0){this.timeout=setTimeout(function(){B.onTimeout.call(R,L,N,M,B)
},B.timeout)
}B.start.call(this,L,N,M,B);
if(typeof L=="string"){if(this.opt.comments===false){L=this.strip(L)
}}else{if(this.opt.comments===false){for(var A=0;
A<L.length;
A++){L[A]=this.strip(L[A])
}}}this.source=L;
this.translateInit()
},detectInit:function(){this.k=0;
this.arr_langCode=[];
this.arr_lang=[];
this.arr_result=[];
this.stopped=false;
this.detect()
},detect:function(){if(this.stopped===true){return 
}var A=this;
google.language.detect(this.t[this.k].substring(0,this.opt.limit*1),function(B){(function(){if(!B.error){language=this.getLanguage(B.language);
this.arr_langCode.push(B.language);
this.arr_lang.push(language);
this.arr_result.push(B);
if(this.calledFromFunction===false){var F=this.jqFiltered[this.k];
this.opt.setLangAttr===true?D(F).attr("lang",B.language):"";
typeof this.opt.setLangAttr=="string"?D(F).attr(this.opt.setLangAttr,B.language):"";
this.opt.each.call(this,this.k,F,this.t[this.k],B.language,language,B,this.opt)
}else{this.opt.each.call(this,this.k,this.t[this.k],B.language,language,B,this.opt)
}if(this.k==this.len-1){if(this.isString===true){return this.opt.complete.call(this,this.t[0],this.arr_langCode[0],this.arr_lang[0],this.arr_result[0],this.opt)
}else{if(this.calledFromFunction===true){return this.opt.complete.call(this,this.t,this.arr_langCode,this.arr_lang,this.arr_result,this.opt)
}else{return this.opt.complete.call(this,this.jqFiltered,this.t,this.arr_langCode,this.arr_lang,this.arr_result,this.opt)
}}}else{this.k++;
return this.detect()
}}else{if(this.calledFromFunction===false){return this.opt.error.call(this,B.error,this.jqFiltered[this.k],this.t[this.k],this.k,this.opt)
}else{return this.opt.error.call(this,B.error,this.t[this.k],this.k,this.opt)
}}}).call(A)
})
},detectMethod:function(A,F){var B=this;
this.jq=this.jqOriginal=A;
this.calledFromFunction=false;
this.isString=false;
this.t=[];
this.arr_e=[];
F=D.extend({start:function(){},each:function(){},complete:function(){},error:function(){},setLangAttr:true,subject:true,limit:500,walk:false,returnAll:false,not:"",altAndVal:false},D.fn.language.defaults,F,{async:false,split:false});
if(F.walk===true&&F.returnAll===false){F.returnAllInt=false
}this.opt=F=D.extend(F,{translate:false,returnAll:true});
F.start.call(this,A,F);
this.jqFiltered=this.processInit().each(function(I,E){var J;
if(F.subject===true){D(E).is(":input")?J=D(E).val():J=D(E).text()
}else{if(typeof F.subject=="string"){J=D(E).attr(F.subject)
}}B.t.push(J)
});
this.len=this.jqFiltered.length;
this.detectInit();
if(F.returnAllInt===false){return this.jqOriginal
}else{return this.jqFiltered
}},detectFunction:function(A,B){this.opt=B=D.extend({start:function(){},each:function(){},complete:function(){},error:function(){},limit:500},D.language.defaults,B);
B.start.call(this,A,B);
if(typeof A=="string"){A=[A];
this.isString=true
}this.t=A;
this.len=A.length;
this.calledFromFunction=true;
this.detectInit()
},strip:function(A){return A.replace(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/g,"")
},warn:function(A){if(typeof console!="undefined"){console.warn(A)
}},stop:function(){this.stopped=true;
return this
},getLanguage:function(A,F){var B="unknown";
for(l in google.language.Languages){if(google.language.Languages[l]==A){lang=l;
break
}}typeof F=="undefined"?F="uppercase":"";
switch(F){case"lowercase":lang=lang.toLowerCase();
break;
case"uppercase":lang=lang;
break;
case"capitalize":lang=lang[0].toUpperCase()+lang.substring(1).toLowerCase();
break
}return lang
}};
C.prototype.init.prototype=C.prototype;
D.fn.translate=function(B,F,A){return C().translateMethod(this,B,F,A)
};
D.fn.translate.defaults={};
D.translate=function(B,G,H,A){return C().translateFunction(B,G,H,A)
};
D.translate.defaults={};
D.fn.language=function(A){return C().detectMethod(this,A)
};
D.fn.language.defaults={};
D.language=function(A,B){return C().detectFunction(A,B)
};
D.language.defaults={};
D.fn.nodesContainingText=function(A){var A=D.extend({not:"",async:false,altAndVal:false,each:function(){},complete:function(){}},D.fn.nodesContainingText.defaults,A,{nct:true,subject:true,not:"",walk:true,returnAll:true,translate:false});
return this.translate("en",A)
};
D.fn.nodesContainingText.defaults={};
D.translate.langLoaded=function(){function V(){D.cookie("langCookie",null,{path:"/"});
D.cookie("langFlag",null,{path:"/"})
}function U(E){if(E){switch(E){
case"chinese":langTo="zh";
break;
case"french":langTo="fr";
break;
case"german":langTo="de";
break;
case"italian":langTo="it";
break;
case"korean":langTo="ko";
break;
case"romanian":langTo="ro";
break;
case"espanol":langTo="es";
break;
default:break
}D("body").translate(langFrom,langTo,{start:A,error:Y,complete:T});
return true
}else{if(D.cookie("langCookie")){var F=D.cookie("langCookie");
switch(F){
case"chinese":langTo="zh";
break;
case"french":langTo="fr";
break;
case"german":langTo="de";
break;
case"italian":langTo="it";
break;
case"korean":langTo="ko";
break;
case"romanian":langTo="ro";
break;
case"espanol":langTo="es";
break;
default:break
}D("body").translate(langFrom,langTo,{start:A,error:Y,complete:T});
return true
}}}function Y(){D.unblockUI();
alert("There was an error with the translation.  Please try again by refreshing you web browser.")
}function A(){var E,F;
transObject=this;
P();
if(D("div.theBeltway").length){D("div.theBeltway").each(function(){D(this).translate(langFrom,langTo)
})
}D("li#lang").removeClass("sfhover").addClass("trigger");
(!delimLoc)?E='<h3>The page is being translated.</h3><h3>Please wait.</h3><br /><img src="/v3/img/translationLoader.gif" align="center" /><br /><h3>Click Page Anywhere To Cancel.</h3><br />':E='<h3>La página está siendo traducida.</h3><h3>Por favor espere.</h3><br /><img src="/v3/img/translationLoader.gif" align="center" /><br /><h3>Haga clic en cualquier lugar de la página para cancelar.</h3><br />';
(!delimLoc)?F="16em":F="20em";
D.blockUI({message:E,css:{width:"21em",height:F,top:posY+"px",left:posX+"px"}});
D("div.blockUI").click(function(){transObject.stop();
D.unblockUI();
V();
window.location.reload()
})
}function T(){langFrom=langTo;
D.unblockUI();
D.cookie("langFlag","true",{path:"/"});
if(!(D.cookie("langFlag"))){alert("The language cookie has NOT been set.  In order to maintain your language preference, please modify your browser's cookie settings and try again.")
}B();
D("li#lang").removeClass("sfhover").addClass("trigger")
}function S(){(D.trim(D("h1").text())=="Portal Oficial de Texas")?langFrom="es":false
}function Q(E){if(E=="french"){D("#container").css("width","115em");
D("#slideshow").css({marginTop:"0.2em",marginLeft:"auto",marginRight:"auto"})
}}function P(){(D.cookie("langCookie")=="french"&&D("#qaNav").length)?Q("french"):false
}function B(){(D.cookie("langFlag")=="true")?Z():false;
P()
}function Z(){(D("li#lang > ul > li:first").attr("id")=="spanish")?W():R()
}function W(){if(D("li#lang > ul > li").eq(1).attr("id")=="english"){return false
}else{var E=location.pathname;
E=E.replace(/es/,"en");
D("li#lang > ul > li:first").after('<li id="english" class="col1"><a href="'+E+'" class="added">English</a></li>');
D("li#english > a").click(function(){V();
return true
});
return 
}}function R(){if(D("li#lang > ul > li").eq(1).attr("id")=="spanish"){return false
}else{var E=location.pathname;
E=E.replace(/en/,"es");
D("li#lang > ul > li:first").after('<li id="spanish" class="col1"><a href="'+E+'" class="added">Spanish</a></li>');
D("li#spanish > a").click(function(){V();
return true
});
return 
}}var X=false;
D.browser.msie?X=true:X=false;
if(X){U();
B()
}};
D.translate.loadLang=function(){google.load("language","1",{callback:D.translate.langLoaded})
};
D.translate.initLoader=function(A){if(typeof google!="undefined"&&typeof google.load!="undefined"){return D.translate.loadLang()
}A?A="key="+A:A="";
var B=document.createElement("script");
B.src="http://www.google.com/jsapi?"+A;
B.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(B);
B.onload=D.translate.loadLang
};
D.translate.initLoader()
})(jQuery);