<!--
function confirm_delete(page, controller, id, next_page)  //Ask the User to Confirm
{
 var where_to= confirm('Do you really want to Delete this ' + controller + '??');
 if (where_to == true)
 {
   window.location='index.php?page=' + page + '&' + controller + '_id=' + id;
 }
 else
 {
  window.location='index.php?page=' + next_page; //Go nowhere
  }
}

function submit_change_language()  //Ask the User to Confirm
{
    document.language_form.submit();
}

function mysqlTimeStampToDate(timestamp) {
    //function parses mysql datetime string and returns javascript Date object
    //input has to be in this format: 2007-06-05 15:26:02
    var regex=/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/;
    var parts=timestamp.replace(regex,"$1 $2 $3 $4 $5 $6").split(' ');
    return new Date(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]);
}

function alert_timeup()
{  
  alert('Time is up. You will have to resit the exam'); 
}


/*
function change_language(page, language)  //Ask the User to Confirm
{
  //page gives previous url GET parameters (with trailing &) eg page => page=view_course&course_id=5&
   window.location='index.php?' + page +  'lang=' + language;
 
}
*/


//-->
