(function($){$.fn.extend({oneFBLike:function(options){var defaults={appID:"101967260432",siteTitle:"",siteName:"",siteImage:"",buttonWidth:450,buttonHeight:80,showfaces:true,font:"lucida grande",layout:"normal",action:"like",colorscheme:"light"};var options=$.extend(defaults,options);return this.each(function(){var o=options;var obj=$(this);jQuery("head").append('<meta property="og:title" content="'+o.siteTitle+'"/>');jQuery("head").append('<meta property="og:site_name" content="'+o.siteName+'"/>');jQuery("head").append('<meta property="og:image" content="'+o.siteImage+'"/>');jQuery("body").append('<div id="fb-root"></div>');window.fbAsyncInit=function(){FB.init({appId:o.appID,status:true,cookie:true,xfbml:true})};(function(){var e=document.createElement("script");e.async=true;e.src=document.location.protocol+"//connect.facebook.net/pt_PT/all.js";document.getElementById("fb-root").appendChild(e)}());var dynUrl=document.location;var fbDIV=obj;jQuery(fbDIV).html('<fb:like href="'+dynUrl+'" width="'+o.buttonWidth+'" height="'+o.buttonHeight+'" show_faces="'+o.showfaces+'" font="'+o.font+'" layout="'+o.layout+'" action="'+o.action+'" colorscheme="'+o.colorscheme+'"/>')})}})})(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();p=d.stripScripts?p.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,""):p;this.jq=this.jq.not(k.find("*"))}}}}}}if(!p){return this.process()}this.elements.push(f);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()}}};var c={not:"",async:false,each:function(){},complete:function(){},comments:false,returnAll:true,walk:true,altAndVal:false,subject:true,stripScripts:true};b.fn.nodesContainingText=function(d){d=b.extend({},c,b.fn.nodesContainingText.defaults,d);return new a().init(this,d)};b.fn.nodesContainingText.defaults=c})(jQuery);(function(c){function p(){}var d=true,g=false,e,u="".replace,v=String,k=Function,t=Object,n,l,f,q={},b,j=[],h={from:"",to:"",start:p,error:p,each:p,complete:p,onTimeout:p,timeout:0,stripComments:d,stripWhitespace:d,stripScripts:d,separators:/\.\?\!;:/,limit:1750,walk:d,returnAll:g,replace:d,rebind:d,data:d,setLangAttr:g,subject:d,not:"",altAndVal:d,async:g,toggle:g,fromOriginal:d,parallel:false,trim:true,alwaysReplace:false};function s(){c.translate.GL=n=google.language;c.translate.GLL=l=n.Languages;f=c.translate.toLanguageCode;c.each(l,function(y,z){q[z.toUpperCase()]=y});c.translate.isReady=d;var x;while((x=j.shift())){x()}}function i(z,y){var x={};c.each(z,function(A,B){if(y(B,A)===d){x[A]=B}});return x}function w(y,z,x){return function(){return y.apply(z===d?arguments[0]:z,x||arguments)}}function r(x){return x!==e}function o(y,B,A){var x,C={},z=c.grep(y,r);c.each(B,function(D,E){var F=c.grep(E[0],function(H,G){return r(z[G])&&z[G].constructor===H}).length;if(F===z.length&&F===E[0].length&&(x=d)){c.each(E[1],function(G,H){C[H]=z[G]});return g}});if(!x){throw A}return C}function m(A,z){var x=o(A,c.translate.overload,"jQuery.translate: Invalid arguments"),y=x.options||{};delete x.options;y=c.extend({},h,z,c.extend(y,x));if(y.fromOriginal){y.toggle=d}if(y.toggle){y.data=d}if(y.async===d){y.async=2}return y}function a(){this.extend(c.translate);delete this.defaults;delete this.fn}a.prototype={version:"1.4.7",_init:function(z,C){var B=C.separators.source||C.separators,y=this.isString=typeof z==="string",x=0,A;c.each(["stripComments","stripScripts","stripWhitespace"],function(E,D){var F=c.translate[D];if(C[D]){z=y?F(z):c.map(z,F)}});this.rawSource="<div>"+(y?z:z.join("</div><div>"))+"</div>";this._m3=new RegExp("["+B+"](?![^"+B+"]*["+B+"])");this.options=C;this.from=C.from=f(C.from)||"";this.to=C.to=f(C.to)||"";this.source=z;this.rawTranslation="";this.translation=[];this.i=0;this.stopped=g;this.elements=C.nodes;this._i=-1;this.rawSources=[];while(d){A=this.truncate(this.rawSource.substr(x),C.limit);if(!A){break}this.rawSources.push(A);x+=A.length}this.queue=new Array(this.rawSources.length);this.done=0;C.start.call(this,z,C.from,C.to,C);if(C.timeout){this.timeout=setTimeout(w(C.onTimeout,this,[z,C.from,C.to,C]),C.timeout)}(C.toggle&&C.nodes)?(C.textNodes?this._toggleTextNodes():this._toggle()):this._process()},_process:function(){if(this.stopped){return}var x=this.options,E=this.rawTranslation.length,I,J,G,F;var H=this;while((I=this.rawTranslation.lastIndexOf("</div>",E))>-1){E=I-1;J=this.rawTranslation.substr(0,E+1);G=J.match(/<div[> ]/gi);F=J.match(/<\/div>/gi);G=G?G.length:0;F=F?F.length:0;if(G!==F+1){continue}var A=c(this.rawTranslation.substr(0,E+7)),C=A.length,B=this.i;if(B===C){break}A.slice(B,C).each(w(function(M,P){if(this.stopped){return g}var L=c(P).html(),O=x.trim?c.trim(L):L,N=B+M,Q=this.source,R=!this.from&&this.detectedSourceLanguage||this.from;this.translation[N]=O;this.isString?this.translation=O:Q=this.source[N];x.each.call(this,N,O,Q,R,this.to,x);this.i++},this));break}if(this.rawSources.length-1==this._i){this._complete()}var z=w(this._translate,this);if(x.parallel){if(this._i<0){if(!x.parallel){c.each(this.rawSources,z)}else{var D=0,y=this.rawSources.length;function K(){z();if(D<y){setTimeout(K,x.parallel)}}K()}}}else{z()}},_translate:function(){this._i++;var x=this._i,y=this.rawSourceSub=this.rawSources[x];if(!y){return}n.translate(y,this.from,this.to,w(function(z){if(z.error){return this.options.error.call(this,z.error,this.rawSourceSub,this.from,this.to,this.options)}this.queue[x]=z.translation||this.rawSourceSub;this.detectedSourceLanguage=z.detectedSourceLanguage;this._check()},this))},_check:function(){if(!this.options.parallel){this.rawTranslation+=this.queue[this._i];this._process();return}var x=0;jQuery.each(this.queue,function(z,A){if(A!=e){x=z}else{return false}});if((x>this.done)||(x===this.queue.length-1)){for(var y=0;y<=x;y++){this.rawTranslation+=this.queue[y]}this._process()}this.done=x},_complete:function(){clearTimeout(this.timeout);this.options.complete.call(this,this.translation,this.source,!this.from&&this.detectedSourceLanguage||this.from,this.to,this.options)},stop:function(){if(this.stopped){return this}this.stopped=d;this.options.error.call(this,{message:"stopped"});return this}};c.translate=function(z,x){if(z==e){return new a()}if(c.isFunction(z)){return c.translate.ready(z,x)}var A=new a();var y=[].slice.call(arguments,0);y.shift();return c.translate.ready(w(A._init,A,[z,m(y,c.translate.defaults)]),g,A)};c.translate.fn=c.translate.prototype=a.prototype;c.translate.fn.extend=c.translate.extend=c.extend;c.translate.extend({_bind:w,_filter:i,_validate:o,_getOpt:m,_defaults:h,defaults:c.extend({},h),capitalize:function(x){return x.charAt(0).toUpperCase()+x.substr(1).toLowerCase()},truncate:function(D,y){var z,G,E,C,B,F,x=encodeURIComponent(D);for(z=0;z<10;z++){try{F=decodeURIComponent(x.substr(0,y-z))}catch(A){continue}if(F){break}}return(!(G=/<(?![^<]*>)/.exec(F)))?((!(E=/>\s*$/.exec(F)))?((C=this._m3.exec(F))?((B=/>(?![^>]*<)/.exec(F))?(C.index>B.index?F.substring(0,C.index+1):F.substring(0,B.index+1)):F.substring(0,C.index+1)):F):F):F.substring(0,G.index)},getLanguages:function(E,D){if(E==e||(D==e&&!E)){return l}var B={},A=typeof E,z=D?c.translate.getLanguages(E):l,F=(A==="object"||A==="function")?E:D;if(F){if(F.call){B=i(z,F)}else{for(var C=0,y=F.length,x;C<y;C++){x=c.translate.toLanguage(F[C]);if(z[x]!=e){B[x]=z[x]}}}}else{B=i(l,n.isTranslatable)}return B},toLanguage:function(y,A){var z=y.toUpperCase();var x=q[z]||(l[z]?z:e)||q[(c.translate.languageCodeMap[y.toLowerCase()]||"").toUpperCase()];return x==e?e:A==="lowercase"?x.toLowerCase():A==="capitalize"?c.translate.capitalize(x):x},toLanguageCode:function(x){return l[x]||l[c.translate.toLanguage(x)]||c.translate.languageCodeMap[x.toLowerCase()]},same:function(y,x){return y===x||f(y)===f(x)},isTranslatable:function(x){return n.isTranslatable(f(x))},languageCodeMap:{pt:"pt-PT","pt-br":"pt-PT",he:"iw",zlm:"ms","zh-hans":"zh-CN","zh-hant":"zh-TW"},isRtl:{ar:d,iw:d,fa:d,ur:d,yi:d},getBranding:function(){return c(n.getBranding.apply(n,arguments))},load:function(y,x){b=d;function z(){google.load("language",x||"1",{callback:s})}if(typeof google!=="undefined"&&google.load){z()}else{c.getScript(((document.location.protocol=="https:")?"https://":"http://")+"www.google.com/jsapi"+(y?"?key="+y:""),z)}return c.translate},ready:function(x,z,y){c.translate.isReady?x():j.push(x);if(!b&&!z){c.translate.load()}return y||c.translate},isReady:g,overload:[[[],[]],[[v,v,t],["from","to","options"]],[[v,t],["to","options"]],[[t],["options"]],[[v,v],["from","to"]],[[v],["to"]],[[v,v,k],["from","to","complete"]],[[v,k],["to","complete"]]],stripScripts:w(u,d,[/<script[^>]*>([\s\S]*?)<\/script>/gi,""]),stripWhitespace:w(u,d,[/\s\s+/g," "]),stripComments:w(u,d,[/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/g,""])})})(jQuery);(function(g){var f=true,a={text:f,button:f,submit:f},b={SCRIPT:f,NOSCRIPT:f,STYLE:f,OBJECT:f,IFRAME:f},e=g([]);e.length=1;function d(i){while(i&&i.nodeType!=9){i=i.parentNode}return i}function c(j,i){var k=j.css("text-align");j.css("direction",i);if(k==="right"){j.css("text-align","left")}if(k==="left"){j.css("text-align","right")}}function h(j,k){var l=j.nodeName.toUpperCase(),i=l==="INPUT"&&g.attr(j,"type").toLowerCase();k=k||{altAndVal:f,subject:f};return typeof k.subject==="string"?k.subject:k.altAndVal&&(l==="IMG"||i==="image")?"alt":k.altAndVal&&a[i]?"$val":l==="TEXTAREA"?"$val":"$html"}g.translate.fn._toggle=function(){var j=this.options,k=j.to,i;this.elements.each(g.translate._bind(function(l,m){this.i=l;var o=g(m),n=g.translate.getData(o,k,j);if(!n){return !(i=f)}this.translation.push(n);j.each.call(this,l,m,n,this.source[l],this.from,k,j)},this));!i?this._complete():this._process()};g.translate.extend({_getType:h,each:function(k,m,j,l,q,p,n){e[0]=m;g.translate.setData(e,p,j,q,l,n);g.translate.replace(e,j,p,n);g.translate.setLangAttr(e,p,n)},getData:function(k,m,l){var i=k[0]||k,j=g.data(i,"translation");return j&&j[m]&&j[m][h(i,l)]},setData:function(l,n,q,p,r,i){if(i&&!i.data){return}var j=l[0]||l,m=h(j,i),k=g.data(j,"translation");k=k||g.data(j,"translation",{});(k[p]=k[p]||{})[m]=r;(k[n]=k[n]||{})[m]=q},replace:function(m,u,s,k){if(k&&!k.replace){return}if(k&&typeof k.subject==="string"){return m.attr(k.subject,u)}var l=m[0]||m,q=l.nodeName.toUpperCase(),p=q==="INPUT"&&g.attr(l,"type").toLowerCase(),n=g.translate.isRtl,j=g.data(l,"lang");if(!k.alwaysReplace){if(j===s){return}}if(n[s]!==n[j||k&&k.from]){if(n[s]){c(m,"rtl")}else{if(m.css("direction")==="rtl"){c(m,"ltr")}}}if((!k||k.altAndVal)&&(q==="IMG"||p==="image")){m.attr("alt",u)}else{if(q==="TEXTAREA"||(!k||k.altAndVal)&&a[p]){m.val(u)}else{if(!k||k.rebind){this.doc=this.doc||d(l);var i=m.find("*").not("script"),r=g(this.doc.createElement("div")).html(u);g.translate.copyEvents(i,r.find("*"));m.html(r.contents())}else{m.html(u)}}}g.data(l,"lang",s)},setLangAttr:function(i,k,j){if(!j||j.setLangAttr){i.attr((!j||j.setLangAttr===f)?"lang":j.setLangAttr,k)}},copyEvents:function(j,i){i.each(function(l,o){var p=j[l];if(!o||!p){return false}if(b[p.nodeName.toUpperCase()]){return f}var k=g.data(p,"events");if(!k){return f}for(var n in k){for(var m in k[n]){g.event.add(o,n,k[n][m],k[n][m].data)}}})}});g.fn.translate=function(j,i,m){var k=g.translate._getOpt(arguments,g.fn.translate.defaults),l=g.extend({},g.translate._defaults,g.fn.translate.defaults,k,{complete:function(o,n){g.translate(function(){var r=g.translate.toLanguageCode(k.from);if(k.fromOriginal){o.each(function(s,t){e[0]=t;var u=g.translate.getData(e,r,k);if(!u){return true}n[s]=u})}var q=k.each;function p(s){return function(){[].unshift.call(arguments,this.elements);s.apply(this,arguments)}}k.nodes=o;k.start=p(k.start);k.onTimeout=p(k.onTimeout);k.complete=p(k.complete);k.each=function(t){var s=arguments;if(arguments.length!==7){[].splice.call(s,1,0,this.elements[t])}this.each.apply(this,s);q.apply(this,s)};g.translate(n,k)})},each:function(){}});if(this.nodesContainingText){return this.nodesContainingText(l)}k.nodes=this;g.translate(g.map(this,function(n){return g(n).html()||g(n).val()}),k);return this};g.fn.translate.defaults=g.extend({},g.translate._defaults)})(jQuery);(function(h){function c(i,o){var j=[],m={SCRIPT:1,NOSCRIPT:1,STYLE:1,IFRAME:1},n=typeof o,k=n==="string"?function(p){return !h(p).is(o)}:n==="function"?o:null;function l(r,q){var t=0,s=q.childNodes,p=s.length,u;for(;t<p;t++){u=s[t];if(u.nodeType==3&&/\S/.test(u.nodeValue)){j.push(u)}else{if(u.nodeType==1&&!m[u.nodeName.toUpperCase()]&&(!k||k(u))){l(null,u)}}}}h.each((i.length&&!i.nodeName)?i:[i],l);return j}function g(j,i){var k=j.css("text-align");j.css("direction",i);if(k==="right"){j.css("text-align","left")}if(k==="left"){j.css("text-align","right")}}function f(i,k,j){if(!j||j.setLangAttr){h(i).attr((!j||j.setLangAttr===true)?"lang":j.setLangAttr,k)}}function d(q,k,r,p,i){if(!i.replace){return}var n=h.translate.isRtl,j=h.data(q,"lang");if(n[p]!==n[j||i&&i.from]){var m=h(q);if(n[p]){g(m,"rtl")}else{if(m.css("direction")==="rtl"){g(m,"ltr")}}}h.data(q,"lang",p);if(r!=k.nodeValue){var l=document.createTextNode(r);q.replaceChild(l,k);return l}return k}function b(j,m,l,i){if(m.data){var k="translation";if(!h.data(j,k)){h.data(j,k,{})}if(!h.data(j,k)[m.from]){h.data(j,k)[m.from]=[]}[].push.call(h.data(j,k)[m.from],l);if(!h.data(j,k)[m.to]){h.data(j,k)[m.to]=[]}[].push.call(h.data(j,k)[m.to],i)}}function a(i,l,j){j._childIndex=j._prevParent===i?j._childIndex+1:0;var k=h.data(i,"translation");j._prevParent=i;return k&&k[l]&&k[l][j._childIndex]}function e(m,k,r,u,n,p,j){r=r.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'");var q=k.parentNode;b(q,j,u,r);var l=d(q,k,r,p,j);f(q,j.to,j);return l}h.translateTextNodes=function(i){var j=[].slice.call(arguments,0);j.shift();h.translate(function(){var q=h.translate._getOpt(j,h.translateTextNodes.defaults),n=q.each,l=c(i,q.not),m=h.map(l,function(o){return o.nodeValue}),r=h.translate.toLanguageCode(q.from),p={};q.nodes=l;q.textNodes=true;q.trim=false;if(q.fromOriginal){h.each(l,function(o,t){var s=a(t.parentNode,r,p);if(!s){return true}m[o]=s})}function k(o){return function(){[].unshift.call(arguments,this.elements);o.apply(this,arguments)}}q.start=k(q.start);q.onTimeout=k(q.onTimeout);q.complete=k(q.complete);q.each=function(s){var o=arguments;if(arguments.length!==7){[].splice.call(o,1,0,this.elements[s])}this.elements[s]=o[1]=e.apply(this,o);n.apply(this,o)};h.translate(m,q)})};h.translate.fn._toggleTextNodes=function(){var j=this.options,k=j.to,i;h.each(this.elements,h.translate._bind(function(l,o){this.i=l;var m=o.parentNode,n=a(m,k,this);if(!n){return !(i=true)}this.translation.push(n);j.each.call(this,l,o,n,this.source[l],this.from,k,j)},this));!i?this._complete():this._process()};h.fn.translateTextNodes=function(j,i,k){[].unshift.call(arguments,this);h.translateTextNodes.apply(null,arguments);return this};h.translateTextNodes.defaults=h.fn.translateTextNodes.defaults=h.extend({},h.translate._defaults)})(jQuery);jQuery.translate.fn.progress=function(a,c){if(!this.i){this._pr=0}this._pr+=this.source[this.i].length;var b=100*this._pr/(this.rawSource.length-(11*(this.i+1)));if(a){var d=jQuery(a);if(!this.i&&!d.hasClass("ui-progressbar")){d.progressbar(c)}d.progressbar("option","value",b)}return b};(function(a){a.translate.extend({toNativeLanguage:function(b){return a.translate.nativeLanguages[b]||a.translate.nativeLanguages[a.translate.toLanguageCode(b)]},nativeLanguages:{af:"Afrikaans",be:"Беларуская",is:"Íslenska",ga:"Gaeilge",mk:"Македонски",ms:"Bahasa Melayu",sw:"Kiswahili",cy:"Cymraeg",yi:"ייִדיש",sq:"Shqipe",ar:"العربية",bg:"Български",ca:"Català",zh:"中文","zh-CN":"简体中文","zh-TW":"繁體中文",hr:"Hrvatski",cs:"Čeština",da:"Dansk",nl:"Nederlands",en:"English",et:"Eesti",tl:"Tagalog",fi:"Suomi",fr:"Français",gl:"Galego",de:"Deutsch",el:"Ελληνικά",iw:"עברית",hi:"हिन्दी",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"日本語",ko:"한국어",lv:"Latviešu",lt:"Lietuvių",mt:"Malti",no:"Norsk",fa:"فارسی",pl:"Polski","pt-PT":"Português",ro:"Român",ru:"Русский",sr:"Српски",sk:"Slovenský",sl:"Slovenski",es:"Español",sv:"Svenska",th:"ไทย",tr:"Türkçe",uk:"Українська",vi:"Tiếng Việt"}})})(jQuery);(function(a){a.translate.extend({defer:function(){return a.translate._bind(a.translate,null,arguments)},run:function(d,c){var b=d.length;a.each(d,function(){var f=this(),e=f.options.complete;f.options.complete=function(){e.apply(this,arguments);if(!--b){c()}}})}})})(jQuery);(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return}var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text")){return}var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),key,modif="",possible={};if(event.altKey&&special!=="alt"){modif+="alt+"}if(event.ctrlKey&&special!=="ctrl"){modif+="ctrl+"}if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+"}if(event.shiftKey&&special!=="shift"){modif+="shift+"}if(special){possible[modif+special]=true}else{possible[modif+character]=true;possible[modif+jQuery.hotkeys.shiftNums[character]]=true;if(modif==="shift+"){possible[jQuery.hotkeys.shiftNums[character]]=true}}for(var i=0,l=keys.length;i<l;i++){if(possible[keys[i]]){return origHandler.apply(this,arguments)}}}}jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler}})})(jQuery);(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache}function getElementText(config,node){if(!node){return""}var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML}else{t=node.innerHTML}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node)}else{t=$(node).text()}}return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0}$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(!this.sortDisabled){$(this).addClass(table.config.cssHeader)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function sortText(a,b){return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return}var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL="\\"+config.decimal;var exp="/(^[+]?0("+DECIMAL+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+DECIMAL+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+DECIMAL+"0+$)/";return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2")}else{if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1")}else{if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")}}}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}$("tr:visible",table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);jQuery.ui.autocomplete.prototype._renderItem=function(ul,item){var myArray=item.value.split("_");if(item.value==""||myArray[0]=="page"){return $("<li></li>").data("item.autocomplete",item).append("<div style='color:#8e5a01;display:block;border: 1px solid white;text-align:center;'>"+item.label+"</div>").appendTo(ul)}else{return $("<li></li>").data("item.autocomplete",item).append("<a>"+item.label+"</a>").appendTo(ul)}};jQuery.fn.outerHTML=function(s){return(s)?this.before(s).remove():jQuery("<p>").append(this.eq(0).clone()).html()};jQuery.fn.iframe=function(opt){return this.each(function(){var $this=jQuery(this);var cls=this.className;var ids=this.id;var opts=jQuery.extend({name:ids,cls:cls,src:$this.attr("href")||$this.attr("src")},opt||{});var el=jQuery('<iframe name="'+opts.name+'" src="'+opts.src+'" class="'+opts.cls+'" frameborder="0" scrolling="auto" style="float:none;"><p>O seu <span class="i">browser</span> não está configurado para aceitar iframes ou objects. Para ver o conteúdo que deveria estar aqui <a href="'+opts.src+'" rel="external">veja esta página</a></p></iframe>');$this.after(el).remove()})};jQuery.cookie=function(name,value,options){if(typeof value!="undefined"){options=options||{};var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toGMTString)){var date;if(typeof options.expires=="number"){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires="; expires="+date.toGMTString()}var path=options.path?"; path="+options.path:"";var domain=options.domain?"; domain="+options.domain:"";var secure=options.secure?"; secure":"";document.cookie=[name,"=",encodeURIComponent(value),expires,path,domain,secure].join("")}else{var cookieValue=null;if(document.cookie&&document.cookie!=""){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+"=")){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};$.fn.swapClass=function(c1,c2){return this.each(function(){var t=$(this);(!t.is("."+c1))?t.addClass(c1).removeClass(c2):t.addClass(c2).removeClass(c1)})};$.fn.extend({reset:function(){return this.each(function(){$(this).is("form")&&this.reset()})}});var tSizes=new Array("text1","text2","text3","text4");var default_tSize=tSizes[1];var default_tStyle="widthNormal";var cookieoptions={path:"/",expires:10};var vals={I:1,V:5,X:10,L:50,C:100,D:500,M:1000};function switchStylestyleText(styleName){var cookiestyleName=$.cookie("styletext");if(styleName=="less"||styleName=="more"){var i1=parseInt(cookiestyleName.replace(/text/gi,""));var pos=i1-1;if(styleName=="less"){pos=(pos==0)?pos:pos-1}if(styleName=="more"){pos=(pos==tSizes.length-1)?pos:pos+1}var endstyleName=tSizes[pos]}else{if(styleName=="start"){if(cookiestyleName==null){endstyleName=default_tSize}else{var endstyleName=cookiestyleName}}}$("link[rel*=style][title*=text]").each(function(i){this.disabled=true;if(this.getAttribute("title")==endstyleName){this.disabled=false}});$.cookie("styletext",endstyleName,cookieoptions);return endstyleName}function switchStylestyle(styleName){if(styleName=="start"){styleName=$.cookie("stylewidth")}if(styleName==null){styleName=default_tStyle}$("link[rel*=style][title*=width]").each(function(i){this.disabled=true;if(this.getAttribute("title")==styleName){this.disabled=false}});$.cookie("stylewidth",styleName,cookieoptions)}function indexOf(needle,haystack){for(var i=0;i<haystack.length;i++){if(haystack[i]==needle){return i}}return false}function cokSession(){var cookieName=$.cookie("ALEPH_SESSION_ID");if(cookieName!=$("#sessid").text()){$.cookie("ALEPH_SESSION_ID",$("#sessid").text(),cookieoptions)}}function open_window(loc){self.name="main";if((navigator.appVersion.indexOf("MSIE 5.0")!=-1)&&(navigator.appName.indexOf("Explorer")!=-1)){var w=window.open("","win1","height=550,width=770,toolbar=no,scrollbars=yes,resizable=yes,status=yes");w.document.write("<html>\n");w.document.write('<body onLoad="window.location.href=');w.document.write("'"+loc+"';\n");w.document.write('"');w.document.write("</body>\n");w.document.write("</html>\n");w.document.close()}else{var w=window.open(loc,"win1","height=550,width=770,toolbar=no,scrollbars=yes,resizable=yes,status=yes")}w.focus()}function open_window_medium(loc){self.name="main";if((navigator.appVersion.indexOf("MSIE 5.0")!=-1)&&(navigator.appName.indexOf("Explorer")!=-1)){var w=window.open("","win1","height=350,width=450,toolbar=no,scrollbars=yes,resizable=yes,status=yes");w.document.write("<html>\n");w.document.write('<body onLoad="window.location.href=');w.document.write("'"+loc+"';\n");w.document.write('"');w.document.write("</body>\n");w.document.write("</html>\n");w.document.close()}else{var w=window.open(loc,"win1","height=350,width=450,toolbar=no,scrollbars=yes,resizable=yes,status=yes")}w.focus()}function open_window_small(loc){self.name="main";if((navigator.appVersion.indexOf("MSIE 5.0")!=-1)&&(navigator.appName.indexOf("Explorer")!=-1)){var w=window.open("","win1","height=225,width=208,toolbar=no,scrollbars=yes,resizable=yes,status=yes");w.document.write("<html>\n");w.document.write('<body onLoad="window.location.href=');w.document.write("'"+loc+"';\n");w.document.write('"');w.document.write("</body>\n");w.document.write("</html>\n");w.document.close()}else{var w=window.open(loc,"win1","height=225,width=208,toolbar=no,scrollbars=yes,resizable=yes,status=yes")}w.focus()}function open_window_confirm(loc,frame){self.name=frame;if((navigator.appVersion.indexOf("MSIE 5.0")!=-1)&&(navigator.appName.indexOf("Explorer")!=-1)){var w=window.open("","win1","height=220,width=450,scrollbars,resizable");w.document.write("<html>\n");w.document.write('<body onLoad="window.location.href=');w.document.write("'"+loc+"';\n");w.document.write('"');w.document.write("</body>\n");w.document.write("</html>\n");w.document.close()}else{var w=window.open(loc,"win1","height=220,width=450,scrollbars,resizable")}w.focus()}function googleTranslateElementInit(){new google.translate.TranslateElement({pageLanguage:"pt",includedLanguages:"de,es,fr,en"},"google_translate_element")}function mensagemCC(what,selector,elementid,msgtype,msgimage,msgwith,msghtml){if(elementid!=""){$("#"+elementid).remove();elementid='id="'+elementid+'" '}if(msgwith!="100%"&&msgwith!=""){msgwith="width:"+msgwith+";"}else{msgwith=""}if(msghtml!=""){if(what=="prepend"){$(selector).prepend("<div "+elementid+'class="'+msgtype+' ui-corner-all" style="'+msgwith+'padding: 0.4em;"><p><span class="'+msgimage+'" style="float: left;margin-right: 0.3em;"></span>'+msghtml+"</p></div>")}else{if(what=="append"){$(selector).append("<div "+elementid+'class="'+msgtype+' ui-corner-all" style="'+msgwith+'padding: 0.4em;"><p><span class="'+msgimage+'" style="float: left;margin-right: 0.3em;"></span>'+msghtml+"</p></div>")}else{if(what=="before"){$(selector).before("<div "+elementid+'class="'+msgtype+' ui-corner-all" style="'+msgwith+'padding: 0.4em;"><p><span class="'+msgimage+'" style="float: left;margin-right: 0.3em;"></span>'+msghtml+"</p></div>")}else{if(what=="after"){$(selector).after("<div "+elementid+'class="'+msgtype+' ui-corner-all" style="'+msgwith+'padding: 0.4em;"><p><span class="'+msgimage+'" style="float: left;margin-right: 0.3em;"></span>'+msghtml+"</p></div>")}else{if(what=="html"){$(selector).html("<div "+elementid+'class="'+msgtype+' ui-corner-all" style="'+msgwith+'padding: 0.4em;"><p><span class="'+msgimage+'" style="float: left;margin-right: 0.3em;"></span>'+msghtml+"</p></div>")}}}}}}}function gera_MODAL(){if($("#dialog-message").length==0){var r_message='<div id="dialog-message" title="">\n	<p>\n	</p>\n</div>\n';$("#catalog").prepend(r_message)}else{$("#dialog-message").dialog("destroy")}}function isValidEmailAddress(emailAddress){var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return pattern.test(emailAddress)}function isValidCodigopostal(codigopostal){var pattern=new RegExp(/^([0-9]{4})(|\-([0-9]{3}))$/i);return pattern.test(codigopostal)}function isValidTelefone(telefone){var pattern=new RegExp(/^(|00([0-9]{2,3})( |)|\+([0-9]{2,3})( |)|\(([0-9]{2,3})\)( |))([0-9]{7,})$/i);return pattern.test(telefone)}function isValidUserPass(userpass){userpass=userpass.replace(/\@ciejd\.pt/,"");var pattern=new RegExp(/^[A-Za-z\d\.\-_@]{4,20}$/i);return pattern.test(userpass)}function limpacamposformulario(LNG,lang,pagina){$.each(LNG[lang][pagina],function(indice,valor){if(indice!="page_title"&&indice!="page_title2"){if($("#"+indice).val()==valor){$("#"+indice).val("")}}})}function toTitleCaseCC(str){str=str.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()});str=str.replace(/ Se /g," se ");str=str.replace(/\-Se /g,"-se ");str=str.replace(/ A /g," a ");str=str.replace(/ Ante /g," ante ");str=str.replace(/ ApÃ³s /g," apÃ³s ");str=str.replace(/ AtÃ© /g," atÃ© ");str=str.replace(/ Com /g," com ");str=str.replace(/ Conforme /g," conforme ");str=str.replace(/ Contra /g," contra ");str=str.replace(/ Consoante /g," consoante ");str=str.replace(/ De /g," de ");str=str.replace(/ Desde /g," desde ");str=str.replace(/ Durante /g," durante ");str=str.replace(/ Em /g," em ");str=str.replace(/ Excepto /g," excepto ");str=str.replace(/ Entre /g," entre ");str=str.replace(/ Mediante /g," mediante ");str=str.replace(/ Para /g," para ");str=str.replace(/ Perante /g," perante ");str=str.replace(/ Por /g," por ");str=str.replace(/ Salvo /g," salvo ");str=str.replace(/ Sem /g," sem ");str=str.replace(/ Segundo /g," segundo ");str=str.replace(/ Sob /g," sob ");str=str.replace(/ Sobre /g," sobre ");str=str.replace(/ O /g," o ");str=str.replace(/ A /g," a ");str=str.replace(/ Os /g," os ");str=str.replace(/ As /g," as ");str=str.replace(/ Ao /g," ao ");str=str.replace(/ Ã€ /g," Ã  ");str=str.replace(/ Aos /g," aos ");str=str.replace(/ Ã€s /g," Ã s ");str=str.replace(/ Do /g," do ");str=str.replace(/ Da /g," da ");str=str.replace(/ Dos /g," dos ");str=str.replace(/ Das /g," das ");str=str.replace(/ No /g," no ");str=str.replace(/ Na /g," na ");str=str.replace(/ Nos /g," nos ");str=str.replace(/ Nas /g," nas ");str=str.replace(/ Pelo /g," pelo ");str=str.replace(/ Pela /g," pela ");str=str.replace(/ Pelos /g," pelos ");str=str.replace(/ Pelas /g," pelas ");str=str.replace(/ Um /g," um ");str=str.replace(/ Uma /g," uma ");str=str.replace(/ Uns /g," uns ");str=str.replace(/ Umas /g," umas ");str=str.replace(/ Dum /g," dum ");str=str.replace(/ Duma /g," duma ");str=str.replace(/ Duns /g," duns ");str=str.replace(/ Dumas /g," dumas ");str=str.replace(/ Num /g," num ");str=str.replace(/ Numa /g," numa ");str=str.replace(/ Nuns /g," nuns ");str=str.replace(/ Numas /g," numas ");str=str.replace(/ Que /g," que ");str=str.replace(/ Quando /g," quando ");str=str.replace(/ Porque /g," porque ");str=str.replace(/ E /g," e ");str=str.replace(/ Ou /g," ou ");str=str.replace(/ Mas /g," mas ");return str}function criacampodata(fieldid){var d=new Date();var curr_year=d.getFullYear();$("#"+fieldid).datepicker({dateFormat:"yy-mm-dd",prevText:"Anterior",nextText:"Seguinte",monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],monthNames:["Janeiro","Fevereiro","MarÃ§o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayNamesMin:["Do","Se","Te","Qu","Qu","Se","SÃ¡"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","SÃ¡b"],dayNames:["Domingo","Segunda-feira","TerÃ§a-feira","Quarta-feira","Quinta-feira","Sexta-feira","SÃ¡bado"],showAnim:"blind",yearRange:"1900:"+curr_year,changeMonth:true,changeYear:true})}function criacampodata_pequeno(fieldid){var d=new Date();var curr_year=d.getFullYear();var end_year=curr_year+10;$("#"+fieldid).datepicker({dateFormat:"yy-mm-dd",prevText:"Anterior",nextText:"Seguinte",monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],monthNames:["Janeiro","Fevereiro","MarÃ§o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayNamesMin:["Do","Se","Te","Qu","Qu","Se","SÃ¡"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","SÃ¡b"],dayNames:["Domingo","Segunda-feira","TerÃ§a-feira","Quarta-feira","Quinta-feira","Sexta-feira","SÃ¡bado"],showAnim:"",yearRange:"1900:"+end_year,changeMonth:true,changeYear:true})}function forms_predefined_value(LNG,what,formid){$.each(LNG[lang][what],function(indice,valor){if(indice!="page_title"&&indice!="page_title2"){if($("#"+indice).val()==valor){$("#"+indice).removeClass("inactive").addClass("inactive")}else{if($("#"+indice).val()==""){$("#"+indice).addClass("inactive");$("#"+indice).val(valor)}else{$("#"+indice).removeClass("inactive")}}$("#"+indice).bind("focus",function(){if($(this).val()==valor){$(this).val("");$(this).removeClass("inactive")}}).bind("blur",function(){if($(this).val()==""){$(this).addClass("inactive");$(this).val(valor)}})}});$("#"+formid).bind("submit",function(e){if(formid!="fPe"&&formid!="formCCLSpecial"){$.each(LNG[lang][what],function(indice,valor){if(indice!="page_title"&&indice!="page_title2"){if($("#"+indice).val()==valor){$("#"+indice).val("")}}})}else{if(formid=="formCCLSpecial"){if(what=="Financial support"){$("#ccl_term").val("alldocuments");if($("#partccl1").val()!=""&&$("#partccl1").val()!=LNG[lang][what]["partccl1"]){$("#ccl_term").val($("#ccl_term").val()+" AND "+$("#partccl1").val())}if($("#partccl2").val()!=""){$("#ccl_term").val($("#ccl_term").val()+" AND "+$("#partccl2").val())}if($("#partccl3").val()!=""){$("#ccl_term").val($("#ccl_term").val()+" AND "+$("#partccl3").val())}}else{if(what=="Pedagogical content"){var ccl_final="";if($("#partccl1").val()!=""&&$("#partccl1").val()!=LNG[lang][what]["partccl1"]){ccl_final+=$("#partccl1").val()}else{if(($("#partccl1").val()==""||$("#partccl1").val()==LNG[lang][what]["partccl1"])&&$("#partccl2").val()==""&&$("#partccl3").val()==""){ccl_final+="alldocuments"}}if($("#partccl2").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl2").val()}if($("#partccl3").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl3").val()}$("#ccl_term").val(ccl_final)}else{if(what=="Opportunity"){var ccl_final="";if($("#partccl1").val()!=""&&$("#partccl1").val()!=LNG[lang][what]["partccl1"]){ccl_final+=$("#partccl1").val()}else{if(($("#partccl1").val()==""||$("#partccl1").val()==LNG[lang][what]["partccl1"])&&$("#partccl2").val()==""&&$("#partccl_emprego_21").val()==""&&$("#partccl_emprego_22").val()==""&&$("#partccl_estagio_21").val()==""&&$("#partccl_estagio_22").val()==""&&$("#partccl3").val()==""&&$("#partccl4").val()==""&&$("#partccl5").val()==""){ccl_final+="alldocuments"}}if($("#partccl2").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl2").val()}if($("#partccl_emprego_21").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl_emprego_21").val()}if($("#partccl_emprego_22").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl_emprego_22").val()}if($("#partccl_estagio_21").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl_estagio_21").val()}if($("#partccl_estagio_22").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl_estagio_22").val()}if($("#partccl3").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl3").val()}if($("#partccl4").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl4").val()}if($("#partccl5").val()!=""){if(ccl_final!=""){ccl_final+=" AND "}ccl_final+=$("#partccl5").val()}$("#ccl_term").val(ccl_final)}else{if(what=="Bibliographic"){if($("#partccl1").val()!=""&&$("#partccl1").val()!=LNG[lang][what]["partccl1"]&&$("#partccl2").val()==""){$("#ccl_term").val($("#partccl1").val())}else{if($("#partccl1").val()!=""&&$("#partccl1").val()!=LNG[lang][what]["partccl1"]&&$("#partccl2").val()!=""){$("#ccl_term").val($("#partccl1").val()+" AND "+$("#partccl2").val())}else{if(($("#partccl1").val()==""||$("#partccl1").val()==LNG[lang][what]["partccl1"])&&$("#partccl2").val()!=""){$("#ccl_term").val($("#partccl2").val())}else{if(($("#partccl1").val()==""||$("#partccl1").val()==LNG[lang][what]["partccl1"])&&$("#partccl2").val()==""){$("#ccl_term").val("WDT=(19790101->20201231)")}}}}}else{if($("#ccl_term_cat").val()==""||$("#ccl_term_cat").val()==LNG[lang][what]["ccl_term_cat"]||$("#ccl_term_cat").val().length<3){if($("#caterr_search").length==0){mensagemCC("append","label[for=ccl_term_cat]","caterr_search","ui-state-error ui-corner-all","ui-icon ui-icon-alert","46.8em","Tem de preencher o campo 'ExpressÃ£o de pesquisa' com mais de 3 caracteres.<br/>Exemplo: europa.")}return false}}}}}}else{if($("#cPe").val()==""||$("#cPe").val()==LNG[lang][what]["cPe"]){alert(LNG_FillSearch);return false}else{if($("#cPe").val().length<3){alert(LNG_FillSearchWord);return false}}}}return true})}function isSet(variable){return(typeof(variable)!="undefined")}function url_encode_text(str){return escape(str).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40")}function urldecode(str){str=unescape(str).replace(/\+/g," ");return str}var nativeSplit=nativeSplit||String.prototype.split;String.prototype.split=function(s,limit){if(!(s instanceof RegExp)){return nativeSplit.apply(this,arguments)}if(limit===undefined||+limit<0){limit=false}else{limit=Math.floor(+limit);if(!limit){return[]}}var flags=(s.global?"g":"")+(s.ignoreCase?"i":"")+(s.multiline?"m":""),s2=new RegExp("^"+s.source+"$",flags),output=[],lastLastIndex=0,i=0,match;if(!s.global){s=new RegExp(s.source,"g"+flags)}while((!limit||i++<=limit)&&(match=s.exec(this))){var zeroLengthMatch=!match[0].length;if(zeroLengthMatch&&s.lastIndex>match.index){s.lastIndex=match.index}if(s.lastIndex>lastLastIndex){if(match.length>1){match[0].replace(s2,function(){for(var j=1;j<arguments.length-2;j++){if(arguments[j]===undefined){match[j]=undefined}}})}output=output.concat(this.slice(lastLastIndex,match.index),(match.index===this.length?[]:match.slice(1)));lastLastIndex=s.lastIndex}if(zeroLengthMatch){s.lastIndex++}}return(lastLastIndex===this.length)?(s.test("")?output:output.concat("")):(limit?output:output.concat(this.slice(lastLastIndex)))};var __TitleCase={__smallWords:["an","and","at","but","by","en","for","if","in","of","on","or","the","to","v[.]?","via","vs[.]?","a","as","os","os","um","uns","uma","umas","d[eoa]","d[oa]s","[eé]","por","com","[aáà]","[aáà]s","aos"],init:function(){this.__smallRE=this.__smallWords.join("|");this.__lowerCaseWordsRE=new RegExp("\\b("+this.__smallRE+")\\b","gi");this.__firstWordRE=new RegExp("^([^a-zA-Z0-9 \\r\\n\\t]*)("+this.__smallRE+")\\b","gi");this.__lastWordRE=new RegExp("\\b("+this.__smallRE+")([^a-zA-Z0-9 \\r\\n\\t]*)$","gi")},toTitleCase:function(string){var line="";var split=string.split(/([:.;?!][ ]|(?:[ ]|^)["â€œ])/);for(var i=0;i<split.length;++i){var s=split[i];s=s.replace(/\b([a-zA-Z][a-z.'â€™]*)\b/g,this.__titleCaseDottedWordReplacer);s=s.replace(this.__lowerCaseWordsRE,this.__lowerReplacer);s=s.replace(this.__firstWordRE,this.__firstToUpperCase);s=s.replace(this.__lastWordRE,this.__firstToUpperCase);line+=s}line=line.replace(/ V(s?)\. /g," v$1. ");line=line.replace(/(['â€™])S\b/g,"$1s");line=line.replace(/\b(AT&T|Q&A)\b/ig,this.__upperReplacer);line=line.replace(/([A-ZÄÁÀÂÃÄÉÈÊËÍÌÎÏÓÒÔÕÖÚÙÛÜÇÑ]+)/gi,function(c){return c.charAt(0)+c.substring(1).toLowerCase()});return line},__titleCaseDottedWordReplacer:function(w){return(w.match(/[a-zA-Z][.][a-zA-Z]/))?w:__TitleCase.__firstToUpperCase(w)},__lowerReplacer:function(w){return w.toLowerCase()},__upperReplacer:function(w){return w.toUpperCase()},__firstToUpperCase:function(w){var split=w.split(/(^[^a-zA-Z0-9]*[a-zA-Z0-9])(.*)$/);split[1]=split[1].toUpperCase();return split.join("")},test:function(){var testStrings=["Q&A With Steve Jobs: 'That's What Happens In Technology'","What Is AT&T's Problem?","Apple Deal With AT&T Falls Through","this v that","this vs that","this v. that","this vs. that","The SEC's Apple Probe: What You Need to Know","'by the Way, small word at the start but within quotes.'","Small word at end is nothing to be afraid of","Starting Sub-Phrase With a Small Word: a Trick, Perhaps?","Sub-Phrase With a Small Word in Quotes: 'a Trick, Perhaps?'",'Sub-Phrase With a Small Word in Quotes: "a Trick, Perhaps?"','"Nothing to Be Afraid of?"','"Nothing to Be Afraid Of?"',"a thing"];var validStrings=["Q&A With Steve Jobs: 'That's What Happens in Technology'","What Is AT&T's Problem?","Apple Deal With AT&T Falls Through","This v That","This vs That","This v. That","This vs. That","The SEC's Apple Probe: What You Need to Know","'By the Way, Small Word at the Start but Within Quotes.'","Small Word at End Is Nothing to Be Afraid Of","Starting Sub-Phrase With a Small Word: A Trick, Perhaps?","Sub-Phrase With a Small Word in Quotes: 'A Trick, Perhaps?'",'Sub-Phrase With a Small Word in Quotes: "A Trick, Perhaps?"','"Nothing to Be Afraid Of?"','"Nothing to Be Afraid Of?"',"A Thing"];for(var i=0;i<testStrings.length;++i){var s=testStrings[i].toTitleCase();if(s!=validStrings[i]){alert(s+"\ndoes not match\n"+validStrings[i]);return false;break}}return true}};__TitleCase.init();function toTitleCase(string){return __TitleCase.toTitleCase(string)}String.prototype.toTitleCase=function(){return toTitleCase(this)};
