var classId;
var id;


function examsView(courseId, classId)
{
    id = 'exams_' + classId;
    makeHttpRequest('lg-examsView.php?courseId='+courseId+'&classId=' + classId, 'doIt', 'loading', 0);    
}

function examAttemptsView(courseId, classId)
{
    id = 'exams_' + classId;
    makeHttpRequest('lg-examAttemptsView.php?courseId='+courseId+'&classId=' + classId, 'doIt', 'loading', 0);    
}


function doIt(content)
{
      console.log(id);

      document.getElementById(id).style.display = 'block'; // it shows in the right  the text: Apasati linkul Contact now...
      document.getElementById(id).innerHTML = content; // replaces the form_adm html with the content from the ajax request
}


function loading()
{
     document.getElementById(id).innerHTML = 'asteptati un moment...';
}




function reasonClosed(el, reason)
{
    slickPopup(reason);
}

function slickPopup(msg)
{
    //    console.log(cursor);
    alert(msg);
}


// for lg-examAttemptsView
function warnResults(viewedResults)
{
    if (viewedResults) return 1;
    return window.confirm('Acest examen NU mai poate fi sustinut odata ce rezultatele sunt vizualizate. Esti SIGUR ca vrei sa vezi rezultatele examenului ?');
}


// for lg-examsView
function popExam(courseId, examInstanceId)
{
  mylocation = "examAttemptStart.php?courseId="+courseId+"&examInstanceId=" + examInstanceId;
  mypopup =  window.open(mylocation, 'fereastramea',  'scrollbars=1, location=0, statusbar=1, menubar=0, resizable=0, fullscreen=1');
  //  mypopup =  window.open(mylocation, 'fereastramea',  'scrollbars=1, location=1, statusbar=1, menubar=1, resizable=1, fullscreen=0');
  if (window.focus) {mypopup.focus()}
  return;
}


