﻿// JScript File
//Popup Custom
function OpenPopUp(URL, SET)
{
    window.open(URL, '_blank', SET) 
}
//Popup Custom 2
function OpenPopUpCus(URL, OPE, SET)
{
    window.open(URL, OPE, SET) 
}
//mudar fundo
function MudarBackground(id, corOriginal)
{
    var objeto = document.getElementById(id);
    if(objeto != null)
    {               
        if(objeto.checked)
    {
        objeto.parentElement.parentElement.style.background = "#EAFFEA";
    }
    else
    {                    
        if( (corOriginal % 2) > 0 )
                objeto.parentElement.parentElement.style.background = "#FFFFFF";
            else
                objeto.parentElement.parentElement.style.background = "#FFFFFF";
        }
    }
}
//Selecionar todos os ckd
function SelecionaTodosChecks(spanChk)
{
    var oItem = spanChk.children;
    var theBox= (spanChk.type=="checkbox") ? 
        spanChk : spanChk.children.item[0];
    xState=theBox.checked;
    elm=theBox.form.elements;

    for(i=0;i<elm.length;i++)
     if(elm[i].type=="checkbox" && 
              elm[i].id!=theBox.id)
     {
       if(elm[i].checked!=xState)
         elm[i].click();
     }
}

function Salvar_Atualizar(link)
{
    window.opener.location = link;
}
function Fecha_Redireciona(link)
{
    window.opener.location = link;
    self.close();
}
function Fecha_Janela()
{
    if (confirm('Você tem certeza que quer fechar esta janela?'))
    window.close();
}
function Fecha_Janela_TWO()
{
    window.close();
}
