﻿
var popUp;


function returnPopResult(field, postBack) 
{
    popUp.close();
    if (postBack)
        __doPostBack(field, '');
}

function checkPopUp() 
{
    if (popUp) 
    {
        popUp.focus();
    }
}

function removePop() 
{
    if (popUp) 
    {
        popUp = null;
    }
}

function abreJanelaCentro(url, nome, xx, yy) 
{

    x = (window.screen.width / 2) - (xx / 2);
    y = (window.screen.height / 2) - (yy / 2);

    // popUp = window.open(url, 'WindowPopupContainer', "menubar=0,toolbar=0,directories=0,status=0,scrollbars=no,resizable=0,width=" + xx + ",height=" + yy + ",left=" + x + ",top=" + y + "");
    popUp = window.open(url, nome, "menubar=0,toolbar=0,directories=0,status=0,scrollbars=no,resizable=0,width=" + xx + ",height=" + yy + "");
    checkPopUp();

}


function RefreshFromPopup() 
{
    //window.parent.refresh;
    window.location.reload();
    //self.close();
    //window.opener.actualizar();alert('" & msgoutput & "');setTimeout('self.close()',1000);"
}


function SetControlValue(target, value) 
{
    //document.getElementById("ctl00_ContentPlaceHolder1_perfil1_tbArtistaFoto1_TBInput").value = value;
    document.getElementById(target).value = value;
}

function SetValueFromPopup(target, value) 
{
    popUp.close();
    document.getElementById(target).value = value;
}

