﻿function ShowSelectMember (strFieldToPopulate) 
{
 /************************************************************************************************
  Purpose : Displays the "Select Member" popup window
  ***********************************************************************************************/

  var strURL = "SelectMember.aspx?NamedField=" + strFieldToPopulate;
  var strConfig = "toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no,status=no,resizable=yes,height=600,width=550";
  window.open(strURL, "SelectMember", strConfig);
}

function DeleteItem() 
{
 /************************************************************************************************
  Purpose : Agreement box
  ***********************************************************************************************/

  var agree = confirm("Are you sure you want to delete this selected item?");
  if (agree)
    return true;
  else
    return false;
}

function ConfirmGroupEmail() {
  /************************************************************************************************
  Purpose : Confirm the group message should be sent
  ***********************************************************************************************/

  var agree = confirm("Group e-mails may be sent to one or more members of the group, or the entire group depending on the list selected.\n\nClick OK to send the e-mail, or Cancel to quit before the mail is sent ...");
  if (agree)
    return true;
  else
    return false;
}

function ConfirmEmailResend() {
  /************************************************************************************************
  Purpose : Confirm the e-mails should be re-sent
  ***********************************************************************************************/

  var agree = confirm("The original e-mail has already been sent. Are you sure you want to send it again ?\n\nClick OK to re-send the e-mail, or Cancel to quit before the mail is sent ...");
  if (agree)
    return true;
  else
    return false;
}

function FirstDriveAlert() {
  /************************************************************************************************
  Purpose : Show information required for the first drive
  ***********************************************************************************************/

  alert("Thank you for booking your drive with SLAM.\n\nIf this is your first drive with us, please " +
        "ensure you bring the following documents with you to the assessment centre on the day. " +
        "You will need to show these to your observer before your drive ...\n\n" +
        "- Your driving licence (both parts, card & paper/counterpart)\n" +
        "- A valid insurance certificate for the car you're driving\n" +
        "- A valid MOT certificate for your car (if appropriate)\n\n" +
        "We look forward to seeing you for your drive.");
}

function FirstDriveAlertForMember() {
  /************************************************************************************************
  Purpose : Show information required for the first drive (booked for another member)
  ***********************************************************************************************/

  alert("This appears to be the member's first drive.\n\nPlease ask the the member to " +
        "bring the following documents with them to the assessment centre on the day ...\n\n" +
        "- Their driving licence (both parts, card & paper/counterpart)\n" +
        "- A valid insurance certificate for the car they're driving\n" +
        "- A valid MOT certificate for their car (if appropriate)");
}

function FirstDriveAlertCheckForMember() {
  /************************************************************************************************
  Purpose : Show information required for the first drive (at time of drive)
  ***********************************************************************************************/

  alert("This appears to be the member's first drive.\n\nPlease verify ...\n\n" +
        "- Their driving licence (both parts, card & paper/counterpart)\n" +
        "- They have a valid insurance certificate for the car they're driving\n" +
        "- They have a valid MOT certificate for their car (if appropriate)");
}

function ExpiredMembershipAlert() {
  /************************************************************************************************
  Purpose : Show membership expired warning 
  ***********************************************************************************************/

  alert("Our records indicate that your SLAM membership has expired. We invite you to renew this " +
        "as soon as possible. If you wish to book an observed drive, you will need to contact " +
        "the Membership Secretary to renew your membership beforehand.\n\nIf you have " +
        "already renewed your membership, please ignore this message - the system will be updated " +
        "with your new details shortly. If you wish to book an observed drive in this case, please " +
        "contact us by telephone to arrange your booking ...");
}

function ShowHelp(strWebPage) {
  /************************************************************************************************
  Purpose : Displays the "Help" popup window
  ***********************************************************************************************/

  var strConfig = "toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no,status=no,resizable=yes,height=600,width=550";
  window.open(strWebPage, "ShowHelp", strConfig);
}

function ShowArchive() {
  /************************************************************************************************
  Purpose : Displays the audit archive window
  ***********************************************************************************************/

  var strConfig = "toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no,status=no,resizable=yes,height=700,width=800";
  window.open("AdminAuditArchive.aspx", "ShowArchive", strConfig);
}

function MembershipNoRequiredAlertForMember() {
  /************************************************************************************************
  Purpose : Show reminder to collect/update membership number 
  ***********************************************************************************************/

  alert("This member has a temporary membership number which should be updated as soon as possible. " + 
        "Please check to see if they have a SFL form and forward details to the Membership Secretary " +
        "if they have  ...");
}

