// write full qualified links if not on dev site
var HrefPrefix='';
var ImgPrefix='';

function urlPrefix(srcType) {
    
    if (testDev != -1) {
        // on dev site
        if (srcType == 'href') {
            HrefPrefix = '';    
            return HrefPrefix;
        } else {
            ImgPrefix = '';
            return ImgPrefix;
        }
    } else if (testPlayNC != -1) {
        // for the playNC template, the image src prefix is different than the href src
        if (srcType == 'href') {
            HrefPrefix = 'http://lineage.trifle.net';    
            return HrefPrefix;
        } else {
            ImgPrefix = '/lin2';
            return ImgPrefix;
        }
    } else if (testSupport != -1) {
        // for the RNW template, image src and href source are the same
        if (srcType == 'href') {
            HrefPrefix = 'http://lineage.trifle.net';    
            return HrefPrefix;
        } else {
            ImgPrefix = 'http://lineage.trifle.net';
            return ImgPrefix;
        }        
    } else { 
        if (srcType == 'href') {
            HrefPrefix = 'http://lineage.trifle.net';    
            return HrefPrefix;
        } else {
            ImgPrefix = '';
            return ImgPrefix;
        }
    }
}    

    //dissect the url to look for mainsection
    var url = location.href;
    var testNews = url.indexOf('/news', 0);
    var testArchive = url.indexOf('/archive', 0);    
    var testBackground = url.indexOf('/background', 0);
    var testGuide = url.indexOf('/guide', 0);    
    var testKnowledge = url.indexOf('/Knowledge', 0);
    var testCommunity = url.indexOf('/community', 0);
    var testBoards = url.indexOf('boards.', 0);    
    var testDownloads = url.indexOf('/pds', 0);    
    var testSupport = url.indexOf('support.', 0);
    var testHome = 1;
    
    var testDev = url.indexOf('172.', 0);
    var testPlayNC = url.indexOf('plaync.com', 0);
    
    var whichPage = '';

    /*check all conditions to determine home page
    if (testNews == -1 && testAbout == -1 && testCommunity == -1 && testGallery == -1 && testSupport == -1 && testLinks == -1) {
        testHome = 1;
    } else {
        testHome = 0;
    }
    */

