Omniture.prototype.getGalleryImage = function() { var winLoc = window.location.toString().toLowerCase(); if(winLoc.indexOf('image=') != -1) { var winLocArray = winLoc.split('&'); for(var i = 0; i < winLocArray.length; i++) { if(winLocArray[i].indexOf('image=') != -1) { return ('image ' + (parseInt(winLocArray[i].split('=')[1]) + 1)); } } } else { return 'image 1'; } }; Omniture.prototype.loadArticleTitle = function() { if(this.pageType != "article" && this.pageType != "related" && this.section != "library")return false; if(this.pageType != "article") { if(this.section == 'specials') { this.title = (unescape(document.forms[0].Title.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); } else if(this.section == "library") { if(this.subsection == "showroom") { this.title = this.getShowroomCar(); } else { if(this.subsection != "search" || this.subsection != "car of the year home page") { this.title = (unescape(document.forms[0].Title.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); } if(this.title == "newsletter")this.title = "newsletter sign up"; } } else { this.title = this.getParentTitle(); } } else { switch(this.section) { case 'in the magazine': this.title = (unescape(document.forms[0].PublicationDate.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); break; case 'libray': break; default: this.title = (unescape(document.forms[0].Title.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); if(document.forms[0].Template && unescape(document.forms[0].Template.value) == 'domGallery') { this.title = this.title + ' ' + this.getGalleryImage(); } } /* if(this.section == "in the magazine") { this.title = (unescape(document.forms[0].PublicationDate.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); } else if(this{ this.title = (unescape(document.forms[0].Title.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); } */ } }; Omniture.prototype.loadRelatedTitle = function() { if(this.pageType != "related" || this.section == 'specials')return false; this.related = (unescape(document.forms[0].Title.value)).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); }; Omniture.prototype.getParentTitle = function() { //var alert(((unescape(document.forms[0].RelatedItems.value).split(';')).join('\n')) + '\n\n\n' + ((unescape(document.forms[0].InThisSection.value)).split(';')).join('\n')); var inThisSection = (unescape(document.forms[0].RelatedItems.value)).split(';'); var relatedArticles = (unescape(document.forms[0].InThisSection.value)).split(';'); for(var i = 0; i < relatedArticles.length; i++) { for(var n = 0 ; n < inThisSection.length; n++) { if(relatedArticles[i] == inThisSection[n]) return ((relatedArticles[i].split('|')[0]).replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}})).toLowerCase(); } } return ""; }; Omniture.prototype.setAutoSearcheVars = function() { if(!this.section || this.section != "showroom" || !this.subsection || this.subsection != "showroom search")return false; this.eVar17 = this.prop15; this.eVar18 = this.prop16; this.eVar19 = this.prop17; this.eVar20 = this.prop18; this.eVar21 = this.prop20; }; Omniture.prototype.setAutoSearchParams = function() { if(!this.section || this.section != "auto search")return false; var params = new Array(); var tempParams = (unescape(args['query'])).toLowerCase().split(';'); for(var i = 0; i < tempParams.length; i++) { var tempSplit = tempParams[i].split('|'); params[tempSplit[0]] = tempSplit[1]; } if(params['make'] && params['make'].length != 0)this.prop15 = params['make']; if(params['model'] && params['model'].length != 0) { this.prop16 = params['model']; } else { this.prop16 = ""; } if(params['fuelmin'] && params['fuelmax'] && params['fuelmax'].length != 0) { if(params['fuelmin'] == "")params['fuelmin'] = 0; this.prop17 = params['fuelmin'] + "-" + params['fuelmax']; } else { this.prop17 = ""; } if(params['minprice'] && params['maxprice'] && params['minprice'].length != 0 && params['maxprice'].length != 0) { if(params['minprice'] == "")params['minprice'] = 0; this.prop18 = params['minprice'] + "-" + params['maxprice']; } else { this.prop18 = ""; } }; Omniture.prototype.set_eVars1to12 = function() { if(this.section && this.section == "library" && this.subsection && this.subsection == "search") if(args && args['query'])this.eVar7 = (unescape(args['query'])).toLowerCase(); }; Omniture.prototype.set_videoPageVars = function() { if(this.section && this.section == "videos" && this.subsection && this.subsection == "videos") { this.eVar10 = this.title; } }; Omniture.prototype.setEvents = function() { this.events = new Array(); this.events.push('event6'); switch(this.section) { /* case "library": if(this.subsection == "search") { if(this.prop7 && this.prop7 != "zero") { this.events.push('event7'); } else { this.events.push('event8'); } } break; case "showroom": if(this.section == "auto search") { this.events.push('event12'); } else if(this.section == "comparison cart") { this.events.push('event15'); } break; */ case "videos": if(this.subsection == "videos") { this.events.push('event9'); } break; case "wheels search": if(this.prop7 && this.prop7 != "zero") { this.events.push('event7'); } else { this.events.push('event8'); } break; case "auto search": this.events.push('event12'); break; case "comparison cart": this.events.push('event15'); break; default: } }; Omniture.prototype.loadShowroomEvent = function(event) { this.events = new Array(event); switch(event) { case "event9": //alert("start of video"); var s=s_gi('acpmagwheelsprod,acpmagglobalprod'); s.linkTrackVars='events,eVar10'; s.linkTrackEvents='event9'; s.events = "event9"; s.eVar10 = this.eVar10; s.tl(oOmniture.eventVideoSrc,'o','Start of video'); break; case "event10": //alert("end of video"); var s=s_gi('acpmagwheelsprod,acpmagglobalprod'); s.linkTrackVars='events,eVar10'; s.linkTrackEvents='event10'; s.events = "event10"; s.eVar10 = this.eVar10; s.tl(this.eventVideoSrc,'o','End of video'); break; case "event14": //alert("load showroom search event called"); var s=s_gi('acpmagwheelsprod,acpmagglobalprod'); s.linkTrackVars='events,prop15,prop16,prop19,prop21,eVar21'; s.linkTrackEvents='event14'; s.prop15 = this.prop15; s.prop16 = this.prop16; s.prop19 = this.prop19; s.prop21 = this.prop21; s.eVar21 = this.prop19; s.events = 'event14'; s.tl(oOmniture.event14Src,'o','Showroom Search'); break; case "event13": //alert("adding to comparison"); var s=s_gi('acpmagwheelsprod,acpmagglobalprod'); s.linkTrackVars='events,products'; s.linkTrackEvents='event13'; s.products = this.products; s.events = 'event13'; s.tl(oOmniture.event13Src,'o','Adding car to comparison'); break; case "event16": //alert("cart comparison print event"); var s=s_gi('acpmagwheelsprod,acpmagglobalprod'); s.linkTrackVars='events,products'; s.linkTrackEvents='event16'; s.events = "event16"; s.products = this.products; s.tl(oOmniture.event16Src,'o','Print cart comparison'); break; case "event17": //alert("deleting from comparison cart"); var s=s_gi('acpmagwheelsprod,acpmagglobalprod'); s.linkTrackVars='events,products'; s.linkTrackEvents='event17'; s.products = this.products; s.events = 'event17'; s.tl(oOmniture.event17Src,'o','Deleting car from comparison'); break; default: } //this.printS(); }; Omniture.prototype.setCartComparisonVars = function(xml) { var aProducts = new Array(); var specs = xml.getElementsByTagName('Specifications')[0].getElementsByTagName('Specification'); for(var i = 0; i < specs.length; i++) { var make = specs[i].getElementsByTagName('General')[0].getElementsByTagName('Make')[0].firstChild.nodeValue; var model = specs[i].getElementsByTagName('General')[0].getElementsByTagName('Model')[0].firstChild.nodeValue; var carclass = specs[i].getElementsByTagName('General')[0].getElementsByTagName('CarClass')[0].firstChild.nodeValue; var str = (make + " " + model + " " + carclass).toLowerCase().replace(/\W/gi,function(s){if(s==" "){return " ";}else{return "";}}); aProducts.push(str); } this.products = aProducts.join(';'); s.products = aProducts.join(';'); }; Omniture.prototype.load = function() { this.loadPageType(); this.loadSection(); this.loadSubsection(); this.loadNoSecSubPages(); this.loadArticleTitle(); this.loadRelatedTitle(); }; Omniture.prototype.loadNoSecSubPages = function() { }; Omniture.prototype.setS = function() { if(typeof this.pageName != "undefined")s.pageName = this.pageName; if(typeof this.channel != "undefined")s.channel = this.channel; if(typeof this.server != "undefined")s.server = this.server; if(typeof this.pageType != "undefined")s.pageType = this.pageType; if(typeof this.prop1 != "undefined")s.prop1 = this.prop1; if(typeof this.prop2 != "undefined")s.prop2 = this.prop2; if(typeof this.prop3 != "undefined")s.prop3 = this.prop3; if(typeof this.prop4 != "undefined")s.prop4 = this.prop4; if(typeof this.prop5 != "undefined")s.prop5 = this.prop5; if(typeof this.prop6 != "undefined")s.prop6 = this.prop6; if(typeof this.prop7 != "undefined")s.prop7 = this.prop7; if(typeof this.prop11 != "undefined")s.prop11 = this.prop11; if(typeof this.prop12 != "undefined")s.prop12 = this.prop12; if(typeof this.prop13 != "undefined")s.prop13 = this.prop13; if(typeof this.prop14 != "undefined")s.prop14 = this.prop14; if(typeof this.prop15 != "undefined")s.prop15 = this.prop15; if(typeof this.prop16 != "undefined")s.prop16 = this.prop16; if(typeof this.prop17 != "undefined")s.prop17 = this.prop17; if(typeof this.prop18 != "undefined")s.prop18 = this.prop18; if(typeof this.prop19 != "undefined")s.prop19 = this.prop19; if(typeof this.prop20 != "undefined")s.prop20 = this.prop20; if(typeof this.prop21 != "undefined")s.prop21 = this.prop21; if(typeof this.hier1 != "undefined")s.hier1 = this.hier1; if(typeof this.eVar7 != "undefined")s.eVar7 = this.eVar7; if(typeof this.eVar10 != "undefined")s.eVar10 = this.eVar10; if(typeof this.eVar17 != "undefined")s.eVar17 = this.eVar17; if(typeof this.eVar18 != "undefined")s.eVar18 = this.eVar18; if(typeof this.eVar19 != "undefined")s.eVar19 = this.eVar19; if(typeof this.eVar20 != "undefined")s.eVar20 = this.eVar20; if(typeof this.eVar21 != "undefined")s.eVar21 = this.eVar21; if(typeof this.products != "undefined")s.products = this.products; if(typeof this.events == "object")s.events = this.events.join(','); if(typeof this.events == "string")s.events = this.events; }; Omniture.prototype.printS = function() { var str = ""; if(typeof s.pageName != "undefined")str+= '\ns.pageName=' + s.pageName; if(typeof s.channel != "undefined")str+= '\ns.channel=' + s.channel; if(typeof s.server != "undefined")str+= '\ns.server=' + s.server; if(typeof s.pageType != "undefined")str+= '\ns.pageType=' + s.pageType; if(typeof s.prop1 != "undefined")str+= '\ns.prop1=' + s.prop1; if(typeof s.prop2 != "undefined")str+= '\ns.prop2=' + s.prop2; if(typeof s.prop3 != "undefined")str+= '\ns.prop3=' + s.prop3; if(typeof s.prop4 != "undefined")str+= '\ns.prop4=' + s.prop4; if(typeof s.prop5 != "undefined")str+= '\ns.prop5=' + s.prop5; if(typeof s.prop6 != "undefined")str+= '\ns.prop6=' + s.prop6; if(typeof s.prop7 != "undefined")str+= '\ns.prop7=' + s.prop7; if(typeof s.prop11 != "undefined")str+= '\ns.prop11=' + s.prop11; if(typeof s.prop12 != "undefined")str+= '\ns.prop12=' + s.prop12; if(typeof s.prop13 != "undefined")str+= '\ns.prop13=' + s.prop13; if(typeof s.prop14 != "undefined")str+= '\ns.prop14=' + s.prop14; if(typeof s.prop15 != "undefined")str+= '\ns.prop15=' + s.prop15; if(typeof s.prop16 != "undefined")str+= '\ns.prop16=' + s.prop16; if(typeof s.prop17 != "undefined")str+= '\ns.prop17=' + s.prop17; if(typeof s.prop18 != "undefined")str+= '\ns.prop18=' + s.prop18; if(typeof s.prop19 != "undefined")str+= '\ns.prop19=' + s.prop19; if(typeof s.prop20 != "undefined")str+= '\ns.prop20=' + s.prop20; if(typeof s.prop21 != "undefined")str+= '\ns.prop21=' + s.prop21; if(typeof s.hier1 != "undefined")str+= '\ns.hier1=' + s.hier1; if(typeof s.eVar7 != "undefined")str+= '\ns.eVar7=' + s.eVar7; if(typeof s.eVar10 != "undefined")str+= '\ns.eVar10=' + s.eVar10; if(typeof s.eVar17 != "undefined")str+= '\ns.eVar17=' + s.eVar17; if(typeof s.eVar18 != "undefined")str+= '\ns.eVar18=' + s.eVar18; if(typeof s.eVar19 != "undefined")str+= '\ns.eVar19=' + s.eVar19; if(typeof s.eVar20 != "undefined")str+= '\ns.eVar20=' + s.eVar20; if(typeof s.eVar21 != "undefined")str+= '\ns.eVar21=' + s.eVar21; if(typeof s.products != "undefined")str+= '\ns.products=' + s.products; if(typeof s.events != "undefined")str+= '\ns.events=' + s.events; alert(str); }; function setEventVideoTarget(obj){if(typeof oOmniture == "object")oOmniture.eventVideoSrc = obj;} function setEvent13Target(obj){if(typeof oOmniture == "object")oOmniture.event13Src = obj;} function setEvent17Target(obj){if(typeof oOmniture == "object")oOmniture.event17Src = obj;}