function showDetalhes(A){if((document.getElementById(A).style.display=="none")||(document.getElementById(A).style.display=="")){document.getElementById(A).style.display="block";document.getElementById(A*100).style.backgroundImage="url(images/apolices/icon_menos.gif)";document.getElementById(A*10).style.display="none"}else{document.getElementById(A).style.display="none";document.getElementById(A*10).style.display="inline";document.getElementById(A*100).style.backgroundImage="url(images/apolices/icon_mais.gif)"}}function toggleDiv(A){if((document.getElementById(A).style.display=="none")||(document.getElementById(A).style.display=="")){document.getElementById(A).style.display="block"}else{document.getElementById(A).style.display="none"}}function showQuemSomos(A){for(i=1;i<6;i++){if(i==A){document.getElementById(i).style.display="block";document.getElementById(i*10).style.fontWeight="bold"}else{document.getElementById(i).style.display="none";document.getElementById(i*10).style.fontWeight="normal"}}}function showTabela(){document.getElementById("tabelaP").style.display="block";document.getElementById("paraVer").style.display="none"}function hideTabela(){document.getElementById("paraVer").style.display="block";document.getElementById("tabelaP").style.display="none"}function mostraAmigo(){document.getElementById("labelAmigo").className="active";document.getElementById("labelAmigo").innerHTML='<a onclick="javascript: mostraAmigo();" title="Enviar a um amigo"><img src="images/simulacao/icon_enviar.gif" width="12" height="17" alt="Enviar a amigo" /></a><a onclick="javascript: mostraAmigo();" title="Enviar a um amigo">Enviar a amigo</a><span>&nbsp;</span>';document.getElementById("formAmigo").style.display="block";document.getElementById("labelContacto").className="inactive";document.getElementById("formContacto").style.display="none";document.getElementById("labelContacto").innerHTML='<a onclick="javascript: mostraContacto();" title="Contactem-me"><img src="images/simulacao/icon_contacto.gif" width="14" height="17" alt="Contactem-me" /></a><a  onclick="javascript: mostraContacto();" title="Contactem-me">Contactem-me &raquo;</a><span>&nbsp;</span>';document.getElementById("opcoes").style.borderBottom="none"}function mostraContacto(){document.getElementById("labelAmigo").className="inactive";document.getElementById("formAmigo").style.display="none";document.getElementById("labelAmigo").innerHTML='<a onclick="javascript: mostraAmigo();" title="Enviar a um amigo"><img src="images/simulacao/icon_enviar.gif" width="12" height="17" alt="Enviar a amigo" /></a><a onclick="javascript: mostraAmigo();" title="Enviar a um amigo">Enviar a amigo &raquo;</a><span>&nbsp;</span>';document.getElementById("labelContacto").className="active";document.getElementById("labelContacto").innerHTML='<a onclick="javascript: mostraContacto();" title="Contactem-me"><img src="images/simulacao/icon_contacto.gif" width="14" height="17" alt="Contactem-me" /></a><a  onclick="javascript: mostraContacto();" title="Contactem-me">Contactem-me</a><span>&nbsp;</span>';document.getElementById("formContacto").style.display="block";document.getElementById("opcoes").style.borderBottom="none"}function mostraAmigoHab(){document.getElementById("labelAmigo").className="active";document.getElementById("labelAmigo").innerHTML='<a onclick="javascript: mostraAmigo();" title="Enviar a um amigo"><img src="images/habitacao/icon_enviar.gif" width="12" height="17" alt="Enviar a amigo" /></a><a onclick="javascript: mostraAmigoHab();" title="Enviar a um amigo">Enviar a amigo</a><span>&nbsp;</span>';document.getElementById("formAmigo").style.display="block";document.getElementById("labelContacto").className="inactive";document.getElementById("formContacto").style.display="none";document.getElementById("labelContacto").innerHTML='<a onclick="javascript: mostraContacto();" title="Contactem-me"><img src="images/habitacao/icon_contacto.gif" width="14" height="17" alt="Contactem-me" /></a><a  onclick="javascript: mostraContactoHab();" title="Contactem-me">Contactem-me &raquo;</a><span>&nbsp;</span>';document.getElementById("opcoes").style.borderBottom="none"}function mostraContactoHab(){document.getElementById("labelAmigo").className="inactive";document.getElementById("formAmigo").style.display="none";document.getElementById("labelAmigo").innerHTML='<a onclick="javascript: mostraAmigo();" title="Enviar a um amigo"><img src="images/habitacao/icon_enviar.gif" width="12" height="17" alt="Enviar a amigo" /></a><a onclick="javascript: mostraAmigoHab();" title="Enviar a um amigo">Enviar a amigo &raquo;</a><span>&nbsp;</span>';document.getElementById("labelContacto").className="active";document.getElementById("labelContacto").innerHTML='<a onclick="javascript: mostraContacto();" title="Contactem-me"><img src="images/habitacao/icon_contacto.gif" width="14" height="17" alt="Contactem-me" /></a><a  onclick="javascript: mostraContactoHab();" title="Contactem-me">Contactem-me</a><span>&nbsp;</span>';document.getElementById("formContacto").style.display="block";document.getElementById("opcoes").style.borderBottom="none"}function showFaq(A){if(document.lastFaq){document.getElementById(document.lastFaq).style.display="none";document.getElementById(document.lastFaq+"00").style.display="none"}document.getElementById(A).style.display="block";document.getElementById(A+"00").style.display="block";document.lastFaq=A}function hideFaq(A){document.getElementById(A).style.display="none";document.getElementById(A+"00").style.display="none";document.lastFaq=null}function chargeLocalVideo(B){var A=document.getElementById("videoLeft");A.innerHTML='<embed width="183" height="345" align="middle" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" flashvars="" name="Files/Flash/'+B+'" bgcolor="#FFFFFF" quality="high" src="Files/Flash/'+B+'.swf"/>'}function chargeRemoteVideo(B){var A=document.getElementById("videoLeft");A.innerHTML='<embed width="183" height="345" align="middle" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" flashvars="" name="http://video.segurodirecto.pt/'+B+'" bgcolor="#FFFFFF" quality="high" src="http://video.segurodirecto.pt/'+B+'.swf"/>'}function ShowBySideLayor(){setTimeout("popUp('https://webcare.byside.com/agent/survey.php?wid=N0JCRDE3RTY1QkA2MTM1QDYwMTNASUBAQFNANzE2OUBAYjYxMzVA&amp;lang=pt', 400, 365);bysideWebcare_onwindowclose_allow=false;",15000)}function popUp(B,C,A){window.open(B,"","width="+C+",height="+A)}function checkmod(A){val=0;for(pos=0;pos<A.length-1;++pos){val+=(1*A.charAt(pos))*(9-pos)}ctl=val%11?(11-val%11)%10:0;return ctl==(1*A.charAt(pos))}function ValidateNIF(num,args){var c;args.Value=args.Value.replace(" ","");c=args.Value.charAt(0);if(args.Value.length!=9||eval(args.Value)<99999999||(c=="0")||(c=="3")||(c=="4")||(c=="5")||(c=="7")||(c=="8")){args.IsValid=false;return }args.IsValid=checkmod(args.Value)}function ValidateNIF_Register(num,args){var c;args.Value=args.Value.replace(" ","");c=args.Value.charAt(0);if(args.Value.length!=9||eval(args.Value)<99999999||(c=="0")||(c=="3")||(c=="4")||(c=="7")||(c=="8")){args.IsValid=false;return }args.IsValid=checkmod(args.Value)}function CheckBI(B,C){var A;if((B.length<7)||(B.length>8)){return false}if(C.length!=1){return false}if(B.length==8){A=B+C}else{A="0"+B+C}return checkmod(A)}function ValidateNIB(H,G,F,E){var D=0;var B=0;var I="";var A=H+G+F+E;if(A.length!=21){return false}else{var C=E;A=H+G+F;for(D=0;D<19;D++){B=((B+parseInt(A.substr(D,1),10))*10)%97}B=98-((B*10)%97);I=B.toString();if(B<10){I="0"+B.toString()}if(C==I){return true}else{return false}}}function ValidateTandCs(B,A){A.IsValid=document.getElementById("<%= CheckBoxTos.ClientID %>").checked}function On_KeyPress(){var A="-0123456789";var B=String.fromCharCode(window.event.keyCode);if(A.indexOf(B)==-1){window.event.returnValue=false}else{window.event.returnValue=true}}function On_KeyPress(B){if(B){var A="-0123456789"}else{var A="0123456789"}var C=String.fromCharCode(window.event.keyCode);if(A.indexOf(C)==-1){window.event.returnValue=false}else{window.event.returnValue=true}}function showTable(B){var A;for(i=1;i<=10;i++){if(i==B){if(document.getElementById("hidden"+i).style.display=="block"){A=true}document.getElementById("hidden"+i).style.display="block";document.getElementById("table"+i).style.backgroundImage="url(images/habitacao/table_menos.gif)"}else{document.getElementById("hidden"+i).style.display="none";document.getElementById("table"+i).style.backgroundImage="url(images/habitacao/table_mais.gif)"}}if(A){document.getElementById("hidden"+B).style.display="none";document.getElementById("table"+B).style.backgroundImage="url(images/habitacao/table_mais.gif)"}}function onkeyValidaFormatoData(D,E,A){if(D.keyCode==9||D.keyCode==8||D.keyCode==35||D.keyCode==36||D.keyCode==37||D.keyCode==39||D.keyCode==46){return false}if((D.keyCode<48||D.keyCode>57)&&(D.keyCode<96||D.keyCode>105)){D.returnValue=false}if(E.value==""){return false}var B=E.value.length;var C=new String();C=A;switch(C.toUpperCase()){case"DD-MM-AAAA":if(B==2||B==5){E.value=E.value+"-"}break;case"AAAA-MM-DD":if(B==4||B==7){E.value=E.value+"-"}break}}function checkTextAreaMaxLength(D,C,B){var E=D.MaxLength;if(null==E){E=B}var A=parseInt(E);if(!checkSpecialKeys(C)){if(D.value.length>A-1){if(window.event){C.returnValue=false}else{C.preventDefault()}}}}function checkSpecialKeys(A){if(A.keyCode!=8&&A.keyCode!=46&&A.keyCode!=37&&A.keyCode!=38&&A.keyCode!=39&&A.keyCode!=40){return false}else{return true}};
