function getDomain() { var lstr = location.hostname.split("."); var d=""; for(var i=1;i<=2&&lstr.length-i>=0;i++) d="."+lstr[lstr.length-i]+d; return(d);} function SetCookie(na, va, da, d, pa){ document.cookie = na + "=" + escape(va) + (da?";expires=" + da.toGMTString(da.getTime()):"") + ";Domain=" + (d?d:getDomain()) +";Path="+(pa?pa:"/");} function GetCookie(na) { fo=new RegExp(na+"=([^;]*)").exec(document.cookie); if(na=="sipublic") fo=new RegExp(na+"=([^!]*)").exec(document.cookie); if(fo) return unescape(fo[1]) return null; } function getRandom() { var raR = "R" + Math.random(); var ra = raR.substring(3,7); return(ra);} function getTimestamp() { var nw = new Date(); var y = "" + nw.getYear(); var m = 1 + nw.getUTCMonth(); var d = nw.getUTCDate(); var H = nw.getUTCHours(); var M = nw.getUTCMinutes(); var S = nw.getUTCSeconds(); m=(m>9?""+m:"0"+m);d=(d>9?""+d:"0"+d);H=(H>9?""+H:"0"+H);M=(M>9?""+M:"0"+M);S=(S>9?""+S:"0"+S);return(y + m + d + H + M + S);} function writit(id,text) { if (document.getElementById) { x = document.getElementById(id); x.innerHTML = ''; x.innerHTML = text;} else if (document.all) { x = document.all[id]; x.innerHTML = text; } } function PopIt(u,H,W){ var options='width=400,height=400,toolbar=0,directories=0,status=0,location=0, menubar=0, scrollbars=1, resizable=1'; if (H&&W) {options='toolbar=0,directories=0,status=0,location=0, menubar=0, scrollbars=0 resizable=1, width='+parseInt(W)+', height='+parseInt(H);} window.open(u,'',options); return false } function pops(u,fi,no){ if (fi==undefined) return PopIt(u,390,610); if ((fi == "tipoA") || (fi == "tipoB") || (fi == "tipoC") || (fi == "tipoF")){ window.open(u) } if (fi=="tipoD"){ window.open(u,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=470,width=770") } if (fi =="tipoE"){ window.open(u,"Servicaixa","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=390,width=610") } if (fi =="condi"){ window.open(u,no,"toolbar=yes,width=758,height=500,left=0,top=0,scrollbars=yes") } if (fi =="tipoG"){ remoto=window.open(u,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height=460,width=460"); if (remoto.opener == null) remoto.opener = window; remoto.opener.parent.name = "frameprin"; } } function MM_openBrWindow(u,n,f) {window.open(u,n,f);} function getparam(nom) { var params=(location.search.substring(1,location.search.length)).split('&'); for (var i=0 ; i0);i++) { var a=t.charAt(i); if ((a<='Z')&&(a>='A')) {o+=a; ml--;} } return o; } function parsea_url() { var as=document.getElementsByTagName('A'); for (var i=0; i'') { var talt=(as[i].getAttribute('title')); if (talt) { loce=loce+'-'+digestText(talt,15);} var link=(as[i].getAttribute('href')); if (link.indexOf('?')>0) link+='&loce='+loce; else link+='?loce='+loce; as[i].setAttribute('href',link); } } } function doSILO() { if (GetCookie('refSTC')) writit('header', '');} function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') {window.onload = func;} else { window.onload = function() { oldonload(); func();} } } addLoadEvent(doSILO);