
<!--

// ===================================================



var	spbw = false;

function ShowBlockerWarning()
{
	return spbw;
}

function Init()
{
	if (true == Detect())
	{
		spbw = true;
	}
	
}


function Detect()
{
	var e = false;
	var pw1 = null;
	var pw2 = null;

	try
	{
		do
		{
			var d = new Date();
			var wName = "ptest_" + d.getTime();
			var testUrl = IsYBI() ? "popupTest.asp" : "";
			pw1 = window.open(testUrl,wName,"width=0,height=0,left=5000,top=5000",true);
			if (null == pw1 || true == pw1.closed)
			{
				e = true;
				break;
			}
			pw2 = window.open(testUrl,wName,"width=0,height=0");
			if (null == pw2 || true == pw2.closed)
			{
				e = true;
				break;
			}
			if (IsYBI())
			{
				if (pw1 != pw2)
				{
					e = true;
					break;
				}
			}
			pw1.close();
			pw2.close();
			pw1 = pw2 = null;
		}
		while(false);
	}
	catch(ex)
	{
		e = true;
	}
	if (null != pw1)
	{
		try { if (!pw1.closed) pw1.close(); } catch(ex){}
	}
	if (null != pw2)
	{
		try { if (!pw2.closed) pw2.close(); } catch(ex){}
	}
	return e;
}

function IsYBI()
{
	var i = false;
	var xObj = null;
	try
	{
        var xObj = new ActiveXObject("YBIOCtrl.CompanionBHO");
		if (xObj==null) i = false;
		else i = true;
	}
	catch(ex) { i = false; }
	return i;
}

function selectCode()
{
	opener.OpenCadastro();
	this.close();
	return true;
}

function VerClick()
{
	if (event.keyCode == 13)
	window.close();
}



function PlaySenha()
{
  	var obj = document.getElementById('popup');

	obj.filters[0].Apply();
	
	if (screen.width == 800) 
	   var Top = ((screen.height - obj.style.height.substring(0, 3)) / 2) - 30 
	else 
	   var Top = ((screen.height - obj.style.height.substring(0, 3)) / 2) - 100 

	var Left = (screen.width - obj.style.width.substring(0, 3)) / 2

	obj.style.top = Top;

	obj.style.left = Left;

	obj.style.visibility = "visible";

	obj.filters[0].Play();
}

function PlayPed()
{

  	var obj = document.getElementById('popup_ped');

	obj.filters[0].Apply();
	
	if (screen.width == 800) 
	   var Top = ((screen.height - obj.style.height.substring(0, 3)) / 2) - 30 
	else 
	   var Top = ((screen.height - obj.style.height.substring(0, 3)) / 2) - 100 

	var Left = ((screen.width - obj.style.width.substring(0, 3)) / 2) - 200

	obj.style.top = Top;

	obj.style.left = Left;

	obj.style.visibility = "visible";

	obj.filters[0].Play();
	
}


function CloseEnd_ped()
{
	var obj = document.getElementById('popup_ped');
	
	obj.style.visibility = "hidden";

	var objimg = document.getElementById('end2');

	objimg.style.display = "";

	objimg.style.visibility = "visible";

}


function CloseEnd()
{
	var obj = document.getElementById('popup');
	
	obj.style.visibility = "hidden";

	var objimg = document.getElementById('end');

	objimg.style.display = "";

	objimg.style.visibility = "visible";

}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

if ("<%=SemSession%>" == "1")
{
        if (parent.header != null)        
                parent.header.location.href = "PagAux/TopoAnfreixo.asp?resolucao=" + screen.width + "x" + screen.height;
        else
                window.open("PagAux/TopoAnfreixo.asp?Open=1&resolucao=" + screen.width + "x" + screen.height, "blank", "top=10, left=10, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=10, height=10");
}
 
function setCode()
{
	window.document.location.href = 'PedPend.asp';
	window.document.open;
}

function VerBrowser()
{
       var vTop = 20;
       var vLeft = (screen.width - 500) / 2;
       window.open('pop_browser.asp', "_blank", "top=" + vTop + ", left=" + vLeft + ", toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=540, height=290");
}

function lembra_senha()
{
        var vTop = 250;
        var vLeft = (screen.width - 550) / 2;
        window.open('EsqSenha.asp', "_blank", "top=" + vTop + ", left=" + vLeft + ", toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=540, height=250");
}

function Antipopup()
{
        var vTop = 250;
        var vLeft = (screen.width - 550) / 2;
        window.open('antipopup.htm', "_blank", "top=" + vTop + ", left=" + vLeft + ", toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=780, height=250");
}


function popUp_Cert(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0, scrollbars=1 ,resizable=1,width=720,height=450');
	self.name = "mainWin"; 
}


var messengerWindow = null;

function OnLoad_WelcomePage()
{
    var sd = document.getElementById("sd");
   
    if ( ShowBlockerWarning() )
    {
      var messageObject = document.getElementById("noPopHtml");
        if (null != messageObject)
        {
                messageObject.innerHTML = g_blockerHtml;
        }
     }
   
}



function MudaCor(tr,cor){
	tr.style.background = cor;
}

function MudaImg(img,src){
	img.src = "img/"+src;
}

function Mud()
{
	document.FrmVer.submit();
}

function MostrarDiv(){
	document.frmPesq.idCat.style.visibility = "hidden"	
	$("#pedido").show("fast");
}

function CarFechar(){
	$("#pedido").hide("fast");
	document.frmPesq.idCat.style.visibility = "visible"
}


function abrenconf(){
	window.open("pag_nconf.asp","conf","width=788px,height=550px,top=0,left=0,scrollbars=yes,status=yes")
}

function Checked(obj,total)
{
	for(i=1; i <= total ;i++){
		if(i<10){
			i = "0"+i;
		}
		eval("document.frmSenha.CGC"+i+".checked = obj.checked;");
	}		
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ABRE O MAPA DE LOCALIZAÇÃO E MENSAGEM DE SENHA
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
function AbreMapa(vlr){
	var pagina = "";
    try
    {
		if(vlr == 1){
	 		pagina = "inc_mapa.asp?tipo=1";
	 	}else{
	 		pagina = "inc_mapa.asp?tipo=2";
	 	}
	 	abreDiv(pagina,true,585,481,false);
    }
    catch(e)
    {
        alert("Erro ao buscar conteúdo. " + e.message);    
    }	
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FIM | ABRE O MAPA DE LOCALIZAÇÃO
//////////////////////////////////////////////////////////////////////////////////////////////////////////////