function Omniture() { this.prop1 = "wm"; this.prop2 = "acp"; this.server = window.location.host; this.prop13=s.getTimeParting('h','+10'); // Set hour this.prop14=s.getTimeParting('d','+10'); // Set day if(typeof Omniture._initialized == "undefined") { Omniture.prototype.print = function() { var str = "page type=" + this.pageType; str += "\nsection=" + this.section; str += "\nsubsection=" + this.subsection; str += "\ntitle=" + this.title; str += "\nrelated=" + this.related; str += "\n\ns.pageName=" + this.pageName; str += "\ns.channel=" + this.channel; str += "\ns.server=" + this.server; str += "\ns.prop1=" + this.prop1; str += "\ns.prop2=" + this.prop2; str += "\ns.prop3=" + this.prop3; str += "\ns.prop4=" + this.prop4; str += "\ns.prop5=" + this.prop5; str += "\ns.prop6=" + this.prop6; str += "\ns.prop7=" + this.prop7; str += "\ns.prop11=" + this.prop11; str += "\ns.prop12=" + this.prop12; str += "\ns.prop13=" + this.prop13; str += "\ns.prop14=" + this.prop14; str += "\ns.prop15=" + this.prop15; str += "\ns.prop16=" + this.prop16; str += "\ns.prop17=" + this.prop17; str += "\ns.prop18=" + this.prop18; str += "\ns.prop19=" + this.prop19; str += "\ns.prop20=" + this.prop20; str += "\ns.prop21=" + this.prop21; str += "\ns.hier1=" + this.hier1; str += "\ns.eVar7=" + this.eVar7; str += "\ns.eVar17=" + this.eVar17; str += "\ns.eVar18=" + this.eVar18; str += "\ns.eVar19=" + this.eVar19; str += "\ns.eVar20=" + this.eVar20; str += "\ns.eVar21=" + this.eVar21; str += "\ns.products=" + this.products; str += "\ns.events=" + this.events.join(','); //if(typeof this.prop4 != "undefined")alert("set"); alert(str); }; Omniture.prototype.setOmniture = function() { this.setPageName(); this.setChannel(); this.setProp3(); this.setProp4(); this.setProp5(); this.setProp6(); this.setProp7(); this.setProp11(); this.setProp12(); this.setProp20(); this.setHier1(); this.setAutoSearchParams(); this.set_eVars1to12(); this.set_videoPageVars(); this.setAutoSearcheVars(); this.setEvents(); }; Omniture.prototype.setSearchVars = function() { }; Omniture.prototype.setChannel = function() { this.channel = "wm:" + this.section; }; Omniture.prototype.setPageName = function() { switch(this.section) { case "home": this.pageName = "wm:home"; break; case "in the magazine": this.pageName = "wm:" + this.section + ":" + this.title; break; case "": this.pageName = ""; break; default: if(this.related) { this.pageName = "wm:" + this.section + ":" + this.subsection + ":" + this.title + ":" + this.related; } else if(this.title) { this.pageName = "wm:" + this.section + ":" + this.subsection + ":" + this.title; } else if(this.subsection) { this.pageName = "wm:" + this.section + ":" + this.subsection; } else { this.pageName = "wm:" + this.section; } } }; Omniture.prototype.getPageExtension = function(divider) { if(!this.pageType) return false; var str = ""; switch(this.pageType) { case "index": str = divider + "landing page"; break; default: } return str; }; Omniture.prototype.setProp3 = function() { switch(this.section) { case "in the magazine": this.prop3 = "wm:" + this.section + ":" + this.title; break; default: if(this.subsection) { this.prop3 = "wm:" + this.section + ":" + this.subsection; } else { this.prop3 = "wm:" + this.section; } } }; Omniture.prototype.setProp4 = function() { switch(this.section) { case "in the magazine": this.prop4 = ""; break; default: if(this.title) { this.prop4 = "wm:" + this.section + ":" + this.subsection + ":" + this.title; } else { this.prop4 = ""; } } }; Omniture.prototype.setProp5 = function() { if(this.related) { this.prop5 = "wm:" + this.section + ":" + this.subsection + ":" + this.title + ":" + this.related; } else { this.prop5 = ""; } }; Omniture.prototype.setProp6 = function() { //if(!this.subsection || this.subsection != "search" || !args['query'])return false; if(!this.section || this.section != "wheels search" || !args['query'])return false; this.prop6 = (unescape(args['query'])).toLowerCase(); }; Omniture.prototype.setProp7 = function() { if((typeof searchResultskeyword == "undefined") || searchResultskeyword.length ==0)return false; var x = 0; for(var i in searchResultskeyword) { x = i; } if(x == 1) { this.prop7 = "zero"; } else { this.prop7 = x + "-" + (parseInt(x) + 9); } }; Omniture.prototype.setProp11 = function() { this.prop11 = "wm:" + this.section; }; Omniture.prototype.setProp12 = function() { if(this.related) { this.prop12 = this.related + " " + this.title; } else if(this.title) { switch(this.section) { case 'in the magazine': this.prop12 = 'in the magazine ' + this.title; break; default: this.prop12 = this.title; } } else if(this.subsection) { this.prop12 = this.subsection; } else if(this.section) { this.prop12 = this.section; } else { this.prop12 = this.pageType; } }; Omniture.prototype.setProp20 = function() { if(typeof autoSearchStart == "undefined" || typeof autoSearchCount == "undefined")return false; this.prop20 = autoSearchStart + "-" + autoSearchCount; if(this.prop7 && this.prop7 == "zero")this.prop20 = this.prop7; }; Omniture.prototype.setHier1 = function() { var tempArray = this.pageName.split(':'); this.hier1 = tempArray.join('|'); }; Omniture.prototype.getShowroomCar = function() { var winLoc = window.location.toString().split('/'); for(var i = 0; i < winLoc.length; i++) { if(winLoc[i].search(/showroom/gi) != -1)return (unescape(winLoc[i+1])).toLowerCase().replace(/\+/gi, " "); } }; Omniture.prototype.loadPageType = function() { this.pageType = (unescape(document.forms[0].PageType.value)).toLowerCase(); if(this.pageType == "error") this.pageType = "errorPage"; }; Omniture.prototype.loadSection = function() { if(typeof document.forms[0].Section == "undefined")return false; var section = (unescape(document.forms[0].Section.value)).toLowerCase(); var pageTitle = (unescape(document.forms[0].PageTitle.value)).toLowerCase(); switch(section) { case "library": if(typeof document.forms[0].Subsection != "undefined") { switch(pageTitle) { case 'wheels - comparison cart details': this.section = "comparison cart"; break; case 'wheels - search results': this.section = "wheels search"; break; case 'wheels - newsletter': this.section = "newsletter signup"; break; case 'wheels - showroom': this.section = "showroom"; break; case 'wheels - sitemap': this.section = "sitemap"; break; default: } //this.section = "showroom"; } else { this.section = section.toLowerCase(); } break; case "showroom": pageTitle = (unescape(document.forms[0].Title.value)).toLowerCase(); if(pageTitle == "showroom search") { this.section = "auto search"; } else { this.section = section.toLowerCase(); } break; case 'car of the year': this.section = 'library'; this.subsection = 'car of the year home page'; break; case 'features': var subsection = (document.forms[0].Subsection && document.forms[0].Subsection.value.length > 0) ? (unescape(document.forms[0].Subsection.value)).toLowerCase() : null; if(subsection && subsection == 'specials') { //this.section = this.getParentTitle(); this.section = 'specials'; } else { this.section = section.toLowerCase(); } break; default: this.section = section.toLowerCase(); } }; Omniture.prototype.loadSubsection = function() { if((!this.section) || (this.pageType == "home" && this.section != "showroom") || (typeof document.forms[0].Subsection == "undefined") || (document.forms[0].Subsection.value == "" && this.section != "showroom")) return false; switch(this.section) { case 'comparison cart': case 'wheels search': case 'newsletter signup': break; case "showroom": var title = (unescape(document.forms[0].Title.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); if(this.pageType == "home" && title == "showroom") { //do nothing } else if(this.pageType == "home" && title != "showroom search") { this.subsection = "showroom"; } else if(this.pageType == "home" && title == "showroom search") { this.subsection = "showroom search"; } else if(title.search(/comparison/gi) != -1) { this.subsection = "comparison cart"; } else { this.subsection = document.getElementById('makemodel').firstChild.nodeValue.toLowerCase(); } break; case "library": /* if(document.forms[0].Subsection.value == "Showroom") { this.subsection = "comparison cart"; } else if(document.forms[0].Subsection.value == "Search") { this.subsection = "search"; } else { this.subsection = (unescape(document.forms[0].Subsection.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); } */ break; case 'specials': this.subsection = this.getParentTitle(); break; default: this.subsection = (unescape(document.forms[0].Subsection.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); } }; } Omniture._initialized = true; } function replaceChr(str) { if(str != " ")return ""; return " "; }