<!--

//
// Script    :   fes_smr_functions.js
// Author    :   C.E. Berry
// Version   :   1.00
// Notes     :   Javascript function library for addional functions for SalesMentor website
//
//               All material contained within is the intellectual property of SysExcel Ltd.
//               and as such may not be reproduced in any way shape or form without the prior
//               consent of SysExcel Ltd..
//
// Amendment Log
//
//      Version      Date           Author              Notes
//      -------      ----           ------              -----
//
//      1.00        08/02/2007     C.E. Berry           Creation
//
//=================================================================================================

function fncReDirCountdown(prm_secs, prm_form_switch, prm_location_or_form, prm_display_countdown, prm_redir_name)
//
// Function to redirect page after a specific time
//
// Arguments
//
//  prm_secs                Number of seconds before redirect
//  prm_form                Switch to indicate whether to submit a form or do a location redirect,
//                          1 - submit a form, 0 - location redirect
//  prm_location_or_form    Location to redirect to or form to submit
//  prm_display_countdown   1 - display countdown message in status bar, 0 - don't display message
//  prm_redir_name          Name to be displayed by redirect message
//

{
    prm_secs = prm_secs - 1;

    if (prm_secs <= 0)
    {
        if (prm_form_switch)
        {
            document.forms[prm_location_or_form].submit();

        }

        else
        {
            window.location.replace(prm_location_or_form);

        }

    }

    else
    {
        if (prm_display_countdown)
        {
            window.status = 'Redirecting to ' + prm_redir_name + ' in ' + prm_secs + ' seconds';

        }

        setTimeout('fncReDirCountdown(' + prm_secs + ',' + prm_form_switch + ',\"' + prm_location_or_form + '\",' + prm_display_countdown + ',\"' + prm_redir_name + '\")',1000);

    }

}

//=================================================================================================

function fncReDirPageLoaded (prm_initial_secs, prm_form_switch, prm_location_or_form, prm_display_countdown, prm_redir_name)
//
// Function to call inital redirect on page being loaded
//
// Arguments
//
//  prm_initial_secs        Number of seconds before redirect
//  prm_form                Switch to indicate whether to submit a form or do a location redirect,
//                          1 - submit a form, 0 - location redirect
//  prm_location_or_form    Location to redirect to or form to submit
//  prm_display_countdown   1 - display countdown message in status bar, 0 - don't display message
//  prm_redir_name          Name to be displayed by redirect message
//

{
    fncReDirCountdown (prm_initial_secs, prm_form_switch, prm_location_or_form, prm_display_countdown, prm_redir_name);

}

//-->