function publicaSWF(ficheiroSWF,versao,largura,altura,flashVars){document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+versao+'" width="'+largura+'" height="'+altura+'"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /><param name="movie" value="'+ficheiroSWF+'" /><param name="quality" value="high" /><param name="wmode" value="transparent"><param name="FlashVars" value="'+flashVars+'"><embed src="'+ficheiroSWF+'" quality="high" width="'+largura+'" height="'+altura+'" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" flashvars="'+flashVars+'" /></object>');}
function publicaMOV(ficheiroMOV,largura,altura,autoplay,controles){document.write('<object width="'+largura+'" height="'+altura+'" classID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" value="'+ficheiroMOV+'"><param name="autoplay" value="'+autoplay+'"><param name="controller" value="'+controles+'"><embed width="'+largura+'" height="'+altura+'" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" src="'+ficheiroMOV+'" autoplay="'+autoplay+'" controller="'+controles+'"></embed></object>');}
function mapaGoogle(container,x,y,zoom,texto){if(GBrowserIsCompatible()){var m=new GMap2(document.getElementById(container));m.setCenter(new GLatLng(x,y),zoom);m.openInfoWindowHtml(m.getCenter(),texto);m.setMapType(G_SATELLITE_MAP);var c=new GMapTypeControl();m.addControl(c);m.addControl(new GLargeMapControl());}}
function seleccionarCheckBox(nomeCheckBox,campoContador){if(document.getElementById(nomeCheckBox).value==1){document.getElementById(nomeCheckBox).value=0;eval("document.img"+nomeCheckBox).src="images/iconeCheckI.gif";eval("document.img"+nomeCheckBox).alt="Activar";if(campoContador!=""){document.getElementById(campoContador).value--;}}
else{document.getElementById(nomeCheckBox).value=1;eval("document.img"+nomeCheckBox).src="images/iconeCheckA.gif";eval("document.img"+nomeCheckBox).alt="Desactivar";if(campoContador!=""){document.getElementById(campoContador).value++;}}}
function adicionaCheck(nomeCampo,campoContador){if(document.getElementById(nomeCampo).value==0){document.getElementById(campoContador).value--;}
else{document.getElementById(campoContador).value++;}}
function seleccionarCombo(nomeForm,nomeCombo,valorId,valorElemento){eval("document."+nomeForm+".id"+nomeCombo).value=valorId;eval("document."+nomeForm+"."+nomeCombo).value=valorElemento;mostraLayer(eval("'lCombo"+nomeCombo+"'"));}
function moverLista(nomeForm,regInicial,totRegistos){nomeForm.axn.value=5;nomeForm.registoInicial.value=regInicial;nomeForm.totalRegistos.value=totRegistos;nomeForm.submit();}
function navegarLista(nomeForm,nomeCampo,valorCampo){nomeCampo.value=valorCampo;nomeForm.axn.value=1;nomeForm.submit();}
function imagemOn(nomeImagem){document.images[nomeImagem].src=eval(nomeImagem+"On.src");}
function imagemOff(nomeImagem){document.images[nomeImagem].src=eval(nomeImagem+"Off.src");}
function carregaImagem(nomeImagem,novaImagem){document.images[nomeImagem].src=eval(novaImagem+".src");}
function navegaMenu(nivel0,nivel1){document.frmMenuNavegacao.nivel0.value=nivel0;document.frmMenuNavegacao.nivel1.value=nivel1;document.frmMenuNavegacao.submit();}
function activaClasse(elemento,classe){document.getElementById(elemento).className=classe;}
function mostraLayer(nomeLayer){if(document.getElementById(nomeLayer).style.visibility=='visible'){document.getElementById(nomeLayer).style.visibility='hidden';}
else{document.getElementById(nomeLayer).style.visibility='visible';}}
function obterRadio(objRadio){if(!objRadio)
return"";var dimensaoRadio=objRadio.length;if(dimensaoRadio==undefined)
if(objRadio.checked)
return objRadio.value;else
return"";for(var i=0;i<dimensaoRadio;i++){if(objRadio[i].checked){return objRadio[i].value;}}
return"";}
function estaPreenchido(campo){if(campo.value==""||campo.value==null){return false;}
return true;}
function eEspaco(campo){if((campo.value==null)||(campo.value=='&nbsp;')){return true;}
for(var i=0;i<campo.value.length;i++){if((campo.value.charAt(i)!=' ')&&(campo.value.charAt(i)!="\t")&&(campo.value.charAt(i)!="\n")&&(campo.value.charAt(i)!="\r")){return false;}}
return true;}
function eNumerico(campo){if(campo.value==""||campo.value==null){return false;}
for(var i=0;i<campo.value.length;i++){if(campo.value.charAt(i)<"0"||campo.value.charAt(i)>"9"){return false;}}
return true;}
function eMonetario(campo){var posVirgula=0;if(campo.value==""||campo.value==null){return false;}
if(campo.value.indexOf(",")!="-1"){posVirgula=campo.value.indexOf(",");}
else{return false;}
for(var i=0;i<campo.value.length;i++){if(i!=posVirgula){if(campo.value.charAt(i)<"0"||campo.value.charAt(i)>"9"){return false;}}}
return true;}
function eAlfabetico(campo){if(campo.value==""||campo.value==null){return false;}
for(var i=0;i<campo.value.length;i++){if((campo.value.charAt(i)<"a"||campo.value.charAt(i)>"z")||(campo.value.charAt(i)<"A"||campo.value.charAt(i)>"Z")){return false;}}
return true;}
function eData(campo){if(campo.value==""||campo.value==null){return false;}
if(campo.value.length==10){if(campo.value.charAt(2)!="-"){return false;}
if(campo.value.charAt(5)!="-"){return false;}}
else{return false;}
var dia=campo.value.substr(0,2);var mes=campo.value.substr(3,2);var ano=campo.value.substr(6,4);if(dia<1||dia>31){return false;}
if(mes<1||mes>12){return false;}
if(ano<2000||ano>2050){return false;}
return true;}
function eEMail(campo){if(campo.value==""||campo.value==null){return false;}
if(campo.value.indexOf("@")!="-1"&&campo.value.indexOf(".")!="-1"){return true;}
else{return false;}}
function eEnter(e){var Cod;if(window.event)
Cod=window.event.keyCode;else if(e)
Cod=e.which;if(Cod==13)
return true;else
return false;}