function mOvr(src,clrOver) {
  if (!src.contains(event.fromElement)) {
	src.bgColor = clrOver;
  }
}

function mOut(src,clrIn) {
  if (!src.contains(event.toElement)) {
	src.bgColor = clrIn;
  }
}

function janela(theURL,winName,features,w,h,c) {

if(features==""){
features = "toolbar=nos,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
}
features += ",width=" + w + ",height=" + h;
win = window.open(theURL,winName,features);
if(c!="n"){
var x = (win.screen.width-w)/2;
var y = (win.screen.height-h)/2;
win.moveTo(x,y);
}

}

function 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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function Layers(Id,action) {
document.getElementById(Id).style.visibility = action;
}


function LayersPos(Id) {
wJanela = window.screen.width;
Layer = eval('document.getElementById(Id).style');
if(wJanela!=800){
wDif = wJanela-800;
lLayer = eval(Layer.left.replace("px",""))+wDif;
Layer.left = lLayer;
}
}


function descricao(url,titulo)
{
janela(url,titulo,'',550,400,'');
}


function descricaoSelect(opcao,nome){
if(opcao!=0){
url = opcao.options[opcao.selectedIndex].value;
descricao(url,nome);
}
}


function Cep()
{
janela("buscaCEP.html","buscaCEP","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no",328,257,"n");
}


function confirma(action,tb){
if(tb == "oportunidade" && action == "Excluir"){
	msg = confirm('ATENÇÃO: Após ser excluído, este\nregistro não poderá ser recuperado.\nConfirma exclusão?');
} else {
	msg = confirm('Confirma:\n'+action+' '+tb);
}
return msg;
}
