Guest User

Untitled

a guest
Jun 6th, 2014
55
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(!this.Microsoft)Microsoft={};new function(){var v="function",p="jsonp",u="oncomplete",t="text-align",s="direction",g="\n",r="<div></div>",h="_",m="body",d=false,k="-",o="undefined",q="AddTranslation",l="from",f=" ",e=-1,a=null,c=true,b="",j="en",n=this;Microsoft.Translator=n;n.Configurations={serviceName:"LP",serviceURL:"http://api.microsofttranslator.com/v2/ajax.svc",baseURL:"http://www.microsofttranslator.com:80/",locale:j,referrer:b,appId:"TonzJUeDhPc0RKYpletGwkZIYFoVSjZRF8OUIiZZaPMc*",rttAppId:"TGdjMVF40oCiA1kzt38RNnlROCxm04nSiBqPXKcxK71Pjos9lbgbUIpVDN88SNEgR",maxNumberOfChars:5e3,translationLoggerUrl:"TranslationLogger.ashx",rttEnabled:c,phraseAlignmentEnabled:c};n.ServiceWrapper=new function(){var d=1600,i=function(o,h){var l=[],i=a;if(o.length!=0)i=Microsoft.Translator.Languages.separators[o];if(i==a)i=Microsoft.Translator.Languages.separators[j];var m=$.utils.countStringBytes(h);if(m>d){var p=Math.ceil(m/h.length),k=0;while(k<h.length){var n=h.substr(k);if($.utils.countStringBytes(n)<=d){l.push(n);break}var g=h.substr(k,d/p),b=e;for(var c=0;c<i.length;c++)b=Math.max(b,g.lastIndexOf(i[c]));if(b==e)for(var c=g.length-1;c>=0;c--)if(/[\w ]/.test(g[c])){b=c;break}if(b==e)b=g.lastIndexOf(f);if(b==e)b=g.length-1;l.push(g.substr(0,b+1));k+=b+1}}else l=[h];return l},h=0,g=function(B,C,r,E,z,u,y,H,D){var e="baseTranslateArray_error_",a="baseTranslateArray_complete_",k=[],n=[],j=h++,o=0,g=[],q=[],p,m=[];for(var s=0;s<C.length;s++){var A=i(r,C[s]);k=k.concat(A);n.push(A.length)}window[a+j]=function(d){if(m[0].isAborted()==c)return;g=g.concat(d);if(o<k.length)t();else{F();w();var b=[];for(var a=0;a<m.length;a++)b.push(m[a].LogEntry);x.log(b);if(u)u(q,p)}};window[e+j]=function(b,c,a){w();if(y)y(b,p,a)};function w(){try{delete window[a+j];delete window[e+j]}catch(b){}}function t(){var h=0,f=[],b;for(var c=o;c<k.length;c++,o++){var g=$.utils.countStringBytes(k[c]);if(h+g>d){o=c;b=D(B,f,r,E,z,window[a+j],window[e+j]);m.push(b);return b}else{h+=g;f.push(k[c])}}b=D(B,f,r,E,z,window[a+j],window[e+j]);m.push(b);return b}function F(){for(var b=0,a=0;a<k.length;b++){if(n[b]>1)q.push(G(a,a+n[b]-1));else q.push(g[a]);a+=n[b]}}function G(e,h){var c={};for(var a in g[e]){c[a]=g[e][a];for(var d=e+1;d<=h;d++)switch(a.toLowerCase()){case "alignment":c[a]=b;case l:break;case "translatedtext":c[a]+=g[d][a];break;default:if(typeof c[a]=="string")c[a]+=f+g[d][a];else if($.isArray(c[a]))c[a]=c[a].concat(g[d][a])}}return c}var v=t();p=v.requestNumber;return v};this.TranslateArray=function(e,f,h,i,c,a,b,d){return new g(e,f,h,i,c,a,b,d,Microsoft.Translator.Service.TranslateArray)};this.TranslateArray2=function(e,f,h,i,c,a,b,d){return new g(e,f,h,i,c,a,b,d,Microsoft.Translator.Service.TranslateArray2)};this.AddTranslation=function(n,h,g,o,s,m,i,k,p,r,j,d,l){var b=Microsoft.Translator.Configurations.serviceURL+"/"+q+"?",f=$.utils.getParamNames(Microsoft.Translator.Service.AddTranslation);for(var a=0;a<f.length;a++)if(arguments[a]){b+=f[a]+"=";b+=arguments[a]+"&"}var c=$.utils.countStringBytes(b);if(navigator.userAgent.indexOf("MSIE")>e&&c>2048||c>8192){if(d)d("Request exceeds the max limit of get request.Request length is:"+c);return}else Microsoft.Translator.Service.AddTranslation(n,h,g,o,s,m,i,k,p,r,j,d,l)}};n.MRULs=new function(){this.get=function(b){var a=$.cookies.read(b);a=a?a.split(","):[];return a};this.add=function(e,g,h){if(typeof h==o)h=3;var i=$.cookies.read(e),d=i==a?[]:i.split(",");if(d.length>0){var f=[];f.push(g);var j=h-1;for(var b=0;b<j&&b<d.length;b++)if(d[b]!=g)f.push(d[b]);else j++;$.cookies.write(e,f.join(","),c)}else $.cookies.write(e,g)}};n.TranslationResultParser=new function(){this.parseResultsArray=function(e,f,i){var c="paragraph",h=[],d=0,g;for(var a=0;a<e.length&&d<f.length;a++,d++){if($.trim(e[a]).length==0){if($.trim(f[d]).length>0){g=n(e[a],b,i,c+a.toString());d--}}else g=n(e[a],f[d],i,c+a.toString());h.push(g)}return h};var n=function(e,c,x,z){var q,o;if(c==a||$.trim(e).length==0){q=g(d,e,j);o=g(n,b,x)}else{var d=[],n=[];if(c.Alignment!=a&&typeof c.Alignment=="string"&&c.Alignment!=b){var w=$.trim(c.Alignment).split(f);for(var v=0;v<w.length;v++){var A=w[v],y=A.split(k),u=y[0],t=y[1],s=l(u,e.length),r=l(t,c.TranslatedText.length);if(s==a||r==a)continue;d.push({start:s.start,end:s.end,srcInfo:u,dstInfo:t});n.push({start:r.start,end:r.end,srcInfo:u,dstInfo:t})}d.sort(m);n.sort(m);h(d);h(n);p(d,e);i(d,"dstInfo",e);i(n,"srcInfo",c.TranslatedText)}q=g(d,e,c.From);o=g(n,c.TranslatedText,x)}return {inputContents:q,inputText:e,outputContents:o,outputText:c==a?b:c.TranslatedText,ParagraphName:z}},h=function(b){for(var a=0;a<b.length-1;a++)if(b[a].start==b[a+1].start||b[a+1].start<b[a].end){var c=b[a].end>b[a+1].end?b[a].end:b[a+1].end;b[a].end=c;b.splice(a+1,1);a--}},i=function(b,c,f){var e=/^\s*$/;for(var a=0;a<b.length-1;a++){var d=f.substring(b[a].end+1,b[a+1].start);if((b[a].end+2==b[a+1].start||e.test(d))&&b[a][c]==b[a+1][c]){b[a].end=b[a+1].end;b.splice(a+1,1);a--}}},p=function(d,g){g=g.replace("\r",b);if($.trim(g).length==0)return;var n=/^([ ]*)(.*)$/,m=n.exec(g),h=m[1].length,l=m[1].length;for(var a=0;a<d.length;a++){d[a].start+=h;d[a].end+=h}for(var i=0;i<d.length;i++){h=0;var j=d[i].start,k=d[i].end,c=e;for(var a=l;a<=j;a++){if(g[a]==f)c++;if(g[a]!=f||a==j){if(c>0){h+=c;j+=c}if(g[a]!=f)c=e;else c=0}}k+=h;c=e;for(var a=j;a<=k;a++){if(g[a]==f)c++;if(g[a]!=f||a==k){if(c>0){h+=c;k+=c}if(g[a]!=f)c=e;else c=0}}d[i].start=j;d[i].end=k;for(var a=i+1;a<d.length;a++){d[a].start+=h;d[a].end+=h}l=d[i].end+1}},m=function(a,b){return a.start<b.start?e:1},g=function(b,c,i){var f=[];if(b==a||b.length==0){f.push({content:c,srcInfo:a,dstInfo:a,Start:a,End:a});return f}if(b[0].start!=0)f.push({content:c.substring(0,b[0].start),srcInfo:a,dstInfo:a,Start:a,End:a});for(var d=0;d<b.length;d++)if(b[d]!=a){var e=b[d];if(e.start<c.length&&e.end<c.length){var h=c.substring(e.start,e.end+1),g=o(h,i);f.push({content:h,srcInfo:g?e.srcInfo:a,dstInfo:g?e.dstInfo:a,Start:g?e.start:a,End:g?e.end:a});if(d+1<b.length&&b[d].end+1<b[d+1].start)f.push({content:c.substring(b[d].end+1,b[d+1].start),srcInfo:a,dstInfo:a,Start:a,End:a})}}if(b[b.length-1].end!=c.length-1)f.push({content:c.substring(b[b.length-1].end+1,c.length+1),srcInfo:a,dstInfo:a,Start:a,End:a});return f},l=function(c){if(c==a||c.length<3)return a;var b,d,e=$.trim(c).split(":");b=parseInt(e[0]);d=parseInt(e[1]);if(d<b)return a;if(b<0)return a;return {start:b,end:d}},o=function(i,h){var f=$.trim(i);if(f.length>0){var g=Microsoft.Translator.Languages.separators[h.toLowerCase()],b=e;if(g!=a)b=g.indexOf(f);if(b==e)b=Microsoft.Translator.Languages.separators[j].indexOf(f);if(b==e)return c}return d}};n.HighlightingManager=new function(){var j="paragraphname",f="mouseover",e="z-index",u=this,i=a,n=a,l=a,w="inHighlight_",v="ouHighlight_",z="noHighlight_",k=a,L=".Overlay",A=c,K=d,q=d,o=c,y=$.browser.msie&&$.browser.version<9,E=function(){if(i.css(e)=="0"){i.css(e,"2");if(!y)l.css(e,"0")}},G=function(){i.css(e,"0");if(!y)l.css(e,"1")};u.initialize=function(d,e,g,b){var a="mousemove";$(window).resize(function(){setTimeout(x,200)});$(m).resize(function(){setTimeout(x,200)});i=d;n=e;if(y)$(i).css("color","white");l=g;k=b;l.bind(a,D);l.bind(f,function(a){a.stopPropagation()});i.bind(a,function(a){a.stopPropagation()});i.bind(f,function(a){a.stopPropagation()});$(document).bind(f,function(){p()});q=c};var p=function(){if(o)return;var a="."+k,b=i.children("div"),e=n.children("div"),f=b.children(a),d=e.children(a);f.removeClass(k);d.removeClass(k);o=c},D=function(a){E();var b=document.elementFromPoint(a.clientX,a.clientY);if(b&&b.tagName.toLocaleLowerCase()=="span"){var c=jQuery.Event(f);c.clientX=a.clientX;c.clientY=a.clientY;$(b).trigger(c)}else p();G();a.stopPropagation()},F=function(d,c){c=c==a?b:c;var e=c+h+d.srcInfo.replace(":",h)+"TO"+d.dstInfo.replace(":",h);return e},B=function(e,l,o,n,m){var g=$(r),k=b;g.attr(j,l);if(e.length>0){for(var i=0;i<e.length;i++){var c=e[i],d=$("<span></span>");d.text(c.content);k+=c.content;var h=a;if(c.srcInfo!=a){h=F(c,n);d.attr("srcinfo",c.srcInfo).attr("dstinfo",c.dstInfo).attr(j,l).bind(f,H)}else h=m+Math.random().toString();d.attr("id",h);g.append(d)}o.append(g)}return k},H=function(a){a.stopPropagation();p();I(this)},J=function(c){var d=c.substring(0,2),b=a;if(d==w.substring(0,2))b=v.substring(0,2);else if(d==v.substring(0,2))b=w.substring(0,2);var e=b+c.substring(2);return e};u.setHighlightStatus=function(a){if(!q)return;A=a;if(!a)p()};var I=function(f){var e="span[dstinfo='",c="span[srcinfo='",a="']",b="div[paragraphname='",p=f.getAttribute("srcinfo"),m=f.getAttribute("dstinfo"),l=f.getAttribute(j),g=i.children(b+l+a),h=n.children(b+l+a),r=g.children(c+p+a),q=g.children(e+m+a),t=h.children(c+p+a),s=h.children(e+m+a);if(A){r.addClass(k);q.addClass(k);t.addClass(k);s.addClass(k);o=d}};u.load=function(c){var e="<br></br>";if(!q)return;var f=b;if(c!=a&&c.length>0){for(var d=0;d<c.length;d++){var j=c[d].inputContents,h=c[d].outputContents;if($.trim(c[d].inputText)==b){i.append($(e));n.append($(e));f+=g}else{B(j,c[d].ParagraphName,i,w,z);f+=B(h,c[d].ParagraphName,n,v,z)}}C();setTimeout(x,200)}return f};var x=function(){l.copyElementDimensionsTo(i)},C=function(){var b=["line-height","font-family","font-weight","font-style","letter-spacing","word-wrap","border-top-width","border-right-width","border-bottom-width","border-left-width",s,t];for(var a=0;a<b.length;a++)i.css(b[a],l.css(b[a]))};u.clear=function(){if(!q)return;o=c;n.empty();i.empty()}};n.TranslationLogger=new function(){var a=function(a){return {Year:a.getFullYear(),Month:a.getMonth()+1,Day:a.getDate(),Hour:a.getHours(),Minutes:a.getMinutes(),Seconds:a.getSeconds(),Milliseconds:a.getMilliseconds()}};this.writeLog=function(p,t,w,s,j,n,k,v){var u=t,r=p,c=w,l=j,e=s,o=n,m=k;if(c.length<1||e.length<1)return;var g=[];for(var d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);d--}for(var f=0;f<e.length;f++){if(e[f]==b)continue;g.push(e[f].TranslatedText)}var i=$.utils.convertDatToUTCDate(l),h=a(i),q=JSON.stringify({input:c,output:g,from:r,to:u,url:document.location.href,requestTime:h,serviceName:m,serviceContextId:"FinalTranslation"});$.ajax({type:"POST",url:o,async:v,data:q,contentType:"application/json; charset=utf-8",dataType:"json",success:function(){}})}};n.Service=new function(){var f=this,h=f.errorCodes=new function(){var a=this;a.LANG_NOT_SUPPORTED_ERR_CODE=1;a.TIME_OUT_ERR_CODE=2;a.TOKEN_EXPIRED_ERR_CODE=3;a.GENERIC_ERR_CODE=1e3},j=function(a){var d=a.indexOf(":"),c=b;if(d>e)c=$.trim(a.substring(0,d)).toLowerCase();if(c=="argumentoutofrangeexception")if(a.toLowerCase().indexOf("'from'")!=e)return h.LANG_NOT_SUPPORTED_ERR_CODE;else if(a.toLowerCase().indexOf("the token has expired")!=e)return h.TOKEN_EXPIRED_ERR_CODE;return h.GENERIC_ERR_CODE},i=2e4;f.AddTranslation=function(j,b,a,k,n,i,c,e,l,m,d,f,h){return new g(q,{appId:j,originalText:b,translatedText:a,from:k,to:n,rating:i,contentType:c,category:e,user:l,uri:m},d,f,h)};f.BeginAddTranslation=function(l,b,a,m,p,k,c,h,n,o,f,d,e,i,j){return new g("BeginAddTranslation",{appId:l,originalText:b,translatedText:a,from:m,to:p,rating:k,contentType:c,category:h,user:n,uri:o,callback:f,asyncState:d},e,i,j)};f.EndAddTranslation=function(d,a,b,c){return new g("EndAddTranslation",{result:d},a,b,c)};f.BreakSentences=function(e,f,b,a,c,d){return new g("BreakSentences",{appId:e,text:f,language:b},a,c,d)};f.BeginBreakSentences=function(h,i,d,c,a,b,e,f){return new g("BeginBreakSentences",{appId:h,text:i,language:d,callback:c,asyncState:a},b,e,f)};f.EndBreakSentences=function(d,a,b,c){return new g("EndBreakSentences",{result:d},a,b,c)};f.Detect=function(d,e,a,b,c){return new g("Detect",{appId:d,text:e},a,b,c)};f.BeginDetect=function(f,h,c,a,b,d,e){return new g("BeginDetect",{appId:f,text:h,callback:c,asyncState:a},b,d,e)};f.EndDetect=function(d,a,b,c){return new g("EndDetect",{result:d},a,b,c)};f.DetectArray=function(d,e,a,b,c){return new g("DetectArray",{appId:d,texts:e},a,b,c)};f.BeginDetectArray=function(f,h,c,a,b,d,e){return new g("BeginDetectArray",{appId:f,texts:h,callback:c,asyncState:a},b,d,e)};f.EndDetectArray=function(d,a,b,c){return new g("EndDetectArray",{result:d},a,b,c)};f.GetAppIdToken=function(h,c,a,b,d,e,f){return new g("GetAppIdToken",{appId:h,minRatingRead:c,maxRatingWrite:a,expireSeconds:b},d,e,f)};f.BeginGetAppIdToken=function(j,c,a,b,f,d,e,h,i){return new g("BeginGetAppIdToken",{appId:j,minRatingRead:c,maxRatingWrite:a,expireSeconds:b,callback:f,asyncState:d},e,h,i)};f.EndGetAppIdToken=function(d,a,b,c){return new g("EndGetAppIdToken",{result:d},a,b,c)};f.GetLanguageNames=function(f,e,a,b,c,d){return new g("GetLanguageNames",{appId:f,locale:e,languageCodes:a},b,c,d)};f.BeginGetLanguageNames=function(i,h,a,d,b,c,e,f){return new g("BeginGetLanguageNames",{appId:i,locale:h,languageCodes:a,callback:d,asyncState:b},c,e,f)};f.EndGetLanguageNames=function(d,a,b,c){return new g("EndGetLanguageNames",{result:d},a,b,c)};f.GetLanguagesForSpeak=function(d,a,b,c){return new g("GetLanguagesForSpeak",{appId:d},a,b,c)};f.BeginGetLanguagesForSpeak=function(f,c,a,b,d,e){return new g("BeginGetLanguagesForSpeak",{appId:f,callback:c,asyncState:a},b,d,e)};f.EndGetLanguagesForSpeak=function(d,a,b,c){return new g("EndGetLanguagesForSpeak",{result:d},a,b,c)};f.GetLanguagesForTranslate=function(d,a,b,c){return new g("GetLanguagesForTranslate",{appId:d},a,b,c)};f.BeginGetLanguagesForTranslate=function(f,c,a,b,d,e){return new g("BeginGetLanguagesForTranslate",{appId:f,callback:c,asyncState:a},b,d,e)};f.EndGetLanguagesForTranslate=function(d,a,b,c){return new g("EndGetLanguagesForTranslate",{result:d},a,b,c)};f.GetTranslations=function(f,i,h,j,a,d,b,c,e){return new g("GetTranslations",{appId:f,text:i,from:h,to:j,maxTranslations:a,options:d},b,c,e)};f.BeginGetTranslations=function(i,k,j,l,a,f,d,b,c,e,h){return new g("BeginGetTranslations",{appId:i,text:k,from:j,to:l,maxTranslations:a,options:f,callback:d,asyncState:b},c,e,h)};f.EndGetTranslations=function(d,a,b,c){return new g("EndGetTranslations",{result:d},a,b,c)};f.Translate=function(f,i,h,j,a,c,b,d,e){return new g("Translate",{appId:f,text:i,from:h,to:j,contentType:a,category:c},b,d,e)};f.BeginTranslate=function(i,k,j,l,a,e,d,b,c,f,h){return new g("BeginTranslate",{appId:i,text:k,from:j,to:l,contentType:a,category:e,callback:d,asyncState:b},c,f,h)};f.EndTranslate=function(d,a,b,c){return new g("EndTranslate",{result:d},a,b,c)};f.AddTranslationArray=function(f,a,h,i,d,b,c,e){return new g("AddTranslationArray",{appId:f,translations:a,from:h,to:i,options:d},b,c,e)};f.BeginAddTranslationArray=function(i,a,j,k,f,d,b,c,e,h){return new g("BeginAddTranslationArray",{appId:i,translations:a,from:j,to:k,options:f,callback:d,asyncState:b},c,e,h)};f.EndAddTranslationArray=function(d,a,b,c){return new g("EndAddTranslationArray",{result:d},a,b,c)};f.GetTranslationsArray=function(f,h,i,j,a,d,b,c,e){return new g("GetTranslationsArray",{appId:f,texts:h,from:i,to:j,maxTranslations:a,options:d},b,c,e)};f.BeginGetTranslationsArray=function(i,j,k,l,a,f,d,b,c,e,h){return new g("BeginGetTranslationsArray",{appId:i,texts:j,from:k,to:l,maxTranslations:a,options:f,callback:d,asyncState:b},c,e,h)};f.EndGetTranslationsArray=function(d,a,b,c){return new g("EndGetTranslationsArray",{result:d},a,b,c)};f.Speak=function(h,i,b,f,d,a,c,e){return new g("Speak",{appId:h,text:i,language:b,format:f,options:d},a,c,e)};f.BeginSpeak=function(j,k,d,i,f,c,a,b,e,h){return new g("BeginSpeak",{appId:j,text:k,language:d,format:i,options:f,callback:c,asyncState:a},b,e,h)};f.EndSpeak=function(d,a,b,c){return new g("EndSpeak",{result:d},a,b,c)};f.TranslateArray=function(e,f,h,i,c,a,b,d){return new g("TranslateArray",{appId:e,texts:f,from:h,to:i,options:c},a,b,d)};f.BeginTranslateArray=function(h,i,j,k,e,c,a,b,d,f){return new g("BeginTranslateArray",{appId:h,texts:i,from:j,to:k,options:e,callback:c,asyncState:a},b,d,f)};f.EndTranslateArray=function(d,a,b,c){return new g("EndTranslateArray",{result:d},a,b,c)};f.TranslateArray2=function(e,f,h,i,c,a,b,d){return new g("TranslateArray2",{appId:e,texts:f,from:h,to:i,options:c},a,b,d)};f.BeginTranslateArray2=function(h,i,j,k,e,c,a,b,d,f){return new g("BeginTranslateArray2",{appId:h,texts:i,from:j,to:k,options:e,callback:c,asyncState:a},b,d,f)};f.EndTranslateArray2=function(d,a,b,c){return new g("EndTranslateArray2",{result:d},a,b,c)};var k=0;function g(q,n,v,y,l){var b=this,o,f=k++;b.requestNumber=f;var r="onComplete_"+f,g="onError_"+f,x=d,s=a;b.LogEntry=a;var z=b,m={};for(var A in n)m[A]=JSON.stringify(n[A]);m[u]=r;m["onerror"]=g;function t(){delete window[r];delete window[g]}window[r]=function(a){clearTimeout(o);var b=new Date-s;z.LogEntry=new w(q,n,a,b,Microsoft.Translator.Configurations.serviceName,Microsoft.Translator.Configurations.locale,Microsoft.Translator.Configurations.referrer);if(v)v(a,f);try{t()}catch(c){}};window[g]=function(c){clearTimeout(o);var d=new Date-s;z.LogEntry=new w(q,n,a,d,Microsoft.Translator.Configurations.serviceName,Microsoft.Translator.Configurations.locale,Microsoft.Translator.referrer);var b=e;if(c==a)b=h.TIME_OUT_ERR_CODE;else b=j(c);if(y)y(c,f,b);try{t()}catch(g){}};var B=$.ajax(Microsoft.Translator.Configurations.serviceURL+"/"+q,{data:m,dataType:p,jsonp:d,beforeSend:function(){s=new Date},timeout:l});b.abort=function(){x=c;try{B.abort()}catch(a){}};b.isAborted=function(){return x};o=setTimeout(function(){window[g](a)},l&&typeof l==="number"?l:i)}};var w=function(c,g,e,f,b,h,d){var a=this;a.methodName=c;a.request=g;a.response=e;a.serviceName=b;a.locale=h;a.referrer=d;a.latency=f},x=new function(){this.log=function(a,b){if($.type(b)!=="boolean")b=c;if($.type(a)!=="array")return;try{if(a.length>0&&a[0].methodName&&$.type(eval(this[a[0].methodName+"Logger"]))===v){var f=this[a[0].methodName+"Logger"],e=f(a);$.ajax(Microsoft.Translator.Configurations.baseURL+"sync.ashx",{data:e,dataType:p})}}catch(d){console.log("No logs have been created with the provided entries.")}if(b)try{delete a}catch(d){}};this.TranslateArrayLogger=function(c){var a={};a["svc"]=c[0].serviceName;a["loc"]=c[0].locale;a["ref"]=c[0].referrer;a[l]=c[0].request.from;a["to"]=c[0].request.to;a["dtc"]=!a[l]&&c[0].response?c[0].response[0].From:b;var d=b;$.each(c,function(i,b){d+=b.request.texts.join("|");var j=b.response?"S":"E",e=0,f=b.request.texts.length;$.each(b.request.texts,function(b,a){e+=a.length});var c=0;if(b.response)$.each(b.response,function(b,a){c+=a.OriginalTextSentenceLengths.length});else c=f;var g=b.latency<13000?b.latency:13000;a[i]=j+h+e+h+c+h+f+h+g});d=d.substr(0,128)+"...";a["text"]=d;return a};this.TranslateArray2Logger=function(a){return x.TranslateArrayLogger(a)}};n.Languages=new function(){var a="?!.:,",b=this;b.separators={ar:"؟!.:،","zh-chs":"?!。:","zh-cht":"?!。:",cs:a,da:a,de:a,el:a,en:a,es:"¿?¡!.:,",fr:a,he:a,hi:"?!.:,।",it:a,ko:a,nl:a,no:a,pl:a,pt:a,ru:a,sv:a,th:"!:",tr:" ?!.:,",ja:"?!。:"};var c={ar:1,he:1,fa:1,ur:1};b.getDirection=function(a){return c[a]?"rtl":"ltr"};b.isRTL=function(a){return this.getDirection(a)=="rtl"};b.getAlignment=function(a){return this.isRTL(a)?"right":"left"};b.setControlDirectionForLanguage=function(a,b){a.css(s,Microsoft.Translator.Languages.getDirection(b));a.css(t,Microsoft.Translator.Languages.getAlignment(b))}};n.TTS=new function(){var h="source",t="<audio><source src='{0}' type='{1}'></audio>",s='<embed src="{0}" width="0" height="0" type="{1}" hidden="true" autostart="true" loop="false" postdomevents="true"></embed>',u='<bgsound id="iesound" src="about:blank" ></bgsound>',k=450,r="http://api.microsofttranslator.com/v2/http.svc/speak?appId={0}&language={1}&format={2}&options=MinSize&text={3}".replace("{0}",Microsoft.Translator.Configurations.appId),i=a,o=d,j=a,l=d;this.play=function(h,m,n,s,r,t){j=t;var c=[],l=m.split(g);if($.detection.isChromeForAndroid()||$.detection.isIEBefore9()||$.detection.isSafariWindows()&&!Modernizr.audio||$.detection.isIPad())l=[m.replace(g," ")];o=d;$.each(l,function(){var a=$.trim(this);while(a.length>0){if(a.length<=k){c.push(a);break}var g=a.substr(0,k),i=Microsoft.Translator.Languages.separators[h.toLowerCase()]+f,d=e;$.each(i,function(b,a){d=Math.max(d,g.lastIndexOf(a))});if(d!=e&&a.length>d+1){c.push(a.substr(0,d+1));a=a.substr(d+1)}else if(d==e){c.push(g);a=a.substr(k)}else{c.push(a);a=b}if($.detection.isChromeForAndroid()||$.detection.isIPad())break}});var i=function(){p($(this));c.shift();if(c.length>0&&!o)q(h,c[0],a,i);else if(r)r()};if(n)n();q(h,c[0],s,i)};function q(w,x,k,v){var e="audio/mpeg",a="error",f="audio/wav";l=d;var p=r.replace("{1}",w).replace("{2}",encodeURI("audio/mp3")).replace("{3}",encodeURIComponent(x)),z=r.replace("{1}",w).replace("{2}",encodeURI(f)).replace("{3}",encodeURIComponent(x));if($.detection.isIEBefore9()){var o=$("#iesound");if(o.length==0)o=$(u).appendTo($(m));o.get(0).src=p}else if(Modernizr.audio){i=$(t).appendTo($(m));if(j){i.bind(a,n);i.children(h).bind(a,n)}if(i.get(0).canPlayType(e)){i.children(h)[0].src=p;i.children(h)[0].type=e}else{i.children(h)[0].src=z;i.children(h)[0].type=f}i.get(0).play();if(k)if("oncanplay" in i.get(0))i.bind("canplay",k);else i.bind("play",k);i.bind("ended",v)}else{var g=s.replace(/\{0\}/g,p);if(!$.detection.isSafariWindows())g=g.replace(/\{1\}/g,e);else g=g.replace(/\{1\}/g,b);i=$(g).appendTo($(m));i.bind(a,n);var q=d,y=setInterval(function(){switch(i.get(0).playState){case 0:case 8:clearInterval(y);v();break;case 2:case 3:if(!q&&k){k();q=c}}},50)}}function n(a){if(!l){l=c;w();if(j)j(a)}}function p(c){if(c!=a&&c.length>0){if(c.get(0).pause&&typeof c.get(0).pause==v)c.get(0).pause();if(c.get(0).src)c.src=b;if(c.children(h).length>0)c.children(h)[0].src=b;c.remove()}}var w=this.stop=function(){o=c;try{p(i)}catch(a){}}};n.LandingPage=new function(){var B="_blank",E="href",D="<a/>",q="inline-block",z="Active",w="none",m="display",K="DictionaryResult",y="hidden",s="visibility",jb="In partnership with CBS, Paramount and KLI",ib="http://www.microsoft.com/en-us/translator/partners.aspx#Klingon",P=a,Ub=a,H=a,Q=a,Rb=a,Gb=a,t=a,S=a,cb=a,V=a,rb=a,v=a,h=a,n=a,O=a,pb=a,W,gb,kb,qb,nb,R=a,ab=a,T=a,Cb=b,U=b,ac,Zb,xb=a,I=a,Qb=a,Sb=a,tb=a,Ib,Db=a,sb=a,A=[],Xb=0,hb=a,Kb=a,Hb=a,wb=d,G,X,pc="{0} (Auto-Detected)",mb=Microsoft.Translator.Configurations.locale,Y={mww:{href:"http://www.microsoft.com/en-us/translator/partners.aspx#Hmong",text:"In cooperation with Hmong Language Partners"},ur:{href:"http://www.microsoft.com/en-us/translator/partners.aspx#JNU",text:"In partnership with JNU"},"tlh-Qaak":{href:ib,text:jb},tlh:{href:ib,text:jb},lv:{href:"http://www.microsoft.com/en-us/translator/partners.aspx#Tilde",text:"In partnership with Tilde"},cy:{href:"http://www.microsoft.com/en-us/translator/partners.aspx#NationalAssembly",text:"In cooperation with the National Assembly"}},L="LangPair_FromDDL_lpmru",eb="LangPair_ToDDL_lpmru",yc="http://www.bing.com/search?form=MSTLP1&q=",zc="http://www.bing-int.com/search?form=MSTLP1&q=",Hc="Translation powered by Bing Translator",qc=5e3,Kc="to",Fc=l,Gc="a",dc="http://www.microsofttranslator.com/bv.aspx",F=0,Lc=c,oc=c,jc={"ko-en":1,"en-ko":1,"ja-en":1,"en-ja":1,"zh-en":1,"en-zh":1,"es-en":1,"en-es":1,"it-en":1,"en-it":1,"de-en":1,"en-de":1,"fr-en":1,"en-fr":1},nc=4,Fb={de:1,en:1,es:1,fr:1,it:1},gc=Microsoft.Translator.Configurations.baseURL+"dictionary.ashx",Wb=["ca","ca-es","da","da-dk","de","de-de",j,"en-au","en-ca","en-gb","en-in","en-us","es","es-es","es-mx","fi","fi-fi","fr","fr-ca","fr-fr","it","it-it","ja","ja-jp","ko","ko-kr","nb-no","nl","nl-nl","no","pl","pl-pl","pt","pt-br","pt-pt","ru","ru-ru","sv","sv-se","zh-chs","zh-cht","zh-cn","zh-hk","zh-tw"],cc=c,Mc=function(){db(d)},x=function(){return t.val()},ob=function(a){switch(t.get(0).tagName.toLowerCase()){case "div":t.text(a);break;default:t.val(a)}},Pb=function(){ob(b);$(window).resize()},Bc=function(){var b=A[C(sb)];if(b!=a)Nb(c,b,Ib,d)};this.initialize=function(F,ib,g,vb,U,Y,f,ub,jb,sb,D,o,G,wb,j,u,C,A,l,E,db,K,B,q,i,r,w,k,hb,m,z,p){S=D;cb=o;V=G;R=A;ab=l;T=E;$(window).bind("beforeunload",Bc);v=j;Ub=C;rb=wb;t=sb;Qb=u;P=q;H=i;Q=r;Rb=w;Gb=k;h=ib;n=Y;I=m;pb=U;O=jb;W=vb;gb=ub;nb=K;qb=db;X=hb;kb=B;Sb=z;tb=p;M();I.hide();Ub.click(function(){J();trackOmnitureEvent("Translate Button Click","event3");fb(c,undefined,c)});rb.mouseover(Dc);t.keyup(kc).keydown(function(){J()}).bind("paste",function(){setTimeout(Jc,20)});P.click(ec);Q.click(function(){Bb(1)});Rb.click(function(){Bb(e)});Gb.click(function(){Bb(-2)});h.onchange=wc;n.onchange=vc;pb.click(function(){Lb();X.css(s,y);Pb();M();lb()});O.click(Ab);if(g.length!=0)h.val(g);else if(h.val()==b){Microsoft.Translator.Languages.setControlDirectionForLanguage(t,mb);bb(d)}else bb(c);xb=h.val();var a=Microsoft.Translator.MRULs.get(L);$.each(W,function(b,a){a.click(Ec)});N(W,a,h.val()||h.autoDetected(),h.items());a=Microsoft.Translator.MRULs.get(eb);$.each(gb,function(b,a){a.click(Cc)});if(f.length!=0)n.val(f);else if(a.length==0)n.val(mb);else n.val(a[0]);N(gb,a,n.val(),n.items());kb.click(function(){v.selectAll()});R.click(rc);S.click(tc);T.click(xc);V.click(Ac);if(Microsoft.Translator.Configurations.rttEnabled)setInterval(function(){fb(d,c)},1200);else if($.trim(x()).length>0)fb(c,d);setInterval(function(){ic()},500);$(document).click(uc);if(Z())Microsoft.Translator.HighlightingManager.initialize(rb,v,t,"highlight");if(!F)ob(b);t.focus();lb()};var J=function(){if(Z())Microsoft.Translator.HighlightingManager.setHighlightStatus(d)},M=function(){Microsoft.Translator.TTS.stop();mc();rb.html(b);S.hide();cb.hide();V.hide();R.hide();ab.hide();T.hide();qb.hide();nb.hide();kb.hide();Q.hide();P.hide();db(d);tb.hide()},lb=function(){if($.trim(x())==b)pb.hide();else pb.show(F)},mc=function(){v.html(b);v.parent().removeClass(K)},lc=function(){ac=h.val();Zb=n.val();Cb=x()},ec=function(){if(H.css(m)==w)db(c);else db(d);return d},tc=function(){ab.hide();T.hide();ub();var a=h.val()==b?h.autoDetected():h.val();bc(a,Cb,S,V,cb)},rc=function(){cb.hide();V.hide();vb();bc(n.val(),U,R,T,ab)},bc=function(e,f,d,b,c){Microsoft.Translator.TTS.stop();if(!($.detection.isIEBefore9()||$.detection.isSafariWindows()&&!Modernizr.audio)){d.hide();b.hide();c.show()}Microsoft.Translator.TTS.play(e,f,a,function(){b.show();c.hide()},function(){b.hide();d.show()},function(){c.hide();b.hide();d.show()})},Ac=function(){vb();Vb(V,cb)},xc=function(){ub();Vb(T,ab)},Vb=function(b,a){Microsoft.Translator.TTS.stop();b.hide();a.hide()},uc=function(){db(d)},db=function(a){if(a){H.addClass(z);H.css(m,q)}else{H.css(m,w);H.removeClass(z)}},Ob=function(){var a=x();if(a.match(/[\t]/)){a=a.replace(/[\t]/g," ");ob(a)}},Jc=function(){J();Ob();lb()},kc=function(a){Ob();if(a.which!=Keys.PrtScr)J();lb();switch(a.which){case Keys.ENTER:fb(c,d);return}},ub=function(){if(cc&&$.inArray(n.val().toLowerCase(),Wb)!=e)R.fadeIn(F).show();else R.hide()},vb=function(){var a=h.val()==b?h.autoDetected():h.val();if(cc&&$.trim(x())!=b&&$.inArray(a.toLowerCase(),Wb)!=e)S.fadeIn(F).show();else S.hide()},sc=function(){var a=t.attr("mtmaxlength");if(a)a=parseInt(a,10);if($.type(a)==="number"&&a>0&&x().length>a){var b=t.getCaretPosition();ob(x().substring(0,a));t.setCaretPosition(b)}},Ec=function(){var a=Microsoft.Translator.MRULs.get(L);Yb(this,h);N(W,a,h.val()||h.autoDetected(),h.items())},Cc=function(){var a=Microsoft.Translator.MRULs.get(eb);Yb(this,n);N(gb,a,n.val(),n.items())},Yb=function(b,a){a.val($(b).attr("value"))},Mb=function(b,e,i,g){var a=c;if(b.length==e.length)$.each(b,function(b,g){if($.trim(g.replace(/\s+/g,f))!=$.trim(e[b].replace(/\s+/g,f))){a=d;return d}return c});else a=d;return !(a&i==h.val()&g==n.val())},Nb=function(d,a,e,f){if(!a.isFakeResponse){var c=Mb(x().split(g),a.inputText,a.srcLang,a.dstLang);if(!c||d)Microsoft.Translator.TranslationLogger.writeLog(a.srcLang==b?a.finalSrcLang:a.srcLang,a.dstLang,a.inputText,e,a.time,Microsoft.Translator.Configurations.translationLoggerUrl,Microsoft.Translator.Configurations.serviceName,f)}delete A[C(a.requestNumber)]},Z=function(){return Microsoft.Translator.Configurations.phraseAlignmentEnabled&&!$.detection.isIPad()},Lb=function(){if(G){delete A[C(G.requestNumber)];G.abort()}},fc=function(i,g){var j=d,h=d;if(g==a){h=c;return {_isDifferentInNonTrailingSpaces:j,_isDifferentText:h}}var k=Math.max(i.length,g.length);for(var e=0;e<k;e++){if(e>i.length-1)if($.trim(g[e])==b)continue;else{h=c;break}if(e>g.length-1)if($.trim(i[e])==b)continue;else{h=c;break}if($.trim(i[e].replace(/\s+/g,f))!=$.trim(g[e].replace(/\s+/g,f))){h=c;break}if(i[e].replace(/\s+$/g,b)!=g[e].replace(/\s+$/g,b))j=c}return {_isDifferentInNonTrailingSpaces:j,_isDifferentText:h}},fb=function(q,l,m){sc();var o=Cb.split(g),e=$.trim(x()),b=x().split(g),j=$.validation.isUrl(e);if(!q&&!Mb(b,o,ac,Zb)){if(hb!=a&&Z()){var k=fc(b,Kb);if(!k._isDifferentText)if(!wb&&!j){if(k._isDifferentInNonTrailingSpaces)Eb(x(),hb);Microsoft.Translator.HighlightingManager.setHighlightStatus(c)}}return}clearTimeout(Xb);lc();Lb();X.css(s,y);if(j){M();var i={};i[Fc]=h.val();i[Kc]=n.val();i[Gc]=e;if(e.length>1500)$(r).text(e).appendTo(v);else if(l)$(D).attr(E,"javascript:void(0);").text(e).click(function(){$.utils.sendPostRequest(dc,i,B)}).appendTo(v);else $.utils.sendPostRequest(dc,i,"_self");return}if($.trim(x()).length==0){Pb();M();return}X.css(s,"visible");Db=!l?Microsoft.Translator.Configurations.appId:Microsoft.Translator.Configurations.rttAppId;var p=b.slice(0);for(var d=0;d<b.length;d++)if($.trim(b[d]).length==0){b.splice(d,1);d--}else{b[d]=b[d].replace(/\s+/g,f);b[d]=$.trim(b[d])}if(Z())G=Microsoft.Translator.ServiceWrapper.TranslateArray2(Db,b,h.val(),n.val(),{},yb,Tb);else G=Microsoft.Translator.ServiceWrapper.TranslateArray(Db,b,h.val(),n.val(),{},yb,Tb);hb=a;Hb=G.requestNumber;A[C(G.requestNumber)]={requestNumber:G.requestNumber,inputText:p,srcLang:h.val(),dstLang:n.val(),isTranslateButtonHit:m,time:new Date}},Dc=function(){},Bb=function(d){tb.css(m,q);H.css(m,w);P.css(m,w);Q.css(m,w);try{var g=x(),i=U,c=h.val()==b||h.val()==a?h.autoDetected():h.val(),e=n.val(),f=Ic();Microsoft.Translator.ServiceWrapper.AddTranslation(Microsoft.Translator.Configurations.appId,g,i,c,e,d,undefined,undefined,f,undefined,function(){},function(){},undefined)}catch(j){}},Ic=function(){var d=$.cookies.read("mstcid");if(d==a||d==b){d=Math.floor(Math.random()*1e9).toString(16);$.cookies.write("mstcid",d,c)}return d},Jb=function(a){t.removeClass(xb).addClass(a);xb=a},wc=function(){J();var a=h.val()==b?h.autoDetected():h.val();Jb(a);if(a==b){Microsoft.Translator.Languages.setControlDirectionForLanguage(t,j);bb(d)}else{Microsoft.Translator.MRULs.add(L,a,3);N(W,Microsoft.Translator.MRULs.get(L),a,h.items());Microsoft.Translator.Languages.setControlDirectionForLanguage(t,a);bb(c)}zb()},vc=function(){J();Microsoft.Translator.MRULs.add(eb,n.val(),3);N(gb,Microsoft.Translator.MRULs.get(eb),n.val(),n.items());zb()},bb=function(b){var a="Inactive";O.removeClass(a);O.removeClass(z);O.unbind("click",Ab);if(b)O.bind("click",Ab);O.addClass(b?z:a)},Ab=function(){if(!h.val()&&!h.autoDetected())return;J();var a=h.val()||h.autoDetected();h.val(n.val());n.val(a)},hc=function(a){var b=h.val()||h.autoDetected(),c=nc;if(Fb[b])c=Fb[b];if(a.length>32||a.split(/\s+/).length>c)return;var d={from:b,to:n.val(),text:a};$.ajax(gc,{data:d,dataType:p,jsonp:u,success:function(b){if($.trim(b).length==0)return;var a=b.toString();if($.trim(a).length>0){v.parent().addClass(K);Qb.html(a)}},error:function(){}})},zb=function(){I.html(b);var c=h.val()||h.autoDetected(),a=n.val();if(Y[c])$(D).attr(E,Y[c].href).attr("target",B).html(Y[c].text).appendTo(I);if(Y[a]&&a!=c)$(D).attr(E,Y[a].href).attr("target",B).html(Y[a].text).appendTo(I);if(I.html().length>0)I.show()},ic=function(){Sb.text(x().length+"/"+qc)},Eb=function(a,e){Kb=a.split(g);var b=Microsoft.Translator.TranslationResultParser.parseResultsArray(a.split(g),e,n.val());Microsoft.Translator.HighlightingManager.setHighlightStatus(d);Microsoft.Translator.HighlightingManager.clear();U=Microsoft.Translator.HighlightingManager.load(b);Microsoft.Translator.HighlightingManager.setHighlightStatus(c)},C=function(a){return "req_"+a},yb=function(r,w){if(w<sb){try{delete A[C(w)]}catch(T){}return}var p=A[C(w)];if(p==a)return;var I=p.inputText.join(g);sb=w;Ib=r;var i=h.val(),H=n.val();M();U=b;if(i==b){i=r[0].From;h.autoDetected(i);h.label(pc.replace("{0}",h.getItemName(i)));Microsoft.Translator.MRULs.add(L,i,3);if(i==H){var x=Microsoft.Translator.MRULs.get(eb),u=b;if(x.length>0)for(var z=0;z<x.length;z++)if(x[z]!=i&&typeof n.getItemName(x[z])!=o){u=x[z];break}if(!u)if(i!=mb)u=mb;else u=j;if(i!=u){n.val(u);delete A[C(w)];fb(c,d);return}}}wb=d;hb=r;p.finalSrcLang=i;Jb(i);vb();Microsoft.Translator.Languages.setControlDirectionForLanguage(t,i);if(Z())Eb(I,r);else{var B=0;$.each(p.inputText,function(d,c){var b=a;if($.trim(c).length==0){b=$("<br/>");U+=g;B--}else{b=$("<div/>").text(r[B].TranslatedText);U+=r[B].TranslatedText+g}v.append(b);B++})}zb();v.parent().attr("class",b);v.parent().addClass(H);ub();var D=[];v.children().each(function(b,a){if(a.tagName.toLowerCase()=="br")D.push(g);else D.push($(a).text().replace(/\s+/g,f)+g)});D.push(Hc);var K=encodeURI(D.join(b)).replace(/'/g,"\\x27"),J="mailto:?body="+K;if(J.length<2e3){qb.fadeIn(F).css(m,q);qb.get(0).setAttribute("onclick","location.href='"+J+"'")}var l=b;v.children().each(function(b,a){if(a.tagName=="br")l+=f;else l+=f+$(a).text()});l=$.trim(l);l=encodeURI(l.replace(/\s+/g,f).replace(/%20/g,"+")).replace(/'/g,"\\x27");if(l.length<1950){var O=Lc?yc:zc;nb.get(0).setAttribute("onclick","window.open('"+O+l+"', '_blank');");nb.fadeIn(F).css(m,q)}if(oc){var E=b,G=n.val();E+=i.indexOf(k)!=e?i.substr(0,i.indexOf(k)):i;E+=k;E+=G.indexOf(k)!=e?G.substr(0,G.indexOf(k)):G;if(jc[E])hc(I)}P.css(m,q);Q.css(m,q);kb.fadeIn(F).css(m,q);Q.fadeIn(F).css(m,q);P.fadeIn(F).css(m,q);bb(c);Xb=setTimeout(function(){var a=i;Microsoft.Translator.MRULs.add(L,a,3)},1e4);N(W,Microsoft.Translator.MRULs.get(L),h.val()||h.autoDetected(),h.items());Microsoft.Translator.Languages.setControlDirectionForLanguage(v,H);Microsoft.Translator.Languages.setControlDirectionForLanguage(v.parent(),H);X.css(s,y);var S=p.isTranslateButtonHit?1:1e4,R=p.isTranslateButtonHit;setTimeout(function(){Nb(R,p,r,c)},S)},Tb=function(n,d,l){if(d!=a)if(d<Hb){delete A[C(d)];return}if(l==Microsoft.Translator.Service.errorCodes.TOKEN_EXPIRED_ERR_CODE){M();document.location.href=document.location.href}else{var g=A[C(d)];if(g!=a&&g.inputText){var k=[],f=g.inputText,e;for(i=0;i<f.length;i++)if($.trim(f[i])!=b){if(l==Microsoft.Translator.Service.errorCodes.LANG_NOT_SUPPORTED_ERR_CODE)e=j;else if(h.val())e=h.val();else if(h.autoDetected())e=h.autoDetected();else e=j;var m={Alignment:a,From:e,TranslatedTextSentenceLengths:"["+f[i].length.toString()+"]",TranslatedText:f[i]};k.push(m)}g.isFakeResponse=c;yb(k,d);return}M()}wb=c;X.css(s,y);delete A[C(d)]},N=function(f,b,g,h,e){if(typeof e==o)e=0;for(var d=0,a=e;d<f.length;d++,a++){var c=f[d];if(b.length>a&&b[a]!=g){c.attr("value",b[a]);c.text(h[b[a]]);c.css(m,q)}else if(b.length<=a)c.hide();else d--}}}}
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×