switchStylestyle("start");switchStylestyleText("start");var timesout;$(document).ready(function(){cokSession();$("a.fRS").iframe();var url="https://"+DOMINIO_SERVIDOR+"/opac/"+$("#sessid").text()+"-00000";$("a[rel=external]").live("click",function(){window.open($(this).get(0).href);return false});$("a[rel=parent]").live("click",function(){window.opener.location.href=$(this).get(0).href;window.close()});$("form[title=external]").bind("submit",function(){$(this).get(0).target="_blank";return true});$("form[title=parent]").bind("submit",function(){var loc=$(this).attr("action")+"?";var cnt=0;$(this).children("fieldset").children("input").each(function(){if(cnt>0){loc+="&"}loc+=$(this).attr("name")+"="+$(this).val();cnt++});window.opener.location.href=loc;return false});$(".image-seta-cima, .image-seta-baixo").bind("click",function(e){if($(this).hasClass("image-seta-cima")){$(this).addClass("image-seta-baixo").removeClass("image-seta-cima");if($(this).parent("div").hasClass("bb")==true){$(this).parent("div").addClass("aa").removeClass("bb")}else{$(this).parent("div").addClass("aa").removeClass("bb")}if($.browser.msie==true){$(this).parent("div").next().css({display:"none"})}else{$(this).parent("div").next().slideUp(400)}}else{$(this).addClass("image-seta-cima").removeClass("image-seta-baixo");if($(this).parent("div").hasClass("aa")==true){$(this).parent("div").addClass("bb").removeClass("aa")}else{$(this).parent("div").addClass("bb").removeClass("aa")}if($.browser.msie==true){$(this).parent("div").next().css({display:"block"})}else{$(this).parent("div").next().slideDown(400)}}return false});if($.browser.msie==true){$("#nmu li").hover(function(){$(this).addClass("iehover")},function(){$(this).removeClass("iehover")})}function handler4(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){switchStylestyleText("less")}return(e.keyCode==9)?true:false}$("#bLd").bind("click",handler4).bind("keypress",handler4);function handler5(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){switchStylestyleText("more")}return(e.keyCode==9)?true:false}$("#bLa").bind("click",handler5).bind("keypress",handler5);function handler6(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){switchStylestyle("widthNormal")}return(e.keyCode==9)?true:false}$("#bEn, #bEn2").bind("click",handler6).bind("keypress",handler6);function handler62(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){switchStylestyle("widthExpanded")}return(e.keyCode==9)?true:false}$("#bAl, #bAl2").bind("click",handler62).bind("keypress",handler62);$("#bAc").bind("click keypress",function(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){var teste=window.location.href;teste=teste.replace(/https:\/\/infoeuropa\.eurocid\.pt/gi,"http://www.infoeuropa.eurocid.pt");open_window("http://www.acesso.umic.pt/webax/examinator.php?url="+url_encode_text(teste))}return(e.keyCode==9)?true:false});$("#bPr").bind("click keypress",function(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){window.print()}return(e.keyCode==9)?true:false});function handlerpermanentlinkreg(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){alert(LNG_RightClick)}return false}$(".permanentlinkreg").bind("click",handlerpermanentlinkreg).bind("keypress",handlerpermanentlinkreg);function handlermail(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){open_window($(".resmailquality").attr("href"))}return false}$(".resmailquality").bind("click",handlermail).bind("keypress",handlermail);$("#sort-select").bind("change",function(e){if($(this).val()!=""){window.location=$(this).val()}});$("a[class^='morelink']").each(function(){var a=$(this).get(0).className;var blockclass=a.replace(/link/g,"");var texttoput=$("."+a).text().replace(/LNG_Hide/gi,LNG_Show);var texttoput2=$("."+a).text().replace(/LNG_Show/gi,LNG_Hide);$("#"+blockclass).addClass("hd").removeClass("sh");$("."+a).text(texttoput);$("."+a).bind("click",function(e){if($("#"+blockclass).get(0).className=="hd"){$("#"+blockclass).addClass("sh").removeClass("hd");$(this).text(texttoput2)}else{$("#"+blockclass).addClass("hd").removeClass("sh");$(this).text(texttoput)}return false})});$("a[class^='moreopenlink']").each(function(){var a=$(this).get(0).className;var blockclass=a.replace(/link/g,"");var texttoput=$("."+a).text().replace(/Ocultar/gi,"Mostrar");var texttoput2=$("."+a).text().replace(/Mostrar/gi,"Ocultar");$("#"+blockclass).addClass("hd").removeClass("sh");$("."+a).text(texttoput);$("."+a).bind("click",function(e){if($("#"+blockclass).get(0).className=="hd"){$("#"+blockclass).addClass("sh").removeClass("hd");$(this).text(texttoput2)}else{$("#"+blockclass).addClass("hd").removeClass("sh");$(this).text(texttoput)}return false})});$("a[class^='morenewlink']").each(function(){var a=$(this).get(0).className;var blockclass=a.replace(/link/g,"");var texttoput=$("."+a).text().replace(/Ocultar/gi,"Mostrar");var texttoput2=$("."+a).text().replace(/Mostrar/gi,"Ocultar");$("."+a).bind("click",function(e){if($("#"+blockclass).get(0).className=="hd"){$("#"+blockclass).addClass("sh").removeClass("hd");$(this).text(texttoput2)}else{$("#"+blockclass).addClass("hd").removeClass("sh");$(this).text(texttoput)}return false})});$(".edit").bind("click",function(e){if($("#textoeditar").get(0).className=="hd"){var result=window.confirm("Ao voltar à página de visualização sem submeter as alterações, essas deixaram de ter efeito!\r\nTem a certeza que deseja voltar à página?");if(result==true){window.location.reload()}}else{var ht=$("#textoeditar").html();ht=ht.replace(/rel=(['"])(.*?)external(.*?)(['"])/gmi,'target="_blank"');ht=ht.replace(/rel="external"/gmi,'target="_blank"');ht=ht.replace(/<a id=(['"])(.*?)(['"])><\/a>/gmi,'<a name="$2"></a>');ht=ht.replace(/<!-- ESTADO INICIAL/gmi,"");ht=ht.replace(/ESTADO INICIAL -->/gmi,"");ht=ht.replace(/<!-- INICIO ESTADO FINAL([\s\S]+)FIM ESTADO FINAL -->/gmi,"");$("textarea.conteudo_editavel").tinymce().selection.setContent(ht);$("#textoeditar").addClass("hd").removeClass("sh");$("#textoeditar_edit").addClass("sh").removeClass("hd");$(".edit").text($(".edit").text().replace(/Editar/gi,"Visualizar"))}});$("form[id=formedit]").bind("submit",function(){var ed=tinyMCE.get("conteudo_editavel");ed.setProgressState(1);var senddata=ed.getContent();var func_val=$("#func").val();var vfunc=$("#func").val();var vfile_name=$("#file_name").val();var vfile_edit=$("#file_edit").val();$.post($(this).attr("action"),{func:vfunc,file_name:vfile_name,file_edit:vfile_edit,conteudo_editavel:senddata,edit:"true"},function(data){window.setTimeout(function(){ed.setProgressState(0);if(data!="true"){alert(data)}},2500)});return false});function handlerclose(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){window.close()}return(e.keyCode==9)?true:false}$("#bClose").bind("click",handlerclose).bind("keypress",handlerclose);function handlerprint(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){window.print()}return(e.keyCode==9)?true:false}$("#bPrint").bind("click",handlerprint).bind("keypress",handlerprint);function handlerhelp(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){open_window($(".linkhelp").attr("href"))}return(e.keyCode==9)?true:false}$(".linkhelp").live("click keypress",handlerhelp);function handlerhelpcat(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){open_window($(".linkhelpcat").attr("href"))}return(e.keyCode==9)?true:false}$(".linkhelpcat").live("click keypress",handlerhelpcat);function handlerpopup(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){open_window($(this).attr("href"))}return(e.keyCode==9)?true:false}$(".popup").live("click keypress",handlerpopup);function handlerback(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){history.go(-1)}return(e.keyCode==9)?true:false}$(".back").live("click keypress",handlerback);function handlerback2(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){history.go(-2)}return(e.keyCode==9)?true:false}$(".back2").live("click keypress",handlerback2);$(".print").each(function(){$(this).html('<a href="javascript:window.print();">'+$(this).html()+"</a>")});function handlerconverttoaction(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){var chooseaction=$(this).attr("id");$("#actx").attr({name:chooseaction+".x"});$("#acty").attr({name:chooseaction+".y"});$("#actx").attr({id:chooseaction+".x"});$("#acty").attr({id:chooseaction+".y"});$(this).parents("form").submit()}return(e.keyCode==9)?true:false}$(".converttoaction").bind("click",handlerconverttoaction).bind("keypress",handlerconverttoaction);function handlerprint(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){window.print()}return(e.keyCode==9)?true:false}$(".rsscontajax").each(function(){var obj=$(this);var ahref=$(this).find("a").attr("href");var estadoinicial=$(this).html();$(this).load(ahref+";ajax=Y",function(){$(this).find("a[rel=external]").bind("click",function(){window.open($(this).get(0).href);return false});$(this).find("a[rel=topframe]").bind("click",function(){parent.location.href=$(this).get(0).href;return false});$(this).prepend("\n<!-- ESTADO INICIAL\n"+estadoinicial+"\nESTADO INICIAL -->\n<!-- INICIO ESTADO FINAL -->\n");$(this).append("\n<!-- FIM ESTADO FINAL -->\n")})});function handler_xhtml11checkboxes(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){var objcheckbox=$(this).get(0);if($("h1").text()==LNG_SearchResults){if(objcheckbox.checked){var loc=url+"?func=short-select-single&"+objcheckbox.id+"=on"}else{var loc=url+"?func=short-deselect-one&"+objcheckbox.id+"=off"}}else{if(objcheckbox.checked){var loc=url+"?func=myshelf-select-1&"+objcheckbox.id.replace(/ckbox/,"")+"=on"}else{var loc=url+"?func=myshelf-select-1&"+objcheckbox.id.replace(/ckbox/,"")+"=off"}}var imd=new Image();imd.src=loc}}$("input[name=ckbox]").bind("click",handler_xhtml11checkboxes).bind("keypress",handler_xhtml11checkboxes);$("form[id=my_replace]").bind("submit",function(){var re=/\r\n/g;var par=$("#BIB___591__a_2800").val();var new_text=par.replace(re," ");$("#BIB___591__a_2800").val(new_text);return true});$("form[id=my_replace_1]").bind("submit",function(){var re=/\%23/g;$(":input").each(function(){var par=$(this).val();var new_text=par.replace(re,"#");$(this).val(new_text)});var re2=/\r\n/g;var par2=$(":input[id=text]").val();var new_text2=par2.replace(re2," ");$(":input[id=text]").val(new_text2);return true});$("#folder").bind("change",function(e){var loc=url+"?func=myshelf-short&folder="+this[this.selectedIndex].value;window.location.href=loc});$("#selfolder").bind("change",function(e){var loc=url+"?func=myshelf-folder-left&folder="+this[this.selectedIndex].value;window.location.href=loc});$("a[class^='confirm_']").each(function(){var a=$(this).attr("class");var blockclass=a.replace(/confirm_/g,"");var theurl=$(this).attr("href");$("."+a).bind("click",function(e){var blockclass=$(this).attr("class").replace(/confirm_/g,"");open_window_confirm($(this).attr("href"),blockclass);return false})});function handler_renewselected(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){var loc=$("form[id=form]").attr("action")+"?func="+$(".renewfunc").val()+"&renew_selected="+$("input[name=renew_selected]").val()+"&adm_library="+$("input[name=adm_library]").val();$("input[name^='c0']:checked").each(function(){loc+="&"+$(this).attr("id")+"=Y"});window.location.href=loc}return(e.keyCode==9)?true:false}$(".renewselected").bind("click",handler_renewselected).bind("keypress",handler_renewselected);$("#P_TIPO_PER").bind("change",function(e){if(this[this.selectedIndex].value==1){$("#P_TIPO_PER1").addClass("sh").removeClass("hd");$("#P_TIPO_PER2").addClass("hd").removeClass("sh")}else{if(this[this.selectedIndex].value==2){$("#P_TIPO_PER1").addClass("hd").removeClass("sh");$("#P_TIPO_PER2").addClass("sh").removeClass("hd")}}});$("#P_ANO").bind("change",function(e){if(this[this.selectedIndex].value!=""){$("#P_TIPO_PER1_DIV").addClass("sh").removeClass("hd")}else{$("#P_TIPO_PER1_DIV").addClass("hd").removeClass("sh")}});$("#statsgerais").bind("submit",function(){if($("#P_ESTATISTICA").val()!=""){return true}else{alert("Necessita de escolher a estatística");return false}});function handlerclickimg(e){if((e.keyCode==13&&e.type=="keypress")||e.type=="click"){var imgid=$(this).attr("id");if(imgid=="chimg1"){$("#chimg1").addClass("hd").removeClass("sh");$("#chimg2").addClass("sh").removeClass("hd")}else{if(imgid=="chimg2"){$("#chimg2").addClass("hd").removeClass("sh");$("#chimg1").addClass("sh").removeClass("hd")}}}return(e.keyCode==9)?true:false}$(".chimg").bind("click",handlerclickimg).bind("keypress",handlerclickimg);$(".discovery").each(function(){var obj=$(this);var ahref=$(this).find(".discolink").attr("href");var estadoinicial=$(this).html();$(this).load(ahref,"",function(responseText,textStatus,XMLHttpRequest){if(textStatus=="error"){$(this).html("<p>Ocorreu um erro no pedido AJAX.</p><p>"+ahref+"</p>")}else{if(jQuery.trim(responseText)==""){$(this).addClass("hd");$(this).html(estadoinicial)}else{$(this).find("a[rel=external]").bind("click",function(){window.open($(this).get(0).href);return false});$(this).find("a[rel=topframe]").bind("click",function(){parent.location.href=$(this).get(0).href;return false});$(this).removeClass("tactr");$(this).removeClass("discoverypad")}}})});$(".filteritem").each(function(){var ahref=$(this).find(".filterlink").attr("href");var obja=$(this).find(".filterlink");$(this).load(ahref,"",function(responseText,textStatus,XMLHttpRequest){if(textStatus=="error"){$(this).html("<p>Ocorreu um erro no pedido AJAX.</p><p>"+ahref+"</p>")}else{if(jQuery.trim(responseText)==""){$(this).addClass("hd")}else{$(this).find("a[rel=external]").bind("click",function(){window.open($(this).get(0).href);return false});$(this).find("a[rel=topframe]").bind("click",function(){parent.location.href=$(this).get(0).href;return false});$(this).removeClass("tactr")}}})});$("h1").each(function(){forms_predefined_value(LNG,"ALL","fPe");if($(this).html()==LNG[lang]["Basic search"]["page_title"]||$(this).html()==LNG[lang]["No result search"]["page_title"]){forms_predefined_value(LNG,"Basic search","form1");forms_predefined_value(LNG,"No result search","form1")}else{if($(this).html()==LNG[lang]["Multifield search"]["page_title"]){forms_predefined_value(LNG,"Multifield search","form1")}else{if($(this).html()==LNG[lang]["Advanced search"]["page_title"]){forms_predefined_value(LNG,"Advanced search","form1")}else{if($(this).html().replace(/ABBR/,"abbr").replace(/ABBR/,"abbr")==LNG[lang]["CCL Search"]["page_title"]){forms_predefined_value(LNG,"CCL Search","form1")}else{if($(this).html()==LNG[lang]["Multibase search"]["page_title"]){forms_predefined_value(LNG,"Multibase search","form1")}else{if($(this).html()==LNG[lang]["Search index"]["page_title"]||$(this).html()==LNG[lang]["Results in index"]["page_title"]){forms_predefined_value(LNG,"Search index","form1");forms_predefined_value(LNG,"Results in index","form1")}else{if($(this).html()==LNG[lang]["Feedback"]["page_title"]){forms_predefined_value(LNG,"Feedback","form1")}else{if($(this).html()==LNG[lang]["Login"]["page_title"]){forms_predefined_value(LNG,"Login","form1")}else{if($(this).html()==LNG[lang]["Register"]["page_title"]){forms_predefined_value(LNG,"Register","form1")}else{if($(this).html()==LNG[lang]["Update Borrower Addresses"]["page_title"]){forms_predefined_value(LNG,"Update Borrower Addresses","form1")}else{if($(this).html()==LNG[lang]["Update Password"]["page_title"]){forms_predefined_value(LNG,"Update Password","form1")}else{if($(this).html()==LNG[lang]["Service Quality"]["page_title"]){forms_predefined_value(LNG,"Service Quality","form1")}else{if($(this).html()==LNG[lang]["Hold Request"]["page_title"]){forms_predefined_value(LNG,"Hold Request","form1")}else{if($(this).html()==LNG[lang]["European integration archive"]["page_title"]){forms_predefined_value(LNG,"European integration archive","formCCLSpecial")}else{if($(this).html()==LNG[lang]["Pedagogical content"]["page_title"]){forms_predefined_value(LNG,"Pedagogical content","formCCLSpecial")}else{if($(this).html()==LNG[lang]["Bibliographic"]["page_title"]){forms_predefined_value(LNG,"Bibliographic","formCCLSpecial")}else{if($(this).html()==LNG[lang]["Financial support"]["page_title"]){forms_predefined_value(LNG,"Financial support","formCCLSpecial")}else{if($(this).html()==LNG[lang]["Opportunity"]["page_title"]){forms_predefined_value(LNG,"Opportunity","formCCLSpecial");$("#emprego_div").removeClass("hd").hide();$("#estagio_div").removeClass("hd").hide();if($("#partccl2").val()=="TDOC=emprego"){$("#emprego_div").show()}else{$("#emprego_div").hide()}if($("#partccl2").val()=="(TDOC=estagio OR TDOC=bolsa)"){$("#estagio_div").show()}else{$("#estagio_div").hide()}$("#partccl2").bind("change",function(e){$("#partccl_emprego_21").val("");$("#partccl_emprego_22").val("");$("#partccl_estagio_21").val("");$("#partccl_estagio_22").val("");if($("#partccl2").val()=="TDOC=emprego"){$("#emprego_div").show()}else{$("#emprego_div").hide()}if($("#partccl2").val()=="(TDOC=estagio OR TDOC=bolsa)"){$("#estagio_div").show()}else{$("#estagio_div").hide()}})}}}}}}}}}}}}}}}}}}});$("#statsgerais").reset();if($("#form_hold_loan").length>0){var date_from1=$("#from").val().replace(/^([0-9]{4})([0-9]{2})([0-9]{2})$/,"$1-$2-$3");var date_to1=$("#to").val().replace(/^([0-9]{4})([0-9]{2})([0-9]{2})$/,"$1-$2-$3");$("#from").val(date_from1);$("#to").val(date_to1);criacampodata("from");criacampodata("to");$("#form_hold_loan").bind("submit",function(e){var date_from2=$("#from").val().replace(/-/g,"");var date_to2=$("#to").val().replace(/-/g,"");$("#from").val(date_from2);$("#to").val(date_to2);return true})}$("#sCat").bind("change",function(e){if($("#sCat").val()=="FPC"){$("#fCat").children("div").children("input[name=func]").val("file");$("#fCat").children("div").children("input[name=file_name]").val("cat-apoiosfinanceiros")}else{if($("#sCat").val()=="PEDAG"){$("#fCat").children("div").children("input[name=func]").val("file");$("#fCat").children("div").children("input[name=file_name]").val("cat-conteudospedagogicos")}else{if($("#sCat").val()=="OPORTUNIDADES"){$("#fCat").children("div").children("input[name=func]").val("file");$("#fCat").children("div").children("input[name=file_name]").val("cat-oportunidades")}else{if($("#sCat").val()=="XCIE01"){$("#fCat").children("div").children("input[name=func]").val("file");$("#fCat").children("div").children("input[name=file_name]").val("cat-bibliografico")}else{if($("#sCat").val()=="ARQUIVOMNE"){$("#fCat").children("div").children("input[name=func]").val("file");$("#fCat").children("div").children("input[name=file_name]").val("cat-arquivointegracaoeuropeia")}}}}}$("#fCat").submit()});$("h2[class=show]").before('<span class="art showhideblock">[<a class="showhideblock" rel="visible" href="#">Ocultar</a>]</span>');$("h2[class=hide]").before('<span class="art showhideblock">[<a class="showhideblock" rel="hided" href="#">Mostrar</a>]</span>');$("h2[class=hide]").each(function(){$(this).next().nextUntil(".showhideblock").hide()});$("a[class=showhideblock]").bind("click",function(e){if($(this).attr("rel")=="hided"){var texttoput=$(this).text().replace(/Mostrar/gi,"Ocultar");$(this).parent().next().next().nextUntil(".showhideblock").show();$(this).text(texttoput);$(this).attr("rel","visible")}else{var texttoput=$(this).text().replace(/Ocultar/gi,"Mostrar");$(this).parent().next().next().nextUntil(".showhideblock").hide();$(this).text(texttoput);$(this).attr("rel","hided")}return false});var session_restart_time=3*60*1000;$("#atc2 li.first").each(function(){if($(this).text().match(/\(staff\)$/i)){window.setInterval(function(){$.ajax({url:"/opac/"+$("#sessid").text()+"-00000?func=file&file_name=session",error:function(){},success:function(data){}})},session_restart_time)}})});$(document).ready(function(){var defaultLang="pt-PT";var userLang=(navigator.language)?navigator.language:navigator.userLanguage;var translateNow;if($.cookie("lingua")!="null"){$("#tl option[value='"+defaultLang+"']").attr("selected",false);$("#tl option[value='"+$.cookie("lingua")+"']").attr("selected",true)}else{$("#tl option[value="+defaultLang+"]").attr("selected",true)}if(!$.cookie("lingua")){$("#tl option[value="+defaultLang+"]").attr("selected",true)}$.translate(function(){function translateNow(lng){$("#tl option[value=' ']").html("A traduzir...");$("p, td, li, .s3").each(function(){if($(this).html()=="&nbsp;"){$(this).html('<img src="/xtra/template/ima/spacer.gif" alt="temp"/>')}});if(lng!=defaultLang){$.cookie("lingua",lng,cookieoptions)}else{$.cookie("lingua",null,cookieoptions)}$("html").translate(defaultLang,lng,{not:"#shortbase, #namebase, .mopen, div#sCt, span#sessid, div.resButtons",altAndVal:false,stripWhitespace:false,walk:true,toggle:true,rebind:true,stripComments:false,fromOriginal:true,start:function(){},complete:function(translation){$("#tl option[value=' ']").html("(escolha)");$("#tl option[value="+lng+"]").attr("selected",true);$("p, td, li, .s3").each(function(){if($(this).html()=='<img src="/xtra/template/ima/spacer.gif" alt="temp">'){$(this).html("&nbsp;")}})}})}$("#tl").change(function(){if($(this).val()!=" "){translateNow($(this).val())}});if($.cookie("lingua")){if($.cookie("lingua")!="null"){translateNow($.cookie("lingua"))}}})});
