﻿function MyPopup(apuracao, vencimento, valor)
 {
   mywindow = window.open("Darf.aspx?apuracao="+apuracao+"&vencimento="+vencimento+"&valor="+valor,"mywindow","left=300, top=200, location=1,status=1,scrollbars=1,width=420,height=400");
   return false;
 }

function PopupContato()
 {
   wcontato = window.open("contato.aspx", "wcontato","left=300, top=200, location=1,status=1,scrollbars=1,width=460,height=400");
   return false;
 }

function ExibeRecolhe(id)
{
    if (document.getElementById(id).style.display == 'none')
    {
        document.getElementById(id).style.display = 'block'
        desenho.innerHTML="▲"
    }
    else
    {
        document.getElementById(id).style.display = 'none'
        desenho.innerHTML="▼"
    }

    return false
}

function Exibe(id)
{
    if (id == "ctl00_ContentPlaceHolder1_RadioVari")
    {
        document.getElementById("ctl00_ContentPlaceHolder1_TextBoxCorgem").style.display = 'none'
        document.getElementById("ctl00_ContentPlaceHolder1_TextAreaCorgem").style.display = 'block'
    }
    else
    {
        document.getElementById("ctl00_ContentPlaceHolder1_TextBoxCorgem").style.display = 'block'
        document.getElementById("ctl00_ContentPlaceHolder1_TextAreaCorgem").style.display = 'none'
    }   
}


function PopupCSS(id, positionTop)
{
    var div = document.getElementById(id);
    var width = div.style.width.replace("px","");
    var screen_width = window.screen.width;
    var positionLeft = screen_width/2 - width/2;
    div.style.left = positionLeft + "px";
    div.style.top = positionTop + "px"
    
    div.style.display = "block"
}

function PopupCSS_Right(id, positionTop) {
    var div = document.getElementById(id);
    var width = div.style.width.replace("px", "");
    var screen_width = window.screen.width;
    var positionLeft = screen_width - width - 50
    div.style.left = positionLeft + "px";
    div.style.top = positionTop + "px"

    div.style.display = "block"
}

function PopupCSS_Close(obj)
{
    obj.parentNode.style.display = 'none'
    return false
}