
function OpenWindowMapa(){PosX=((screen.availWidth-625)/2);PosY=((screen.availHeight-630)/2);MapaWindow=window.open('../personal/mapa.asp','Mapa',"toolbar= 0,location= 0,directories= 0,status=0,menubar= 0,scrollbars=0,resizable= 0,copyhistory=0,width=625,height=4,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);MapaWindow.focus();}
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=1,resizable=1,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=1,copyhistory= 1,width=630,height=450,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);AdminWindow.focus();}
function OpenWindowInfos(Url){PosX=((screen.availWidth-500)/2);PosY=((screen.availHeight-450)/2);InfoWindow=window.open(Url,"Informacoes","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);InfoWindow.focus();}
function Recomendar(Url){PosX=((screen.availWidth-600)/2);PosY=((screen.availHeight-400)/2);var Link=document.location.href;Link=Link.replace('&','[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=600,height=400,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);Convite.focus();}
function Imprimir(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= 1,width=650,height=500,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);PrintWindow.focus();}
function OpenDownload(Url){PosX=((screen.availWidth-500)/2);PosY=((screen.availHeight-400)/2);DownWindow=window.open(Url,"Downloads","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);DownWindow.focus();}
function OpenWindowImagem(Url){ImagemWindow=window.open(Url,'Imagem','toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars=1,resizable= 1,copyhistory= 1,width=400,height=450');ImagemWindow.focus();}
function OpenWindowNoticia(Url){PosX=((screen.availWidth-650)/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=650,height=500,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);NotWindow.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 OpenWindowAviso(Url){AvisoWindow=window.open(Url,'Avisos','toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable= 0,copyhistory= 1,width=400,height=400');AvisoWindow.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 OpenWindowCadastros(Url){CadWindow=window.open(Url,'Cadastros','toolbar= 0,location= 0,directories= 0,status= 1,menubar= 0,scrollbars= 1,resizable= 0,copyhistory= 1,width=600,height=500');CadWindow.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 OpenWindowExterno(Url){PosX=((screen.availWidth-850)/2);PosY=((screen.availHeight-550)/2);ExtWindow=window.open(Url,'Externo',"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);ExtWindow.focus();}
function AtendimentoOnline(tipo){PosX=((screen.availWidth-400)/2);PosY=((screen.availHeight-250)/2);switch(tipo){case"Skype":url="../personal/skypego.asp";break;}
AtendOnline=window.open(url,tipo,"toolbar= 0,location= 0,directories= 0,status=0,menubar= 0,scrollbars=0,resizable=0,copyhistory=0,width=400,height=250,left="+PosX+",top="+PosY+",screenX="+PosX+",screenY="+PosY);AtendOnline.focus();}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_controlShockwave(objStr,x,cmdName,frameNum){var obj=MM_findObj(objStr);if(obj)eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');}
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 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.all.item(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 if(document.layers){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;}}
function CollapseElements(tipo,prefix){var Prefixo;var elems=document.getElementsByTagName(tipo);for(var i=0;i<elems.length;i++){Prefixo=elems[i].id.slice(0,prefix.length);if(Prefixo==prefix){elems[i].style.display='none';}}}
function DropFill(fonte,destino,classe1,classe2,estilo){var i,opcao,valor,texto,html,fonteNome;if(typeof(fonte)=='string'){fonte=document.getElementById(fonte);}
if(typeof(destino)=='string'){destino=document.getElementById(destino);}
if((fonte)&&(destino)){fonteNome=fonte.id;html="<ul id=\"DropList_"+fonteNome+"\" class=\""+classe1+"\" style=\"position:absolute;display:none;"+estilo+"\">"
for(i=0;i<fonte.options.length;i++){opcao=fonte.options[i];valor=opcao.value;texto=opcao.text;if(opcao.selected){var fontePadrao=texto;}
html+="<li><a href=\"javascript:DropSelect('"+fonteNome+"','','"+valor+"');\">"+texto+"</a></li>"}
html+="</ul>"
html+="<input type=\"text\" id=\"DropCampo_"+fonteNome+"\" class=\""+classe2+"\" value=\""+fontePadrao+"\" readonly onclick=\"DropClick('"+fonteNome+"');\">"
destino.innerHTML=html;}}
function DropClick(fonteNome){var DropObj=document.getElementById("DropList_"+fonteNome);if(DropObj.style.display=='none'){CollapseElements("ul","DropList_");DropObj.style.display='';}else{DropObj.style.display='none';}}
function DropOut(fonteNome){var DropObj=document.getElementById("DropList_"+fonteNome);if(DropObj){DropObj.style.display='none';}}
function DropSelect(fonte,nome,valor,texto){var i,opcao;var fonte=document.getElementById(fonte);if(fonte){fonte.value=valor}
var input=document.getElementById("DropCampo_"+fonte.id);if(input){input.value=fonte.options[fonte.selectedIndex].text;}
var div=document.getElementById("DropList_"+fonte.id);if(div){div.style.display="none";}
if(fonte){if(fonte.onchange){fonte.onchange();}}}