function OpenWindowExtranet(Url){PosX=((screen.availWidth-750)/2);PosY=((screen.availHeight-550)/2);ExtWindow=window.open(Url,'Extranet',"toolbar= 0,location= 0,directories= 0,status=1,menubar= 0,scrollbars=0,resizable= 0,copyhistory=0,width=750,height=550,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);ExtWindow.focus();}
function OpenWindowAdmin(Url){PosX=((screen.availWidth-630)/2);PosY=((screen.availHeight-450)/2);AdminWindow=window.open(Url,"Administracao","toolbar= 0,location= 0,directories= 0,status=1,menubar= 0,scrollbars=1,resizable= 0,copyhistory= 1,width=630,height=450,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);AdminWindow.focus();}
function OpenInscricao(Url){PosX=((screen.availWidth-550)/2);PosY=((screen.availHeight-520)/2);InscrWindow=window.open(Url,"InscricaoOnline","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=550,height=520,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);InscrWindow.focus();}
function Recomendar(Url){PosX=((screen.availWidth-620)/2);PosY=((screen.availHeight-295)/2);var Link=document.location.href;Link=Link.replace(/&/g,'[p]');Convite=window.open(Url+"?Link="+Link,"Convite","toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable= 0,copyhistory= 1,width=620,height=295,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);Convite.focus();}
function OpenPrint(Url){PosX=((screen.availWidth-650)/2);PosY=((screen.availHeight-500)/2);PrintWindow=window.open(Url,"Imprimir","toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable= 0,copyhistory=0,width=650,height=500,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);PrintWindow.focus();}
function OpenWindowPortfolio(Url){PosX=((screen.availWidth-500)/2);PosY=((screen.availHeight-400)/2);PortWindow=window.open(Url,"Portfolios","toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable=1,copyhistory=0,width=500,height=400,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);PortWindow.focus();}
function OpenDownload(Url){PosX=((screen.availWidth-600)/2);PosY=((screen.availHeight-350)/2);DownWindow=window.open(Url,"Downloads","toolbar= 0,location= 0,directories= 0,status= 0,menubar= 0,scrollbars= 1,resizable= 1,copyhistory=0,width=600,height=350,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);DownWindow.focus();}
function OpenWindowImagem(Url){PosX=((screen.availWidth-500)/2);PosY=((screen.availHeight-450)/2);ImagemWindow=window.open(Url,'Imagem',"toolbar= 0,location= 0,directories= 0,status=1,menubar= 0,scrollbars=1,resizable=1,copyhistory=0,width=500,height=450,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);ImagemWindow.focus();}
function OpenWindowNoticia(Url){PosX=((screen.availWidth-500)/2);PosY=((screen.availHeight-500)/2);NotWindow=window.open(Url,"Noticias","toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable=1,copyhistory=0,width=500,height=500,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);NotWindow.focus();}
function OpenPoup(Param){PosX=((screen.availWidth-500)/2);PosY=((screen.availHeight-500)/2);PopWindow=window.open('../site/poup.asp?'+Param,"CISPoup","toolbar= 0,location= 0,directories= 0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=500,height=500,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);PopWindow.focus();}
function OpenWindowArquivo(Url){PosX=((screen.availWidth-550)/2);PosY=((screen.availHeight-200)/2);ArqWindow=window.open(Url,"AnexarArquivo","toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars=1,resizable=0,copyhistory= 1,width=550,height=200,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);ArqWindow.focus();}
function OpenWindowNewsletter(Url){PosX=((screen.availWidth-680)/2);PosY=((screen.availHeight-500)/2);NewsWindow=window.open(Url,"NEwsletter","toolbar= 0,location= 0,directories= 0,status= 0,menubar= 0,scrollbars=1,resizable=1,copyhistory=0,width=680,height=500,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);NewsWindow.focus();}
function OpenWindowFiltro(Url){PosX=((screen.availWidth-450)/2);PosY=((screen.availHeight-230)/2);FiltroWindow=window.open(Url,"Filtro","toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars=0,resizable=0,copyhistory= 1,width=450,height=230,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);FiltroWindow.focus();}
function OpenWindowBookmarks(Url){BMWindow=window.open(Url,'Bookmarks','toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable= 0,copyhistory= 1,width=650,height=300');BMWindow.focus();}
function OpenWindowWebmail(Url){PosX=((screen.availWidth-850)/2);PosY=((screen.availHeight-550)/2);MailWindow=window.open(Url,'Webmail',"toolbar= 0,location= 0,directories= 0,status=1,menubar= 0,scrollbars=0,resizable=1,copyhistory=0,width=850,height=550,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);MailWindow.focus();}
function OpenWindow(Url,Nome,Larg,Alt){if(!Nome){Nome="Imagem";}
if(!Larg){Larg=500;}
if(!Alt){Alt=450;}
PosX=((screen.availWidth-Larg)/2);PosY=((screen.availHeight-Alt)/2);newWindow=window.open(Url,Nome,"toolbar=0,location=0,directories=0,status=1,menubar= 0,scrollbars=1,resizable=1,copyhistory=0,width="+Larg+",height="+Alt+",left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);newWindow.focus();}
function OpenVideo(titulo,video){PosX=((screen.availWidth-300)/2);PosY=((screen.availHeight-325)/2);VideoWindow=window.open('../videos/show.asp?Titulo='+titulo+'&Video='+video,'Videos',"toolbar=0,location=0,directories=0,status=0,menubar=0,fullscreen=0,scrollbars=0,resizable=0,copyhistory=0,width=300,height=325,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);VideoWindow.focus();}
function OpenRevista(Url,Nome,Larg,Alt){if(!Nome){Nome="Imagem";}
if(!Larg){Larg=1000;}
if(!Alt){Alt=700;}
var PosX=((screen.availWidth-Larg)/2);var PosY=((screen.availHeight-Alt)/2);revWindow=window.open(Url,Nome,"toolbar=0,location=0,directories=0,status=0,menubar= 0,scrollbars=0,resizable=1,copyhistory=0,width="+Larg+",height="+Alt+",left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);revWindow.focus();}
function SetHomeSite(olink){Endereco=window.location;olink.style.behavior='url(#default#homepage)'
olink.setHomePage(Endereco);return false;}
function AddBookmark(){Titulo=document.title;Endereco=window.location;window.external.AddFavorite(Endereco,Titulo);}
function ConfirmaEnvio(URL){var confirma;confirma=window.confirm('Após enviar este formulário para a AGAS não será mais possível modificá-lo.\n\nDeseja realmente enviá-lo?');if(confirma){window.location=URL};}
function SetFileName(Formulario,TextBox,Valor){window.opener.document.forms[Formulario].elements[TextBox].value=Valor;window.close();}
function mOvr(src,clrOver){document.all.item("tr"+src).style.background=clrOver;document.all.item("l"+src).style.color="#FFFFFF";}
function mOut(src,clrIn){document.all.item("tr"+src).style.background=clrIn;document.all.item("l"+src).style.color="";}
function showHideContent(id,status)
{var oContent=document.getElementById(id);if(oContent){oContent.style.display=status;}}
var MenuAdmin
function ShowMenuAdmin(id){HideMenuAdmin();if(!id){id='Admin_Contexto';}
MenuAdmin=document.all.item(id);if(MenuAdmin){var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY
if(rightedge<MenuAdmin.offsetWidth)
MenuAdmin.style.left=document.body.scrollLeft+event.clientX-MenuAdmin.offsetWidth
else
MenuAdmin.style.left=document.body.scrollLeft+event.clientX
if(bottomedge<MenuAdmin.offsetHeight)
MenuAdmin.style.top=document.body.scrollTop+event.clientY-MenuAdmin.offsetHeight
else
MenuAdmin.style.top=document.body.scrollTop+event.clientY
MenuAdmin.style.visibility="visible"}
return false}
function HideMenuAdmin(){if(MenuAdmin){MenuAdmin.style.visibility="hidden";}}
function EditMask(objField,sMask,evtKeyPress){var i,nCount,sValue,fldLen,mskLen,bolMask,sCod,nTecla;if(document.all){nTecla=evtKeyPress.keyCode;}else{nTecla=evtKeyPress.which;}
sValue=objField.value;sValue=sValue.toString().replace("-","");sValue=sValue.toString().replace("-","");sValue=sValue.toString().replace(".","");sValue=sValue.toString().replace(".","");sValue=sValue.toString().replace("/","");sValue=sValue.toString().replace("/","");sValue=sValue.toString().replace("(","");sValue=sValue.toString().replace("(","");sValue=sValue.toString().replace(")","");sValue=sValue.toString().replace(")","");sValue=sValue.toString().replace(" ","");sValue=sValue.toString().replace(" ","");fldLen=sValue.length;mskLen=sMask.length;i=0;nCount=0;sCod="";mskLen=fldLen;while(i<=mskLen){bolMask=((sMask.charAt(i)=="-")||(sMask.charAt(i)==".")||(sMask.charAt(i)=="/"))
bolMask=bolMask||((sMask.charAt(i)=="(")||(sMask.charAt(i)==")")||(sMask.charAt(i)==" "))
if(bolMask){sCod+=sMask.charAt(i);mskLen++;}
else{sCod+=sValue.charAt(nCount);nCount++;}
i++;}
objField.value=sCod;if(nTecla!=8){if(sMask.charAt(i-1)=="9"){return((nTecla>47)&&(nTecla<58));}
else{return true;}}
else{return true;}}