var omni_account = ''; omni_account = 'lifewaynewsletters'; var host = 'http://www.lifeway.com'; function variable(){ var oSupport = new OmniSupport(); this.args = arguments; this.key = this.args[0]; if (this.key == "products"){ if (this.args[1].indexOf(";") != 0) { this.value = oSupport.cleanProducts(";" + this.args[1]); }else{ this.value = oSupport.cleanProducts(this.args[1]); } }else{ this.value = oSupport.clean(this.args[1]); } this.delimeter = ","; if (this.args.length >= 3) this.delimeter = this.args[2]; }; /*Private Variables*/ function Omniture(oaccount){ var oSupport = new OmniSupport(); var myProps = new Object(); var linkInternalFilters = getLinkInternalFilters(oaccount); var account = getAccount(oaccount); var runAJAX = true; var oIsValid = true; /*Priviledged Routines*/ this.setObjectVar = function(){ myProps[arguments[0]] = arguments[1]; }; this.setVar = function (){ var args = arguments; var v = new variable(args[0],args[1]); myProps[v.key] = v.value; if (myProps.debugLevel == "1" || myProps.debugLevel == "3") alert('key = ' + v.key + '\nvalue = ' + v.value); }; this.appendVar = function (){ var args = arguments; var v; if (args.length >= 3){ v = new variable(args[0],args[1],args[2]); }else{ v = new variable(args[0],args[1]); } if (!myProps[v.key]){ if (myProps.debugLevel == "1" || myProps.debugLevel == "2") alert('value is empty'); this.setVar(v.key, v.value); if (myProps.debugLevel == "1" || myProps.debugLevel == "3") alert('value = ' + v.value); } else if (myProps[v.key] == "") { if (myProps.debugLevel == "1" || myProps.debugLevel == "2") alert('value is empty'); this.setVar(v.key, v.value); if (myProps.debugLevel == "1" || myProps.debugLevel == "3") alert('value = ' + v.value); }else{ if (myProps.debugLevel == "1" || myProps.debugLevel == "2") alert('value is NOT empty'); myProps[v.key] += v.delimeter + v.value; if (myProps.debugLevel == "1" || myProps.debugLevel == "3") alert('key = ' + v.key + '\nvalue = ' + v.value); } }; this.getVar = function (key){ var myReturn = ""; if (myProps[key]){ if (myProps[key].length > 0){ if (myProps.debugLevel == "1" || myProps.debugLevel == "4") alert(key + '=' + myProps[key]); myReturn = myProps[key]; } } return myReturn; }; this.clear = function (key){ if (myProps[key]) myProps[key] = ""; }; this.clearAll = function (){ for (x in myProps){this.clear(x);} }; this.addCartItem = function (objOnClick, txtProducts, intCartItems){ var label, strProp6 = null; if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; label = 'Add To Cart'; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'scAdd'; myProps.s.events = 'scAdd'; if (intCartItems == 0){ myProps.s.linkTrackEvents += ',scOpen'; myProps.s.events += ',scOpen'; label = 'Open & ' + label; } myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', label); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = (' + myProps.s.products + ')\nlabel = ' + label); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.removeCartItem = function (objOnClick, txtProducts){ var label; if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; label = 'Remove from Cart'; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'scRemove'; myProps.s.events = 'scRemove'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', label); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = ' + myProps.s.products + '\nlabel = ' + label); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.checkout = function (objOnClick, txtProducts){ var label; if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; label = 'Checkout'; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'scCheckout'; myProps.s.events = 'scCheckout'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', label); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = ' + myProps.s.products + '\nlabel = ' + label); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.genericEvent = function (objOnClick, txtEventLabel){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProp = myProps.s.prop8; var locEVar = myProps.s.eVar8; myProps.s.linkTrackVars = 'events,prop8,eVar8'; myProps.s.linkTrackEvents = 'event8'; myProps.s.events = 'event8'; myProps.s.prop8 = oSupport.clean(txtEventLabel); myProps.s.eVar8 = oSupport.clean(txtEventLabel); myProps.s.tl(objOnClick, 'o', oSupport.clean(txtEventLabel)); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nprop8 = ' + myProps.s.prop8 + '\neVar8 = ' + myProps.s.eVar8); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.prop8 = locProp; myProps.s.eVar8 = locEVar; } } }; this.genericPropOnlyEvent = function (objOnClick, txt){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locProp = myProps.s.prop8; myProps.s.linkTrackVars = 'prop8'; myProps.s.linkTrackEvents = 'None'; myProps.s.prop8 = oSupport.clean(txt); myProps.s.tl(objOnClick, 'o', oSupport.clean(txt)); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('prop8 = ' + myProps.s.prop8); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.prop8 = locProp; } } return true; }; this.typeaheadEvent = function (objOnClick, filter, char_count, selection, char_typed, term_selected){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locProp43 = myProps.s.prop43; var locProp44 = myProps.s.prop44; var locProp45 = myProps.s.prop45; var locProp46 = myProps.s.prop46; var locProp47 = myProps.s.prop47; myProps.s.linkTrackVars = 'prop43,prop44,prop45,prop46,prop47'; myProps.s.linkTrackEvents = 'None'; myProps.s.prop43 = filter; myProps.s.prop44 = char_count; myProps.s.prop45 = selection; myProps.s.prop46 = term_selected; myProps.s.prop47 = char_typed; myProps.s.tl(objOnClick, 'o', oSupport.clean(filter) + ':' + oSupport.clean(char_count) + ':' + oSupport.clean(selection) + ':' + oSupport.clean(char_typed) + ':' + oSupport.clean(term_selected)); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('prop43 = ' + myProps.s.prop43 + '\nprop44 = ' + myProps.s.prop44 + '\nprop45 = ' + myProps.s.prop45 + '\nprop46 = ' + myProps.s.prop46 + '\nprop47 = ' + myProps.s.prop47); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.prop43 = locProp43; myProps.s.prop44 = locProp44; myProps.s.prop45 = locProp45; myProps.s.prop46 = locProp46; myProps.s.prop47 = locProp47; } } return true; }; this.downloadEvent = function (objOnClick, fileName, txtProducts){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ if (txtProducts.length > 0){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProp = myProps.s.prop14; var locEVar = myProps.s.eVar10; var locProducts = myProps.s.products; myProps.s.linkTrackVars = 'events,prop14,eVar10,products'; myProps.s.linkTrackEvents = 'event5'; myProps.s.events = 'event5'; myProps.s.prop14 = oSupport.clean(fileName); myProps.s.eVar10 = oSupport.clean(fileName); myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'd'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nprop14 = ' + myProps.s.prop14 + '\neVar10 = ' + myProps.s.eVar10 + '\nproducts = ' + myProps.s.products); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.prop14 = locProp; myProps.s.eVar10 = locEVar; myProps.s.products = locProducts; } else { var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProp = myProps.s.prop39; var locEVar = myProps.s.eVar18; myProps.s.linkTrackVars = 'events,prop39,eVar18'; myProps.s.linkTrackEvents = 'event18'; myProps.s.events = 'event18'; myProps.s.prop39 = oSupport.clean(fileName); myProps.s.eVar18 = oSupport.clean(fileName); myProps.s.tl(objOnClick, 'd'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nprop39 = ' + myProps.s.prop39 + '\neVar18 = ' + myProps.s.eVar18); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.prop39 = locProp; myProps.s.eVar18 = locEVar; } } } }; this.merchandisingEvent = function (objOnClick, ruleName, txtProducts, blnABTest){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProp = myProps.s.prop36; var locEVar = myProps.s.eVar11; var locEVar2 = myProps.s.eVar19; var locProducts = myProps.s.products; var linkTrackVars = 'events,prop36,eVar11'; if (txtProducts.length > 0){ linkTrackVars += ',products'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); } if (typeof(blnABTest) != "undefined"){ if (blnABTest == "true"){ linkTrackVars += ',eVar19'; myProps.s.eVar19 = oSupport.clean(ruleName); }; }; myProps.s.linkTrackVars = linkTrackVars; myProps.s.linkTrackEvents = 'event14'; myProps.s.events = 'event14'; myProps.s.prop36 = oSupport.clean(ruleName); myProps.s.eVar11 = oSupport.clean(ruleName); myProps.s.tl(objOnClick, 'o', 'Merchandising Click'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nprop36 = ' + myProps.s.prop36 + '\neVar11 = ' + myProps.s.eVar11 + '\nproducts = ' + myProps.s.products); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.prop36 = locProp; myProps.s.eVar11 = locEVar; myProps.s.eVar19 = locEVar2; myProps.s.products = locProducts; } } return true; }; this.didYouMeanEvent = function (objOnClick, txt){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProp = myProps.s.prop37; var locEVar = myProps.s.eVar12; myProps.s.linkTrackVars = 'events,prop37,eVar12'; myProps.s.linkTrackEvents = 'event15'; myProps.s.events = 'event15'; myProps.s.prop37 = oSupport.clean(txt); myProps.s.eVar12 = oSupport.clean(txt); myProps.s.tl(objOnClick, 'o', 'Did You Mean? Click'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nprop37 = ' + myProps.s.prop37 + '\neVar12 = ' + myProps.s.eVar12); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.prop37 = locProp; myProps.s.eVar12 = locEVar; } } return true; }; this.dimensionSuggestionEvent = function (objOnClick, dimension){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProp = myProps.s.prop38; var locEVar = myProps.s.eVar13; myProps.s.linkTrackVars = 'events,prop38,eVar13'; myProps.s.linkTrackEvents = 'event16'; myProps.s.events = 'event16'; myProps.s.prop38 = oSupport.clean(dimension); myProps.s.eVar13 = oSupport.clean(dimension); myProps.s.tl(objOnClick, 'o', 'Dimension Suggestion Click'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nprop38 = ' + myProps.s.prop38 + '\neVar13 = ' + myProps.s.eVar13); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.prop38 = locProp; myProps.s.eVar13 = locEVar; } } return true; }; this.upSellEvent = function (objOnClick, txtProducts){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'event4'; myProps.s.events = 'event4'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', 'UpSell'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = ' + myProps.s.products + '\nlabel = UpSell'); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.adClickEvent = function (objOnClick, txt){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locProp = myProps.s.prop42; myProps.s.linkTrackVars = 'prop42'; myProps.s.linkTrackEvents = 'None'; myProps.s.prop42 = oSupport.clean(txt); myProps.s.tl(objOnClick, 'o', 'Ad Click'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('prop42 = ' + myProps.s.prop42); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.prop42 = locProp; } } return true; }; this.adImpressionEvent = function (txt){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locProp = myProps.s.prop41; myProps.s.linkTrackVars = 'prop41'; myProps.s.linkTrackEvents = 'None'; myProps.s.prop41 = oSupport.clean(txt); myProps.s.tl(true, 'o', 'Ad Impression'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('prop41 = ' + myProps.s.prop41); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.prop41 = locProp; } } return true; }; this.crossSellEvent = function (txt){ if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEVar = myProps.s.eVar9; var locEVar2 = myProps.s.eVar11; myProps.s.linkTrackVars = 'eVar9,eVar11'; myProps.s.linkTrackEvents = 'None'; myProps.s.eVar9 = oSupport.clean(txt); myProps.s.eVar11 = oSupport.clean('cross-sell'); myProps.s.tl(true, 'o', 'Cross-Sell'); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('eVar9= ' + myProps.s.eVar9 + '\neVar11= ' + myProps.s.eVar11); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.eVar9 = locEVar; myProps.s.eVar11 = locEVar2; } } return true; }; this.bhSaveCart = function (objOnClick, txtProducts){ var label; if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; label = 'Save Cart'; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'event14'; myProps.s.events = 'event14'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', label); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = ' + myProps.s.products + '\nlabel = ' + label); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.bhResaveCart = function (objOnClick, txtProducts){ var label; if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; label = 'Resave Cart'; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'event15'; myProps.s.events = 'event15'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', label); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = ' + myProps.s.products + '\nlabel = ' + label); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.bhMergeCart = function (objOnClick, txtProducts){ var label; if (this.isValidClient()){ if (typeof(myProps.s) != "undefined"){ var locLinkTrackVars = myProps.s.linkTrackVars; var locLinkTrackEvents = myProps.s.linkTrackEvents; var locEvents = myProps.s.events; var locProducts = myProps.s.products; label = 'Merge Cart'; myProps.s.linkTrackVars = 'events,products'; myProps.s.linkTrackEvents = 'event16'; myProps.s.events = 'event16'; myProps.s.products = oSupport.cleanProducts(";" + txtProducts.replace(/,/g,",;")); myProps.s.tl(objOnClick, 'o', label); if (myProps.debugLevel == "1" || myProps.debugLevel == "5") alert('events = ' + myProps.s.events + '\nproducts = ' + myProps.s.products + '\nlabel = ' + label); myProps.s.linkTrackVars = locLinkTrackVars; myProps.s.linkTrackEvents = locLinkTrackEvents; myProps.s.events = locEvents; myProps.s.products = locProducts; } } }; this.getPrefix = function (){ var channel = this.getVar("channel"); var myReturn = ""; switch (channel.toLowerCase()) { case "store": case "2009/yourvbs": case "2009/clubvbs": case "2010/yourvbs": case "2010/clubvbs": case "extra": case "fuge": case "threadsmedia": case "blogs": case "centrikid": myReturn = channel + ":"; break; } return myReturn; }; this.updatePagename = function (){ var prefix = this.getPrefix(); if (prefix.length > 0) { if (this.getVar("pageName").length > 0) this.setVar("pageName", prefix + this.getVar("pageName")); } }; this.isValidClient = function(){ var myReturn = true; if (myProps.agent.match(/gomez/gi) != null || myProps.agent.match(/ktxn/gi) != null){ myReturn = false; }else if (myProps.querystring.match(/gomez=/gi) != null){ myReturn = false; } return myReturn; }; /*Private Routines*/ function getAccount(account){ if (typeof(account) != "undefined"){ if (account.length > 0){ switch (account.toLowerCase()){ case "lifewayworshipdev": account = "lifewaydev"; break; case "lifewayworshipprod": account = "lifewaydev"; break; case "bhpublishingdev": account = "lifewaybhdev"; break; case "bhpublishingprod": account = "lifewaybhprod"; break; case "bhb2bdev": account = "lifewaybhb2bdev"; break; case "bhb2bprod": account = "lifewaybhb2bprod"; break; case "lifewaystoresdev": account = "lifewaystoresdev"; break; case "lifewaystoresprod": account = "lifewaystoresprod"; break; case "ningdev": account = "lifewayningdev"; break; case "ningprod": account = "lifewayningprod"; break; case "emedialinkdev": case "lessonsprod": case "sbdsdev": case "staticdev": case "blogsdev": case "threadsdev": case "vbsdev": case "lifewaydev": account = "lifewaydev"; break; case "lifewaynewsletters": case "bibletools": case "cems": case "emedialinkprod": case "sbdsprod": case "staticprod": case "blogsprod": case "threadsprod": case "vbsprod": case "lifewayprod": account = "lifewayprod"; break; default: account = "lifewaydev"; break; } } } return account; }; function getLinkInternalFilters(account){ var linkInternalFilters = "javascript:"; if (typeof(account) != "undefined"){ if (account.length > 0){ switch (account.toLowerCase()){ case "lifewayworshipdev": linkInternalFilters += ",lifewayworship.com"; break; case "lifewayworshipprod": linkInternalFilters += ",lifewayworship.com"; break; case "bhpublishingdev": case "bhb2bdev": linkInternalFilters += ",bhpublishinggroup.com,bhpublishinggroup.test,bhpublishinggroup.office"; break; case "bhpublishingprod": case "bhb2bprod": linkInternalFilters += ",bhpublishinggroup.com"; break; case "lifewaystoresdev": linkInternalFilters += ",lifewaystores.com,lifewaystores.test,lifewaystores.office"; break; case "lifewaystoresprod": linkInternalFilters += ",lifewaystores.com"; break; case "ningdev": case "ningprod": linkInternalFilters += ",ning.com"; break; case "emedialinkdev": case "lessonsprod": case "sbdsdev": case "staticdev": case "blogsdev": case "threadsdev": case "vbsdev": case "lifewaydev": linkInternalFilters += ",lifeway.com,lifeway.test,lifeway.office,bssb.org,threadsmedia.test,threadsmedia.com,emedialink.dev,emedialink.test,emedialink.model,emedialink.com,lifewaylessons.com,christianemailservice.test"; break; case "lifewaynewsletters": case "bibletools": case "emedialinkprod": case "sbdsprod": case "staticprod": case "cems": case "blogsprod": case "threadsprod": case "vbsprod": case "lifewayprod": linkInternalFilters += ",lifeway.com,threadsmedia.com,emedialink.com,christianemailservice.com"; break; default: linkInternalFilters += ",lifeway.com,lifeway.test,lifeway.office,bssb.org,lifewaystores.com,lifewaystores.test,lifewaystores.office,bhpublishinggroup.com,bhpublishinggroup.test,bhpublishinggroup.office,lifewayworship.com,threadsmedia.test,threadsmedia.com,emedialink.test,emedialink.com,ning.com,christianemailservice.com"; break; } } } return linkInternalFilters; }; /*Initialize Properties*/ this.setVar("debugLevel", "0"); this.setVar("account", account); this.setVar("linkInternalFilters", linkInternalFilters); this.setVar("eVar3", "browse"); }; function OmniSupport(){ this.cleanProducts = function (value){ value = this.clean(value); var arrItems = value.split(","); var item, arrPieces, counter, title, sku, y, z var newValue, newPiece, arrProduct, product; var newCat, newProd, newQu, newPr, newEv, newEvar newValue = ""; for (z = 0; z < arrItems.length; z++){ item = arrItems[z]; arrPieces = item.split(";"); counter = -1; newPiece = ""; product = ""; title = ""; sku = ""; newCat = ""; newProd = ""; newQu = ""; newPr = ""; newEv = ""; newEvar = ""; for (y = 0; y < arrPieces.length; y++){ piece = arrPieces[y]; counter++; switch (counter){ case 0: newCat += piece; break; case 1: arrProduct = piece.split(">"); for (var x = 0; x < arrProduct.length; x++){ product = arrProduct[x]; if (x == 0){ newProd += ";" + product; //sku = product; }else if (x == 1){ //newProd += ">" + product; //title = product; } } break; case 2: newQu += ";" + piece; break; case 3: newPr += ";" + piece; break; case 4: newEv += ";" + piece; break; case 5: newEvar += ";" + piece; break; } } if (title.length > 0){ if (newEvar.indexOf("evar") > -1){ newEvar += "|evar11=" + title; }else{ newEvar += ";evar11=" + title; } } if (sku.length > 0){ if (newEvar.indexOf("evar") > -1){ newEvar += "|evar12=" + sku; }else{ newEvar += ";evar12=" + sku; } } if (newEvar.length > 0){ if (newEv.length == 0) newEv = ";"; if (newPr.length == 0) newPr = ";"; if (newQu.length == 0) newQu = ";"; if (newProd.length == 0) newProd = ";"; }else if (newEv.length > 0){ if (newPr.length == 0) newPr = ";"; if (newQu.length == 0) newQu = ";"; if (newProd.length == 0) newProd = ";"; }else if (newPr.length > 0){ if (newQu.length == 0) newQu = ";"; if (newProd.length == 0) newProd = ";"; }else if (newQu.length > 0){ if (newProd.length == 0) newProd = ";"; } if (newValue.length == 0){ newValue = newCat + newProd + newQu + newPr + newEv + newEvar; }else{ newValue += "," + newCat + newProd + newQu + newPr + newEv + newEvar; } } newValue = this.clean(newValue); return newValue; } this.clean = function (ovalue){ //alert("value: "+value); var value = ovalue + ""; //Replace special characters with their respective English equivalent value = value.replace(/(\xc3\x80)|(À)/gi, "a"); value = value.replace(/(\xc3\x81)|(Á)/gi, "a"); value = value.replace(/(\xc3\x82)|(Â)/gi, "a"); value = value.replace(/(\xc3\x83)|(Ã)/gi, "a"); value = value.replace(/(\xc3\x84)|(Ä)/gi, "a"); value = value.replace(/(\xc3\x85)|(Å)/gi, "a"); value = value.replace(/(\xc3\x86)|(Æ)/gi, "ae"); value = value.replace(/(\xc3\x87)|(Ç)/gi, "c"); value = value.replace(/(\xc3\x88)|(È)/gi, "e"); value = value.replace(/(\xc3\x89)|(É)/gi, "e"); value = value.replace(/(\xc3\x8a)|(Ê)/gi, "e"); value = value.replace(/(\xc3\x8b)|(Ë)/gi, "e"); value = value.replace(/(\xc3\x8c)|(Ì)/gi, "i"); value = value.replace(/(\xc3\x8d)|(Í)/gi, "i"); value = value.replace(/(\xc3\x8e)|(Î)/gi, "i"); value = value.replace(/(\xc3\x8f)|(Ï)/gi, "i"); value = value.replace(/(\xc3\x91)|(Ñ)/gi, "n"); value = value.replace(/(\xc3\x92)|(Ò)/gi, "o"); value = value.replace(/(\xc3\x93)|(Ó)/gi, "o"); value = value.replace(/(\xc3\x94)|(Ô)/gi, "o"); value = value.replace(/(\xc3\x95)|(Õ)/gi, "o"); value = value.replace(/(\xc3\x96)|(Ö)/gi, "o"); value = value.replace(/(\xc3\x98)|(Ø)/gi, "o"); value = value.replace(/(\xc3\x99)|(Ù)/gi, "u"); value = value.replace(/(\xc3\x9a)|(Ú)/gi, "u"); value = value.replace(/(\xc3\x9b)|(Û)/gi, "u"); value = value.replace(/(\xc3\x9c)|(Ü)/gi, "u"); value = value.replace(/(\xc3\x9d)|(Ý)/gi, "y"); value = value.replace(/(\xc3\xa0)|(à)/gi, "a"); value = value.replace(/(\xc3\xa1)|(á)/gi, "a"); value = value.replace(/(\xc3\xa2)|(â)/gi, "a"); value = value.replace(/(\xc3\xa3)|(ã)/gi, "a"); value = value.replace(/(\xc3\xa4)|(ä)/gi, "a"); value = value.replace(/(\xc3\xa5)|(å)/gi, "a"); value = value.replace(/(\xc3\xa6)|(æ)/gi, "ae"); value = value.replace(/(\xc3\xa7)|(ç)/gi, "c"); value = value.replace(/(\xc3\xa8)|(è)/gi, "e"); value = value.replace(/(\xc3\xa9)|(é)/gi, "e"); value = value.replace(/(\xc3\xaa)|(ê)/gi, "e"); value = value.replace(/(\xc3\xab)|(ë)/gi, "e"); value = value.replace(/(\xc3\xac)|(ì)/gi, "i"); value = value.replace(/(\xc3\xad)|(í)/gi, "i"); value = value.replace(/(\xc3\xae)|(î)/gi, "i"); value = value.replace(/(\xc3\xaf)|(ï)/gi, "i"); value = value.replace(/(\xc3\xb1)|(ñ)/gi, "n"); value = value.replace(/(\xc3\xb2)|(ò)/gi, "o"); value = value.replace(/(\xc3\xb3)|(ó)/gi, "o"); value = value.replace(/(\xc3\xb4)|(ô)/gi, "o"); value = value.replace(/(\xc3\xb5)|(õ)/gi, "o"); value = value.replace(/(\xc3\xb6)|(ö)/gi, "o"); value = value.replace(/(\xc3\xb8)|(ø)/gi, "o"); value = value.replace(/(\xc3\xb9)|(ù)/gi, "u"); value = value.replace(/(\xc3\xba)|(ú)/gi, "u"); value = value.replace(/(\xc3\xbb)|(û)/gi, "u"); value = value.replace(/(\xc3\xbc)|(ü)/gi, "u"); value = value.replace(/(\xc3\xbd)|(ý)/gi, "y"); value = value.replace(/(\xc3\xbf)|(ÿ)/gi, "y"); //Remove any character not in the standard ASCII printable character set, minus quotes. value = value.replace(/[^ !#$%&\(\)\*\+,-\.\/:;<=>\?@\[\\\]^\{\|\}~\w]/gi, ""); if (value.length == 0){ value = ovalue; } return value.toLowerCase(); }; } function doWhenReady(fn){ if (customIsReady){eval(fn); return;} // Mozilla, Opera and webkit nightlies currently support this event if (document.addEventListener){ // Use the handy event callback document.addEventListener("DOMContentLoaded", function(){ document.removeEventListener("DOMContentLoaded", arguments.callee, false); customIsReady = true; eval(fn); }, false); // If IE event model is used } else if (document.attachEvent){ // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", function(){ if (document.readyState === "complete") { document.detachEvent("onreadystatechange", arguments.callee); customIsReady = true; eval(fn); } }); // If IE and not an iframe // continually check to see if the document is ready if (document.documentElement.doScroll && window == window.top)(function(){ if (customIsReady){return;} try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch( error ) { setTimeout( arguments.callee, 0 ); return; } customIsReady = true; eval(fn); })(); } } function adjustAllAnchorTags() { var arrLinks = document.getElementsByTagName("a"); if (typeof document.addEventListener != "undefined") { for (var i=0; i < arrLinks.length; i++) { changeOrebHost(arrLinks[i]); doFileDownloadForOmniture("listener", arrLinks[i]); } } else if (typeof document.attachEvent != "undefined") { var objThis; for (var i=0; i < arrLinks.length; i++) { changeOrebHost(arrLinks[i]); doFileDownloadForOmniture("attach", arrLinks[i]); } } } function changeOrebHost(link){ switch (objOmni.getVar("account")){ case "lifewaydev_test": link.href = link.href.replace(/jasondev.bssb.org:82/ig,'www.lifeway.test'); link.href = link.href.replace(/jasondev.bssb.org/ig,'www.lifeway.test'); link.href = link.href.replace(/jasondev/ig,'www.lifeway.test'); break; case "lifewayprod": link.href = link.href.replace(/oreb.bssb.org/ig,'www.lifeway.com'); link.href = link.href.replace(/oreb/ig,'www.lifeway.com'); break; } } function doCleanPoundSigns(link) { if (objOmni.getVar("account").match(/bhb2b/gi) == null && objOmni.getVar("account").match(/internal/gi) == null){ if (link.href == "#" || link.href == (location.href + "#")){ link.href = ""; } } } function doFileDownloadForOmniture(e, link) { if (e == "listener") { link.addEventListener("click", mozillaDownloadEvent, false); link.addEventListener("contextmenu", mozillaDownloadEvent, false); } else if (e == "attach") { link.attachEvent("onclick", ieDownloadEvent); link.attachEvent("oncontextmenu", ieDownloadEvent); } } function mozillaDownloadEvent() { if (isDownload(this.href) && !(isProductDownload(String(this.onclick)))) { objOmni.downloadEvent(this, cleanURL(this.href), ""); } } function ieDownloadEvent() { objThis = arguments[0].srcElement; while ((objThis.nodeName) && (objThis.nodeName.toLowerCase() != "a")) { if (objThis.parentNode) { objThis = objThis.parentNode; } else { break; } } if (objThis.nodeName.toLowerCase() == "a") { if (isDownload(objThis.href) && !(isProductDownload(String(objThis.onclick)))) { objOmni.downloadEvent(objThis, cleanURL(objThis.href), ""); } } } function isDownload(strURL){ var arrURL = strURL.split("?"); var strPath = ""; var strParams = ""; if (arrURL.length > 0) { strPath = arrURL[0]; } if (arrURL.length > 1) { for (var i=1; i < arrURL.length; i++) { strParams = strParams + "?" + arrURL[i]; } } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert ("strURL = " + strURL + "\nstrPath = " + strPath + "\nstrParams = " + strParams); if (checkForMediaServer(strPath)) { if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isDownload - returning TRUE"); return true; } if (checkForDownloadExceptions(strURL)) { if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isDownload - returning TRUE"); return true; } if (checkForDownloadExtensions(strPath)) { if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isDownload - returning TRUE"); return true; } if (checkForClickthru(strPath)) { if (checkForMediaServer(strParams)) { if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isDownload - returning TRUE"); return true; } if (checkForDownloadExtensions(strParams)) { if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isDownload - returning TRUE"); return true; } } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isDownload - returning FALSE"); return false; } function checkForClickthru(strURL) { var blnReturn = false; if ((strURL.search(/common\/clickthru/i) >= 0) && (strURL.search(/,link/i) >= 0)){ blnReturn = true; } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("checkForClickthru -\nstrURL = " + strURL + "\nblnReturn = " + blnReturn); return blnReturn; } function checkForMediaServer(strURL) { var blnReturn = false; var strPatt = /play\.asp|playstream\.asp|playmedia\.asp|playvideo\.asp|player-wma\.asp/i; if ((strURL.search(/media\.lifeway\.com/i) >= 0) && (strURL.search(strPatt) >= 0)) { blnReturn = true; } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("checkForMediaServer -\nstrURL = " + strURL + "\nblnReturn = " + blnReturn); return blnReturn; } function checkForDownloadExceptions(strURL) { var blnReturn = false; var strPatt = /\/file\/\?id=|\/fileclick\/\?id=/i; if (strURL.search(strPatt) >= 0) { blnReturn = true; } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("checkForDownloadExceptions -\nstrURL = " + strURL + "\nblnReturn = " + blnReturn); return blnReturn; } function checkForDownloadExtensions(strURL) { var blnReturn = false; var strPatt = /\.asp|\.aspx|\.cgi|\.css|\.dll|\.htm|\.html|\.js|\.jsp|\.php/i; var arrPath = strURL.split("/"); var strFile = arrPath[arrPath.length-1]; // if the href is a script or mailto, then ignore if (strURL.search(/javascript:|mailto:/i) < 0) { // check for a domain-only href. if so, clear out the filename, because it is a domain instead. for (var i=0; i < arrPath.length; i++) { if (arrPath[i] == "") { if (i+1 == arrPath.length-1) { strFile = "domain instead of file"; break; } } } // if the extension is not in the list, then it is a download if (strFile.search(/\./i) >= 0) { if (strFile.search(strPatt) < 0) { blnReturn = true; } } } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("checkForDownloadExtensions -\nstrURL = " + strURL + "\nstrFile = " + strFile + "\nblnReturn = " + blnReturn); return blnReturn; } function isProductDownload(strOnclick) { var strPatt = /objOmni\.downloadEvent/i; var blnReturn = false; if (strOnclick.search(strPatt) >= 0) { blnReturn = true; } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("isProductDownload -\nstrOnclick = " + strOnclick + "\nblnReturn = " + blnReturn); return blnReturn; } function cleanURL(strURL) { var arrPath = strURL.split("/"); var i; // get rid of akamai portion of URL if (strURL.search(/akamai\.net/i) >= 0) { if (arrPath.length > 7) { // clear variable and add protocol strURL = "http:/"; // add everthing after the akamai stuff for (i=7; i < arrPath.length; i++) { strURL += "/" + arrPath[i]; } } // get rid of clickthru portion of URL } else if ((strURL.search(/common\/clickthru/i) >= 0) && (strURL.search(/,link/i) >= 0)){ var arrParams = strURL.split("?"); if (arrParams.length > 1) { // clear variable and add back everything after the ? strURL = ""; for (i=1; i < arrParams.length; i++) { strURL += "?" + arrParams[i]; } // remove the ?x= portion, which just leaves the real url strURL = strURL.substr(3); // if virtual path, go add on the hostname if ((strURL.substr(0,1) == "/") && (arrPath.length >= 2)) { strURL = "http://" + arrPath[2] + strURL; } } } //if the URL is > 100 chars, truncate it. if (strURL.length > 100) { strURL = ""; for (i=arrPath.length-1; i >= 0; i--) { if (strURL.length + arrPath[i].length < 89) { strURL = "/" + arrPath[i] + strURL; } else { break; } } strURL = "http://..." + strURL; } if (objOmni.getVar("debugLevel") == "1" || objOmni.getVar("debugLevel") == "6") alert("cleanURL -\nstrURL = " + strURL); return strURL; } var customIsReady = false; var objOmni = new Omniture(omni_account); document.write('<'+'script'+' language="javascript" type="text/javascript" src="'+host+'/stats/common/validate.asp">');