/* jQuery Translate plugin and related components */
/* http://code.google.com/p/jquery-translate/
 * Version: 1.3.9
 * License: MIT, GPL  (c) 2009 Balazs Endresz
 */
(function(d){var a,j,h,g=false,b=false,i=[];function e(){j=c.GL=google.language;h=j.Languages;g=true;var k;while(k=i.shift()){k()}}function f(){}function c(){this.extend(d.translate);delete this.defaults;delete this.fn}c.prototype={version:"1.3.9",translateInit:function(k,m){var l=this;this.options=m;m.from=this.toLanguageCode(m.from)||"";m.to=this.toLanguageCode(m.to)||"";if(m.fromOriginal&&m.nodes[0]){m.nodes.each(function(n){var o=d.translate.getData(this,m.from,m);if(!o){return false}k[n]=o})}if(typeof k==="string"){if(!m.comments){k=this.stripComments(k)}this.rawSource="<div>"+k+"</div>";this.isString=true}else{if(!m.comments){k=d.map(k,function(n){return d.translate.stripComments(n)})}this.rawSource="<div>"+k.join("</div><div>")+"</div>";this.isString=false}this.from=m.from;this.to=m.to;this.source=k;this.elements=m.nodes;this.rawTranslation="";this.translation=[];this.startPos=0;this.i=0;this.stopped=false;m.start.call(this,m.nodes[0]?m.nodes:k,m.from,m.to,m);if(m.timeout>0){this.timeout=setTimeout(function(){m.onTimeout.call(l,m.nodes[0]?m.nodes:k,m.from,m.to,m)},m.timeout)}(m.toggle&&m.nodes[0])?this._toggle():this.translate();return this},translate:function(){if(this.stopped){return}var t=this,k=this.options;this.rawSourceSub=this.truncate(this.rawSource.substr(this.startPos),1750);this.startPos+=this.rawSourceSub.length;var q=this.rawTranslation.length,u;while((u=this.rawTranslation.lastIndexOf("</div>",q))>-1){q=u-1;var v=this.rawTranslation.substr(0,q+1),s=v.match(/<div[> ]/gi),r=v.match(/<\/div>/gi);s=s?s.length:0;r=r?r.length:0;if(s!=r+1){continue}var m=d(this.rawTranslation.substr(0,q+7)),p=m.length,n=this.i;if(n==p){break}m.slice(n,p).each(function(l,o){(function(){if(this.stopped){return false}var y=d(o).html().replace(/^\s/,""),x=n+l,z=this.source,A=this.from.length<2&&this.detectedSourceLanguage||this.from;this.translation[x]=y;if(!k.nodes[0]){if(this.isString){this.translation=y}else{z=this.source[x]}k.each.call(this,x,y,z,A,this.to,k)}else{this.each(x,this.elements[x],y,this.source[x],A,this.to,k);k.each.call(this,x,this.elements[x],y,this.source[x],A,this.to,k)}this.i++}).call(t)});break}if(this.rawSourceSub.length>0){j.translate(this.rawSourceSub,this.from,this.to,function(l){(function(){if(l.error){return k.error.call(this,l.error,this.rawSourceSub,this.from,this.to,k)}this.rawTranslation+=l.translation||this.rawSourceSub;this.detectedSourceLanguage=l.detectedSourceLanguage;this.translate()}).call(t)});if(!k.nodes[0]){return}}else{if(!this.rawTranslation){return}var w=this.from.length<2&&this.detectedSourceLanguage||this.from;if(this.timeout){clearTimeout(this.timeout)}if(!k.nodes[0]){k.complete.call(this,this.translation,this.source,w,this.to,k)}else{k.complete.call(this,this.elements.end(),this.elements,this.translation,this.source,w,this.to,k)}}},stop:function(){if(this.stopped){return this}this.stopped=true;this.options.error.call(this,{message:"stopped"});return this}};d.translate=function(m,l,k,o){if(m==a){return new c()}if(d.isFunction(m)){return d.translate.ready(m,l)}var n=new c();return d.translate.ready(function(){return n.translateInit(m,d.translate._getOpt(l,k,o))},false,n)};d.translate.fn=d.translate.prototype=c.prototype;d.translate.fn.extend=d.translate.extend=d.extend;d.translate.extend({stripComments:function(k){return k.replace(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/g,"")},truncate:function(q,l){var m,u,r,p,o,s,k=encodeURIComponent(q);for(m=0;m<10;m++){try{s=decodeURIComponent(k.substr(0,l-m))}catch(n){continue}if(s){break}}return(!(u=/<(?![^<]*>)/.exec(s)))?((!(r=/>\s*$/.exec(s)))?((p=/[\.\?\!;:](?![^\.\?\!;:]*[\.\?\!;:])/.exec(s))?((o=/>(?![^>]*<)/.exec(s))?(p.index>o.index?s.substring(0,p.index+1):s.substring(0,o.index+1)):s.substring(0,p.index+1)):s):s):s.substring(0,u.index)},getLanguages:function(t,s){if(t==a||(s==a&&!t)){return h}var r={},m=s,p=h;if(s){p=d.translate.getLanguages(t)}else{if(typeof t==="object"){m=t}}if(m){for(var q=0,n=m.length,k,o;q<n;q++){k=d.translate.toLanguageCode(m[q]);for(o in p){if(k===p[o]){r[o]=p[o]}}}}else{for(var o in h){if(j.isTranslatable(h[o])){r[o]=h[o]}}}return r},toLanguage:function(m,n){for(var k in h){if(m===k||m===h[k]||m.toUpperCase()===k||m.toLowerCase()===h[k].toLowerCase()){return n==="lowercase"?k.toLowerCase():n==="capitalize"?k.charAt(0).toUpperCase()+k.substr(1).toLowerCase():k}}},toLanguageCode:function(k){return h.a||h[d.translate.toLanguage(k)]},same:function(l,k){return l===k||d.translate.toLanguageCode(l)===d.translate.toLanguageCode(k)},isTranslatable:function(k){return j.isTranslatable(d.translate.toLanguageCode(k))},getBranding:function(l,k,m){return d(j.getBranding(l,k,m))},load:function(l,m,k){b=true;function n(){google.load(m||"language",k||"1",{callback:e})}(typeof google!=="undefined"&&google.load)?n():d.getScript("http://www.google.com/jsapi?"+(l?"key="+l:""),n);return d.translate},ready:function(k,m,l){g?k():i.push(k);if(!b&&!m){d.translate.load()}return l||d.translate},_getOpt:function(l,k,r,q){var p,n,m={};if(typeof l==="object"){m=l}else{if(!k&&!r){n=l}if(!r&&k){if(typeof k==="object"){n=l;m=k}else{p=l;n=k}}if(l!=a&&k&&r){p=l;n=k;m=r}m.from=p||m.from||"";m.to=n||m.to||""}if(m.fromOriginal){m.toggle=true}if(m.toggle){m.data=true}if(m.async===true){m.async=2}return d.extend({},d.translate._defaults,(q?d.fn.translate.defaults:d.translate.defaults),m)},_defaults:{comments:false,start:f,error:f,each:f,complete:f,onTimeout:f,timeout:0,from:"",to:"",nodes:[],walk:true,returnAll:false,replace:true,rebind:true,data:true,setLangAttr:false,subject:true,not:"",altAndVal:true,async:false,toggle:false,fromOriginal:false}});d.translate.defaults=d.extend({},d.translate._defaults)})(jQuery);(function(c){var a={text:true,button:true,submit:true};function b(g,f){var h=g.css("text-align");g.css("direction",f);if(h==="right"){g.css("text-align","left")}if(h==="left"){g.css("text-align","right")}}function d(f,g){var h=f.nodeName.toUpperCase(),e=h==="INPUT"&&c.attr(f,"type").toLowerCase();return typeof g.subject==="string"?g.subject:g.altAndVal&&(h==="IMG"||e==="image")?"alt":g.altAndVal&&a[e]?"value":h==="TEXTAREA"?"value":"html"}c.translate.fn._toggle=function(){var g=this,h=this.options,f=h.nodes,i=h.to,e=false;f.each(function(j){g.i=j;var l=c(this),k=g.getData(this,i,h);if(!k){return !(e=true)}g.translation.push(k);g.setLangAttr(l,i,h);g.replace(l,k,h);h.each.call(g,j,g.elements[j],k,g.source[j],g.from,i,h)});!e?h.complete.call(this,f.end(),f,g.translation,this.source,this.from,this.to,h):this.translate()};c.translate.extend({isRtl:{ar:true,he:true,iw:true,fa:true,ur:true},each:function(g,j,f,h,n,m,l){var k=c(j);c.translate.setData(j,f,h,n,m,l);c.translate.replace(k,f,l);c.translate.setLangAttr(k,m,l)},getData:function(e,h,g){var f=c.data(e,"translation");return f&&f[h]&&f[h][d(e,g)]},setData:function(h,e,g,l,k,j){if(!j.data){return}var f=d(h,j),i=c.data(h,"translation");i=i||c.data(h,"translation",{});(i[l]=i[l]||{})[f]=g;(i[k]=i[k]||{})[f]=e;c.data(h,"translation."+l+"."+f,g);c.data(h,"translation."+k+"."+f,e)},replace:function(j,p,g){if(!g.replace){return}if(typeof g.subject==="string"){return j.attr(g.subject,p)}var i=j[0],m=i.nodeName.toUpperCase(),l=m==="INPUT"&&c.attr(i,"type").toLowerCase(),k=c.translate.isRtl,h=c.data(i,"lang");if(h===g.to){return}if(k[g.to]!==k[h||g.from]){if(k[g.to]){b(j,"rtl")}else{if(j.css("direction")==="rtl"){b(j,"ltr")}}}if(g.altAndVal&&(m==="IMG"||l==="image")){j.attr("alt",p)}else{if(m==="TEXTAREA"||g.altAndVal&&a[l]){j.val(p)}else{if(g.rebind){var f=j.find("*").not("script"),n=c("<div/>").html(p);c.translate.copyEvents(f,n.find("*"));j.html(n.contents())}else{j.html(p)}}}c.data(i,"lang",g.to)},setLangAttr:function(f,h,g){if(g.setLangAttr){f.attr(g.setLangAttr===true?"lang":g.setLangAttr,h)}},copyEvents:function(f,e){e.each(function(h){var l=f[h];if(!this||!l){return false}if(({SCRIPT:1,NOSCRIPT:1,STYLE:1,OBJECT:1,IFRAME:1})[l.nodeName.toUpperCase()]){return true}var g=c.data(l,"events");if(!g){return true}for(var k in g){for(var j in g[k]){c.event.add(this,k,g[k][j],g[k][j].data)}}})}});c.fn.translate=function(f,e,i){var g=c.translate._getOpt(f,e,i,true),h=c.extend({},c.translate._defaults,c.fn.translate.defaults,g,{complete:function(k,j){g.nodes=k;c.translate(j,g)},each:function(){}});if(this.nodesContainingText){return this.nodesContainingText(h)}g.nodes=this;c.translate(c.map(this,function(j){return c(j).html()||c(j).val()}),g);return this};c.fn.translate.defaults=c.extend({},c.translate._defaults)})(jQuery);(function(a){a.translate.ui=a.translate.fn.ui=function(f,d,i){var h="",g="",e="";if(i){g="<"+i+">";e="</"+i+">"}a.each(a.translate.getLanguages(true),function(b,c){h+=("<"+d+">"+g+b.charAt(0)+b.substring(1).toLowerCase()+e+"</"+d+">")});return a("<"+f+' class="jq-translate-ui">'+h+"</"+f+">")}})(jQuery);(function(a){a.translate.fn.progress=function(b,d){if(!this.i){this.pr=0}this.pr+=this.source[this.i].length;var c=100*this.pr/(this.rawSource.length-(11*(this.i+1)));if(b){var f=a(b);if(!this.i&&!f.hasClass("ui-progressbar")){f.progressbar(d)}f.progressbar("option","value",c)}return c}})(jQuery);(function(b){function a(){}a.prototype={init:function(e,d){this.textArray=[];this.elements=[];this.options=d;this.jquery=e;this.n=-1;if(d.async===true){d.async=2}if(d.not){e=e.not(d.not);e=e.add(e.find("*").not(d.not)).not(b(d.not).find("*"))}else{e=e.add(e.find("*"))}this.jq=e;this.jql=this.jq.length;return this.process()},process:function(){this.n++;var i=this,d=this.options,p="",h=false,g=false,f=this.jq[this.n],k,m,j;if(this.n==this.jql){j=this.jquery.pushStack(this.elements,"nodesContainingText");d.complete.call(j,j,this.textArray);if(d.returnAll===false&&d.walk===false){return this.jquery}return j}if(!f){return this.process()}k=b(f);var n=f.nodeName.toUpperCase(),l=n==="INPUT"&&b.attr(f,"type").toLowerCase();if(({SCRIPT:1,NOSCRIPT:1,STYLE:1,OBJECT:1,IFRAME:1})[n]){return this.process()}if(typeof d.subject==="string"){p=k.attr(d.subject)}else{if(d.altAndVal&&(n==="IMG"||l==="image")){p=k.attr("alt")}else{if(d.altAndVal&&({text:1,button:1,submit:1})[l]){p=k.val()}else{if(n==="TEXTAREA"){p=k.val()}else{m=f.firstChild;if(d.walk!==true){g=true}else{while(m){if(m.nodeType==1){g=true;break}m=m.nextSibling}}if(!g){p=k.text()}else{if(d.walk!==true){h=true}m=f.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){h=true;break}}else{h=true;break}}m=m.nextSibling}if(h){p=k.html().replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,"");this.jq=this.jq.not(k.find("*"))}}}}}}if(!p){return this.process()}this.elements.push(f);if(d.comments===false){p=this.stripComments(p)}this.textArray.push(p);d.each.call(f,this.elements.length-1,f,p);if(d.async){setTimeout(function(){i.process()},d.async);return this.jquery}else{return this.process()}},stripComments:function(d){return d.replace(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/g,"")}};b.fn.nodesContainingText=function(d){d=b.extend({},c,b.fn.nodesContainingText.defaults,d);return new a().init(this,d)};var c={not:"",async:false,each:function(){},complete:function(){},comments:false,returnAll:true,walk:true,altAndVal:false,subject:true};b.fn.nodesContainingText.defaults=c})(jQuery);
/* minified version of google-ajax-translation.js
2009-06-26
 */
function google_translate(d,c,e){var a=document.getElementById((("comment"==c)?"div-":"")+c+"-"+e),b;if(!a&&"comment"==c){a=document.getElementById("comment-"+e)}if(a){b="#translate_loading_"+c+"_"+e;if("he"==d){d="iw"}jQuery(a).translate(d,{fromOriginal:true,not:".translate_block",start:function(){jQuery(b).show()},complete:function(){jQuery(b).hide()},error:function(){jQuery(b).hide()}})}jQuery("#translate_popup_"+c+"_"+e).slideUp("fast")}function show_translate_popup(c,b,d){var a=document.getElementById("translate_popup_"+b+"_"+d);if(a){if("none"==a.style.display){jQuery(a).slideDown("fast");if("en"!=c&&(!jQuery(a).hasClass("localized"))){localize_languages(c,a)}}else{jQuery(a).slideUp("fast")}}}var llangs=[];function localize_languages(c,b){var d=jQuery("a[title]",b).get(),a;if(0==llangs.length){for(a in d){llangs[a]=d[a].title}if("he"==c){c="iw"}jQuery.translate(llangs,"en",c,{complete:function(){llangs=this.translation;insert_languagetitles(b,d)}})}else{insert_languagetitles(b,d)}}function insert_languagetitles(b,c){for(var a in c){if(c[a].title){c[a].title=llangs[a]}}jQuery(b).addClass("localized")}jQuery(function(){jQuery(".translate_block").show()});