﻿function addPageView(newpage)
{
    var loc = location.href;
    var extension = '';
    //1. remove querystrings, #'s and .aspx/.htm/.html
    if(loc.indexOf('.htm') > 0){extension = loc.indexOf('.htm');}
    if(loc.indexOf('.html') > 0){extension = loc.indexOf('.html');}
    if(loc.indexOf('.aspx') > 0){extension = loc.indexOf('.aspx');}
    //2. remove domain
    firstfolderindex=loc.indexOf(loc.split('/')[3]);
    //3. concatenate
    loc = '/' + loc.substring(firstfolderindex,extension) + newpage;
    //4. track
    pageTracker._trackPageview(loc);
}

