// Global variables **********************************************************

var pageSetupFunctions = new Array();
var eoaddress = "anm.mlist" + "@" + "icequake.com" + "?subject=Employment%20Opportunity [" + new Date() + "]";
var eoaddress2 = "cam01" + "@" + "icequake.com" + "?subject=Employment%20Opportunity [" + new Date() + "]";

// Misc funtions *************************************************************

function windowForward(url)
{
   // need this so we can breakpoint/debug window location loading.
   window.location = url;
}

function timedWindowForward(seconds, url)
{
   window.setTimeout(function(){windowForward(url);}, Math.round(seconds * 1000));
}

function visit(url)
{
    if (url.match(/webmail/i)) {
        url="https://webmail.limuru.ca/";
    } else if (url.match(/opportunity2/i) && eoaddress2) {
        url="mailto:" + eoaddress2
    } else if (url.match(/opportunity/i) && eoaddress) {
        url="mailto:" + eoaddress;
    }
    windowForward(url);
}

// Page Setup functions ******************************************************

function pageSetupAddSetupFunction(func)
{
   typeof func == "function" && pageSetupFunctions.push(func);
}

function pageSetupInitialize()
{
   // call the setup functions
  for(var i = 0; i < pageSetupFunctions.length; i++)
  {
      pageSetupFunctions[i]();
  }
}

function pageSetup()
{
   // Note: To add a on page load function, use the "pageSetupAddSetupFunction" hook. (See examples below).
   
   // event listner hooks
   
   // on page load functions
   pageSetupInitialize();
}

