﻿// JScript File
<!--// Southampton City Council Javascript - V0.1  10th Oct 2006
    //  Description: Simple routines to support payment pages
    //  Browsers: General version - for all
  var sccReceiptWindow;
  var sccButtonName;
  var sccButton;
  var sccTextStatus = "Processing, please wait...."
  var sccTextBusy1 = " Processing...."
  var sccTextBusy2 = "....please wait."
  //alert("Javscript active");  

  function showBusy(id,message)
  { // The button was clicked and so show we're going to do some work both in the button and on
    //  the status line
    sccButtonName = id;
    if(message != null && message != "")               // Any replacement like "Searching"
    {  sccTextBusy1 = message + "...."; }               // Use it
    sccButton = document.getElementById(sccButtonName); // Get the id of the button and store it away
    if(sccButton == null)   {return;}                   // Have we got something?
    window.status = sccTextStatus ;                     // Show some more work...
    displayBusy1();
  }

  function displayBusy1()
  { // Happens on submit
    if(sccButton == null)   {return;}                   // Have we got something?
    sccButton.value = sccTextBusy1;                     // Make it obvious there is something happening
    window.setTimeout("displayBusy2()", 800);           // Display the required associated image soon..
  }

  function displayBusy2()
  { // Happens on submit
    if(sccButton == null)   {return;}                   // Have we got something?
    sccButton.value = sccTextBusy2;                     // Make it obvious there is something happening
    window.setTimeout("displayBusy1()", 1600);          // Display the required associated image soon..
  }
  
  // sccReceipt - open a window to provide a payment Receipt
  function showReceipt(windowName,link)
  { // Action on ShowReceipt click
    if (link==null) {return;}
    if (windowName==null)  {windowName = "SCCReceipt";}
    scc_receiptWindow = window.open(link,windowName,"channelmode=no,location=no,status=yes," + 
                              "directories=no,menubar=yes,toolbar=yes,resizable=yes," +
                              "scrollbars=yes,width=680,height=700,left=30,top=30");
    scc_receiptWindow.focus;
  }
//-->



