

function GoToPayment(id) {
    location.href = '/Compras.aspx?Curso=' + id;
}


function GoToEvalution() {

    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }
    
    theForm.action = '/AvaliacaoExercicio.asp';
    theForm.submit();
}

function SetValueHidden(id, nameHid) {
    var hid = document.getElementById(nameHid);
    if (hid) {
        hid.value = id;
    }
}

function openSystemTest() {

    var url = '/SystemTest.asp';
    var name = 'Palestra';

    //Cálculo para o PopUp abrir no centro da tela,
    //independente da resolução do usuário
    var WindowWidth = 790;
    var WindowHeight = 540;
    var xPosition = (screen.availWidth) ? (screen.availWidth - WindowWidth - 10) / 2 : 0;
    var yPosition = (screen.availHeight) ? (screen.availHeight - WindowHeight - 20) / 2 : 0;

    window.open(url, name, 'width=' + WindowWidth + ', height=' + WindowHeight + ',menubar=no,resizable=no,toolbar=no,status=no,scrollbars=no,screenX=' + xPosition + ',screenY=' + yPosition + ',left=' + xPosition + ',top=' + yPosition + '');
}

function openWindowPlayer(id) {
    var url = '/VirtualIniciarVideo.asp?CursoVirtualID=' + id + '&a=1';
    var name = 'Palestra';
    //Cálculo para o PopUp abrir no centro da tela,
    //independente da resolução do usuário
    var WindowWidth = 790;
    var WindowHeight = 540;
    var xPosition = (screen.availWidth) ? (screen.availWidth - WindowWidth - 10) / 2 : 0;
    var yPosition = (screen.availHeight) ? (screen.availHeight - WindowHeight - 20) / 2 : 0;

    window.open(url, name, 'width=' + WindowWidth + ', height=' + WindowHeight + ',menubar=no,resizable=no,toolbar=no,status=no,scrollbars=no,screenX=' + xPosition + ',screenY=' + yPosition + ',left=' + xPosition + ',top=' + yPosition + '');
}

function AbreGabarito(avaliacaoID, cursoVirtualID) {

    var url = '/AvaliacaoGabarito.asp?CursoVirtualID=' + cursoVirtualID + '&AvaliacaoID=' + avaliacaoID;
    var name = 'Palestra';
    //Cálculo para o PopUp abrir no centro da tela,
    //independente da resolução do usuário
    var WindowWidth = 820;
    var WindowHeight = 540;
    var xPosition = (screen.availWidth) ? (screen.availWidth - WindowWidth - 10) / 2 : 0;
    var yPosition = (screen.availHeight) ? (screen.availHeight - WindowHeight - 20) / 2 : 0;

    window.open(url, name, 'width=' + WindowWidth + ', height=' + WindowHeight + ',menubar=no,resizable=no,toolbar=no,status=no,scrollbars=yes,screenX=' + xPosition + ',screenY=' + yPosition + ',left=' + xPosition + ',top=' + yPosition + '');

}


function EmitirCertificado(userID, produtoID, turmaID) {

    var url = '/CertificadoCursoVirtual.asp?FuncionarioID=' + userID + '&ProdutoID=' + produtoID + '&TurmaID=' + turmaID;
    var name = 'Palestra';
    //Cálculo para o PopUp abrir no centro da tela,
    //independente da resolução do usuário
    var WindowWidth = 820;
    var WindowHeight = 540;
    var xPosition = (screen.availWidth) ? (screen.availWidth - WindowWidth - 10) / 2 : 0;
    var yPosition = (screen.availHeight) ? (screen.availHeight - WindowHeight - 20) / 2 : 0;

    window.open(url, name, 'width=' + WindowWidth + ', height=' + WindowHeight + ',menubar=no,resizable=no,toolbar=no,status=no,scrollbars=yes,screenX=' + xPosition + ',screenY=' + yPosition + ',left=' + xPosition + ',top=' + yPosition + '');

}


function GoMoodle(id) {
    location.href = '/VirtualDetalhes.asp?CursoVirtualID=' + id + '&Login=1'
}
	
