﻿function showHelpBox(referer, helpname) {
    var helpcontent;
    if (helpname != '') {
        if (helpname == 'cms') {
            helpcontent = 'Content management systems allow you to update your own website. This can range from a simple website allowing you to change some text to an advanced system allowing you to edit customer details, keep track of orders, email your customers, run financial reports and much more, I can tailor a solution to meet your needs.'
        } else if (helpname == 'pay') {
        helpcontent = 'If you are selling online you need to think about which online payment provider offers the best solution for you, I can help explain the differences and integrate the desired solution into <br /> your website.'
        } else if (helpname == 'track') {
            helpcontent = 'Tracking tools can be very valuable to help you target customers and improve sales or hits to your website. I can integrate these tools into your website and help you get the most from them.'
        } else if (helpname == 'ecom') {
        helpcontent = 'E-commerce websites sell goods or services online. I have built many e-commerce websites over the years <br />and can help you get your business selling online.'
        } else if (helpname == 'email') {
            helpcontent = 'From setting up email for your company to designing and sending emails to your clients, whatever your requirements I can help.'
        }
        changeHTML('boxHelp', helpcontent);
        showObj('boxHelp');
        moveObj('boxHelp', getRealLeft(referer) + 15, getRealTop(referer));
    }
}
function getRealLeft(el) {
    xPos = el.offsetLeft;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function getRealTop(el) {
    yPos = el.offsetTop;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return yPos;
}
function showObj(obj) {
    if (bTypeNs) {
        var pObj = (NN4) ? document[obj] : document.getElementById(obj).style;
    } else {
        var pObj = document.all[obj].style;
    }
    pObj.visibility = VISIBLE;
}


function hideObj(obj) {
    if (bTypeNs) {
        var pObj = (NN4) ? document[obj] : document.getElementById(obj).style;
    } else {
        var pObj = document.all[obj].style;
    }
    pObj.visibility = HIDDEN;
}

function moveObj(obj, oLeft, oTop) {
    if (bTypeNs) {
        var pObj = (NN4) ? document[obj] : document.getElementById(obj).style;
    } else {
        var pObj = document.all[obj].style;
    }
    pObj.left = oLeft + 'px';
    pObj.top = oTop + 'px';
}
function changeHTML(obj, text) {
    if (bTypeNs) {
        var pObj = (NN4) ? document[obj] : document.getElementById(obj);
    } else {
        var pObj = document.all[obj];
    }
    pObj.innerHTML = text;
}

// determine browser version
var bTypeNs = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var NN4 = false;
var NN6 = false;
var IE4 = false;
if (bTypeNs) {
    if (parseInt(navigator.appVersion) < 5) {
        NN4 = true;
    } else {
        NN6 = true;
    }
} else { IE4 = true; }

// determine platform
var isMac = navigator.appVersion.indexOf('Mac') > 0 ? 1 : 0;

// setup defaults
var HIDDEN = (NN4) ? 'hide' : 'hidden';
var VISIBLE = (NN4) ? 'show' : 'visible';
var navVersion = parseInt(navigator.appVersion);
