if (typeof local == 'undefined')
{
    local = {};
}

if (typeof local.utilities == 'undefined')
{
    local.utilities = {};
}

local.utilities.pageOnLoadHandlerOpen = function()
{
    local.utilities.hideJavascriptMessage();
}

local.utilities.pageOnLoadHandlerClose = function()
{
    //local.ajax.start();
}

local.utilities.pageOnUnLoadHandlerOpen = function()
{

}

local.utilities.pageOnUnLoadHandlerClose = function()
{

}

local.utilities.hideJavascriptMessage = function()
{
    var messageElement = document.getElementById('javascriptMessage');
    if ( ! (messageElement == null) )
    {
        messageElement.style.display='none';
    }
}

local.utilities.askSamLink = function(text)
{
    this.emailLink('askSam', 'bodyfitpersonaltraining.co.uk', text);
}

local.utilities.emailLink = function(who, domain, text)
{
    if ( text == null )
    {
        text = who + '@' + domain;
    }

    document.write('<a href="mailto:' + who + '@' + domain + '">' + text + '</a>');
}

// Line Splitter Function
// copyright Stephen Chapman, 19th April 2006
// you may copy this code but please keep the copyright notice as well
local.utilities.splitLine = function(st,n)
{
    var b = '';
    var s = st;
    while (s.length > n) {
        var c = s.substring(0,n);
        var d = c.lastIndexOf(' ');
        var e =c.lastIndexOf('\n');
        if (e != -1) d = e;
        if (d == -1) d = n;
        b += c.substring(0,d) + '\n';
        s = s.substring(d+1);
    }
    return b+s;
}
