function trackRefer()
/*
    document.referrer is the referring url. findBaseNane strips it of
    everything other than the domain name and trackDB writes the info
    to the referrer table in the database.
*/
    {
        return;   // Not capturing referring stuff at this time
    }

    function trackClick(el)
    {
        var urlTrack = el.href;
        var baseName = findBaseName(urlTrack);
        var str;
        
        trackDB(baseName,"Track");
    }
  
    function trackDB(baseName,table)
    {
/*
    This method uses AJax to send the XMLHttpRequest to the ./trackStats.php
    routine with the tracking name that needs to be logged into the DB on the server side.
    The code was modeled after examples at www.w3schools.com/PHP/php_ajax_database.asp.
    
    In essence the xmlhttp = new part creates an empty object that will guide us
    sending a request to the trackStats.php script that communicates with the database.
    The xmlhttp.onreadystatechange function waits for the php script to finish and then if the
    state of the conversation is OK, reads the reponse from the script. In this small example the
    response will not be any html elements or parts but either "success" or a database error message
    that will get displayed in an alert box.
*/
        return;        
        if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
        {
            xmlhttp=new XMLHttpRequest();
        }
        else                       // code for IE6, IE5
        {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)  // Need to understand these status codes
            {
                 if (xmlhttp.responseText != "success")
                 {
                    alert(xmlhttp.responseText);
                 };
            }
        }
        
        trackCode = "./sections/TrackingSection.php?url=" + baseName +"&table=" + table; 
        xmlhttp.open("GET",trackCode,true);
        xmlhttp.send();
    }
    function findBaseName(url) 
    {   
        var urlStart, urlEnd;
        
        if(url.length == 0)
        {
            return "empty";
        }
      
 /*
   First determine if this is an internal page regardless of testing environment
 */
        if (url.indexOf("brlnc.org") != -1)    // In testing domain, needs to be at position 7 or 8
        {
             urlStart = url.lastIndexOf("/") + 1;
             urlEnd = url.length - 1
             return url.substr(urlStart,urlEnd-urlStart + 1);
        }     
        else if(url.indexOf("riverdancenc.com") != -1)  // In real domain, needs to be at position 7 or 8
        {
             urlStart = url.lastIndexOf("/") + 1;
             urlEnd = url.length - 1
             return url.substr(urlStart,urlEnd-urlStart + 1);
        }
        else if(url.indexOf("file") == 0)                   // On local disk, needs to be at position 0
        { 
             urlStart = url.lastIndexOf("/") + 1;
             urlEnd = url.length - 1
             return url.substr(urlStart,urlEnd-urlStart + 1);  
        }
        else 
        {
            urlStart = url.indexOf(("//")) + 2;             // Find the beginning of the domain name
            urlEnd = url.indexOf("/",urlStart) - 1;
        }

        return url.substr(urlStart,urlEnd-urlStart + 1);
    } 
