function ltrim (s)
{
    return s.replace( /^\s*/, "" );
}

function rtrim (s)
{
    return s.replace( /\s*$/, "" );
}

function trim (s)
{
    return rtrim(ltrim(s));
}

function isValidEmail(emailAddress) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    return re.test(emailAddress);
}

function XpopOpen (URL, nme, h, w)
{
    window.open (URL, nme, 'toolbar=1,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=' + w + ',height=' + h);
}

function popOpen (URL, nme, prop)
{
    window.open (URL, nme, 'toolbar=1,scrollbars=1,location=0,status=1,menubar=0,resizable=1,'+prop);
}

function track(b)
{
    if (b == false) return;

    var i = 0;
    var anchors = document.body.getElementsByTagName('A');
    var s = '';
    var l = '';
    var t = '';

    for (i=0; i < anchors.length; i++) {
        l = anchors[i].href;
        if (l.indexOf ('pinecone') == -1) {
            if (l.indexOf ('void') == -1) {
                anchors[i].onmouseover = function () {window.status = ''; return true;};
                anchors[i].onmouseout = function () {window.status = "";  return true;};
                if ( l.indexOf ('mailto') == -1) {
                    t = anchors[i].innerText;
                    if (t == '') t = "Image"

                    if (t.indexOf ('http') == -1) {
                        s = 'http://www.pinecone.com/tracker.asp?rr=' + escape(l) + '&t=' + escape(t) + '&as=' + escape(anchors[i].title);
                        anchors[i].href = s;
                        //anchors[i].onclick = function () { alert (s); return true;};
                    }
                }
            }
        }
    }

}


