function cleanArray(actual){
var newArray = new Array();
for(var i = 0; i < actual.length; i++){
if (actual[i]){
newArray.push(actual[i]);
}
}
return newArray;
}
function buildOmniVars(){
var arrPath = new Array();
var counter = 0;
var pageName = "";
var fileName, i;
arrPath = cleanArray(document.location.pathname.split("/"));
i = arrPath.length-1;
if (i >= 0) {
fileName = arrPath[i];
if (fileName.indexOf(".") < 0)
arrPath.push("index");
if (fileName.indexOf("default") >= 0)
arrPath[i] = "index";
}
else {
arrPath.push("index");
}
for (var i=0; i < arrPath.length; i++) {
if (arrPath[i] != "") {
counter++;
//colon is the delimiter, so if this is not the first word, put it in there
if (pageName != "") {
pageName += ":";
}
//remove everything after the dot
pageName += arrPath[i].replace(/\.[a-zA-Z0-9]+$/,"");
//channel is only the first item found
if (counter == 1) {
objOmni.setVar("channel", pageName);
}
//props are the menu structure incrementally
if (counter < 5) {
objOmni.setVar("prop"+counter, pageName);
}
}
}
//pageName is the entire menu structure
if (pageName != "") {
objOmni.setVar("pageName", pageName);
}
//prop5 is the page type
objOmni.setVar("prop5", "static page view");
}
buildOmniVars();