var s_account = '';

var Omniture = {};

Omniture.PageLoad = {	
  isWrapperPage: false,
  noPageView: false,
  detectWrapper: function() {
    if (window.wrapperTarget !== undefined) {
      Omniture.PageLoad.isWrapperPage = true;
    }
  },
  attachScriptTag: function(fname) {
    var scriptTag = document.createElement('script');
    scriptTag.setAttribute('src', '/includes/' + fname);
    document.body.appendChild(scriptTag);
  },
  customParams: {},
  setCustomParam: function(name, value) {
    this.customParams[name] = value;
  },
  setCustomParams: function(params) {
    this.customParams = params;
  },
  setPageVars: function(pageVars) {
    this.pageVars = pageVars;
  },
  getPageVars: function() {
    return this.pageVars;
  },
  getPageVar: function(key) {
    return this.pageVars[key];
  },
  normalizeGeo: function(geo) {
    //suppress bad geos
    if (this.GEOS[geo]) {
      return geo;
    } else {
      return 'us';
    }
  },
  mkPageLoadCall: function() {
    var newRepeat = Omniture.Util.getNewRepeat();
    var pageVars = this.pageVars; //pageVars should have been set in a preprocess block for this domain/section
    if (!pageVars) return;
    var p = pageVars.pageName.split(':');
    if (p.length >= 3) {
      s.prop1 = pageVars.channel + ':' + p[2];
    }
    var geo = this.normalizeGeo(pageVars.geo);
    
    s.events = pageVars.events;
    s.pageName = pageVars.pageName;
    Omniture.Util.setCookie('_prevPage', s.pageName, null, 'netapp.com');
    s.channel = pageVars.channel;
    s.hier1 = pageVars.pageName;
    s.prop10 = newRepeat;
    s.prop34 = geo;
    s.eVar12 = geo;
    s.eVar28 = newRepeat;
    s.eVar30 = pageVars.pageName;
    if(typeof GetSwfVer == 'function'){
     var flashVer = GetSwfVer();
     s.prop22 = s.getValOnce(flashVer,'flash_ver_cookie',100);
    }
    var campaign = s.getQueryParam('Media,cid,REF_SOURCE,xcid',':') || pageVars.campaign;
    if (campaign) {
      s.campaign = campaign;
      if(!Omniture.Util.getCookie('_cid')) {
        Omniture.Util.setCookie('_cid', campaign, null, 'netapp.com');
      }  
      if (pageVars.campaign) delete pageVars.campaign;
    }
    s.prop27 = (campaign != undefined && campaign.length) ? campaign : pageVars.pageName; 
    if (pageVars.referrer)
      s.referrer = decodeURIComponent(pageVars.referrer);
    var icid = Omniture.Util.getQueryParam('icid');
    if (icid) {
      s.eVar48 = icid;
    }
    for (var key in this.customParams) {
      s[key] = this.customParams[key];
    }
    var s_code = s.t();
    if (s_code) document.write(s_code);
  },
  parseTargetPath: function(path) {
    var targetPath = path.split('?')[0]; 
    var pathArray = targetPath.split('/');
    var out = pathArray.pop();
    return out;
  },
  mkWrapperCall: function() {
    var baseName = this.parseTargetPath(wrapperTarget);
    if (baseName == "r")
      baseName = this.parseTargetPath(wrapperTargetHTML);
      
    if(baseName) {  
      var params = {
        eVar6: baseName,
        events: 'event4'
      };
      Omniture.Call.customLink({href: '/' + baseName}, params, 'd');
    }  
  },
  callOmniture: function() {
    //called right after 'process' hooks
    if (this.isWrapperPage) {
      this.mkWrapperCall();
    } else {
      if(!this.noPageView) {
        this.mkPageLoadCall();
      }  
    }
  }
};

(function() {
  var geos = [
    'us',
    'uk',
    'mx',
    'jp',
    'fr',
    'ch',
    'it',
    'il',
    'in',
    'au',
    'br',
    'pt',
    'cn',
    'de',
    'ru',
    'nl',
    'es',
    'kr',
    'as',
    'se'
  ];
  Omniture.PageLoad.GEOS = {};
  for (var i = 0; i < geos.length; i++) {
    Omniture.PageLoad.GEOS[geos[i]] = 1; 
  }
})();

Omniture.SharedConfigs = {};

Omniture.SharedConfigs['WWW'] = {
  '_preprocess': function() {
    Omniture.SiteSections.WWW.preprocess();
  },
  '_postprocess': function() {
    Omniture.SiteSections.WWW.postprocess();
    Omniture.Listeners.FeaturedContentModule.attachListeners();
    Omniture.Listeners.Menu.attachMenuListeners();
    Omniture.Listeners.Menu.attachShelfListeners();
  },
  's': {
    '_preprocess': function() {
      Omniture.SiteSections.Registration.preprocess();
    }
  },
  '*': {
    'index.html': {
      '_preprocess': function() {
        Omniture.SiteSections.HomePage.preprocess();
        Omniture.Listeners.RedirectTracking.readCookie();
      },
      '_postprocess': function() {
        Omniture.SiteSections.HomePage.postprocess();
      }
    },
    'forms': {
      '_preprocess': function() {
        Omniture.SiteSections.Forms.setupParameters();
      }
    },
    'company': {
      'events': {
        'techtalk': {
          '_preprocess': Omniture.PageLoad.detectWrapper
        }
      },
      'news': {
        'articles': {
          '_preprocess': Omniture.PageLoad.detectWrapper
        }
      }
    },
    'communities': {
      'tech-ontap': {
        '_preprocess': Omniture.PageLoad.detectWrapper
      },
      '_preprocess': function() {
        Omniture.Listeners.Blogs.preprocess();
      }
    },
    'cisco-vmware': {
      '_postprocess': function() {
        Omniture.Listeners.Microsite.attachListeners();
      }
    },
    'campaigns': {
      'future-ready': {
        '_postprocess': function() {
          Omniture.Listeners.FutureReady.attachFRListeners();
        }
      },
      'it-efficiency': {
        '_postprocess': function() {
          Omniture.Listeners.GetHealthy.attachGHListeners();
        }
      },
  'datacenterfitness': {
        '_postprocess': function() {
          Omniture.Listeners.DCF.attachDCFListeners();
        }
      },
      'builton': {
        '_preprocess': function() {
          Omniture.Campaigns.EpicStory.preprocess();
        }
      }
    },
    'library': {
      '*': {
        '_preprocess': Omniture.PageLoad.detectWrapper
      },
      'premium': {
        '_preprocess': function() {
          Omniture.SiteSections.RegistrationThankYou.preprocess();
          Omniture.Listeners.FeaturedContentDownload.attachListeners();
        }
      },
      '_postprocess': function() {
        Omniture.Listeners.Library.attachListeners();
      }
    },
    'media': {
      '_preprocess': Omniture.PageLoad.detectWrapper
    },
    'partners': {
      '_postprocess': function() {
        Omniture.Listeners.Partners.attachListeners();
      }
    },
    'solutions': {
      'midsize': {
        '_preprocess': function() {
          Omniture.SiteSections.midsize.preprocess();
        },
        '_process': function() {
          Omniture.SiteSections.midsize.process();
        }  
      }  
    },
    'error': {
      '_process': function() {
        Omniture.SiteSections.WWWError.process();
      }
    }
  },
  'us': {
    'campaigns': {
      'brand': {
        'and': {
          '_preprocess': function() {
            Omniture.Campaigns.And.attachListeners();
          }
        }
      }
    },
    'company': {
      'leadership': {
        'storage-efficiency': {
          '_preprocess': function() {
            Omniture.Campaigns.SE.attachListeners();
          }
        },
        'cloud-computing': {
          'differentiate.html' : {
            '_preprocess': function() {
              Omniture.Campaigns.Diff.attachListeners();
            }
          }
        }
      }
    },
    'products': {
      'platform-os': {
        'dedupe.html': {
          '_postprocess': function() {
            Omniture.Listeners.CommunityModule.postprocess();
          }
        }
      },
      'management-software': {
        'index.html': {
          '_postprocess': function() {
            Omniture.Listeners.CommunityModule.postprocess();
          }
        },
        'sanscreen': {
          'sanscreen.html': {
            '_postprocess': function() {
              Omniture.Listeners.CommunityModule.postprocess();
            }
          }
        }
      }
    },
    'services': {
      'university': {
        'index.html': {
          '_postprocess': function() {
            Omniture.Listeners.CommunityModule.postprocess();
          }
        }
      }
    },
    'solutions': {
      'infrastructure': {
        'virtualization': {
          'desktop': {
            'index.html': {
              '_postprocess': function() {
                //Omniture.Listeners.CommunityModule.postprocess();
              }
            }
          }
        }
      }
    }
  },
  'se': {
    'storage-efficiency': {
      'contact-se-se.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessForm();
        }
      },
      'contact-confirmation-se-se.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessTY();
        }
      }
    }
  },
  'uk': {
    'storage-efficiency': {
      'contact-se-uk.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessForm();
        }
      },
      'contacts-confirmation-se-uk.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessTY();
        }
      }
    }
  },
  'fr': {
    'storage-efficiency': {
      'contacts-se-fr.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessForm();
        }
      },
      'confirmation-fr.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessTY();
        }
      }
    }
  },
  'de': {
    'storage-efficiency': {
      'contacts-se-de.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessForm();
        }
      },
      'contacts-confirmation-se-de.html': {
        '_preprocess': function() {
          Omniture.SiteSections.Forms.preprocessTY();
        }
      }
    }
  }
};


Omniture.SharedConfigs.IVA3 = {
  '*': {
     '_preprocess': function() {      
       Omniture.SiteSections.IVA3.preprocessHomePage();      
     }
  },
  'sc-20100126.html': {
    '_preprocess': function() {
      Omniture.SiteSections.IVA.preprocessContactFormPage();
    }
  },
  'ty-sc20100126.html': {
    '_preprocess': function() {
      Omniture.SiteSections.IVA.preprocessContactThankYouPage();
    }
  },
  'sc-20100126-de.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('de');
      }
   },
   'ty-sc20100126-de.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('de');
      }
   },
   'sc-20100126-es.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('es');
      }
   },
   'ty-sc20100126-es.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('es');
      }
   },
   'sc-20100126-it.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('it');
      }
   },
   'ty-sc20100126-it.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('it');
      }
   },
   'sc-20100126-fr.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('fr');
      }
   },
   'ty-sc20100126-fr.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('fr');
      }
   },
   'sc-20100126-ja.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('jp');
      }
   },
   'ty-sc20100126-ja.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('jp');
      }
   },
   'sc-20100126-ko.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('kr');
      }
   },
   'ty-sc20100126-ko.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('kr');
      }
   },
   'sc-20100126-la.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('mx');
      }
   },
   'ty-sc20100126-la.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('mx');
      }
   },
   'sc-20100126-pt.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('br');
      }
   },
   'ty-sc20100126-pt.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('br');
      }
   },
   'sc-20100126-au.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('au');
      }
   },
   'ty-sc20100126-au.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('au');
      }
   },
   'sc-20100126-in.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('in');
      }
   },
   'ty-sc20100126-in.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('in');
      }
   },
   'sc-20100126-uk.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('uk');
      }
   },
   'ty-sc20100126-uk.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('uk');
      }
   },
   'sc-20100126-nl.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('nl');
      }
   },
   'ty-sc20100126-nl.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('nl');
      }
   },
   'sc-20100126-he.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('il');
      }
   },
   'ty-sc20100126-he.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('il');
      }
   },
   'sc-20100126-zh.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('cn');
      }
   },
   'ty-sc20100126-zh.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('cn');
      }
   },
   'sc-20100126-ru.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('ru');
      }
   },
   'ty-sc20100126-ru.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('ru');
      }
   },
   'sc-20100126-ch.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('ch');
      }
   },
   'ty-sc20100126-ch.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('ch');
      }
   },
   'sc-20100126-as.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactFormPage('as');
      }
   },
   'ty-sc20100126-as.html': {
      '_preprocess': function() {
        Omniture.SiteSections.IVA.preprocessContactThankYouPage('as');
      }
   }
};



Omniture.SharedConfigs.SEMicro = {
  'setup': function(geo) {
    return {
      '_preprocess': function() {
        s_account = 'networkapplstorageefficiency';
        //var geo = window.location.host.split('.').pop();
        var pageVars = {
          pageName: geo + ':' + Omniture.Util.getNormalizedPageName(),
          channel: geo,
          geo: geo,
          events: 'event29'
        };
        Omniture.PageLoad.setPageVars(pageVars);
      }
    };
  }
};

Omniture.SharedConfigs.OSS = {
    '_preprocess': function() {
      Omniture.SiteSections.OSS.preprocess();
    },
    '_postprocess': function() {
      Omniture.Listeners.Subdomain.attachCommonListeners();
    }
};

Omniture.SharedConfigs.Career = {
    '_preprocess': function() {
      Omniture.SiteSections.Careers.preprocess();
    },
    '_postprocess': function() {
      Omniture.Listeners.Subdomain.attachCommonListeners();
    }
};

Omniture.SharedConfigs.RFP = {
    '_preprocess': function() {
      Omniture.SiteSections.RfpTool.preprocess();
    },
    '_postprocess': function() {
      Omniture.SiteSections.RfpTool.postprocess();
    }
};

Omniture.Config = {
  'dev.www.netapp.com': Omniture.SharedConfigs.WWW,
  'stage.www.netapp.com': Omniture.SharedConfigs.WWW,
  'www.netapp.com': Omniture.SharedConfigs.WWW,
  'w.on24.com': {
    '_preprocess': function() {
      Omniture.SiteSections.On24.preprocess();
    }
  },

 'stage.www.imaginevirtuallyanything.com': Omniture.SharedConfigs.IVA3,
  'dev.www.imaginevirtuallyanything.com': Omniture.SharedConfigs.IVA3,
  'www.imaginevirtuallyanything.com': Omniture.SharedConfigs.IVA3,
  'imaginevirtuallyanything.com': Omniture.SharedConfigs.IVA3,
  
  'dev.www.storage-efficiency.fr': Omniture.SharedConfigs.SEMicro.setup('fr'),
  'stage.www.storage-efficiency.fr': Omniture.SharedConfigs.SEMicro.setup('fr'),
  'www.storage-efficiency.fr': Omniture.SharedConfigs.SEMicro.setup('fr'),

  'dev.www.storage-effizienz.com': Omniture.SharedConfigs.SEMicro.setup('de'),
  'stage.www.storage-effizienz.com': Omniture.SharedConfigs.SEMicro.setup('de'),
  'www.storage-effizienz.com': Omniture.SharedConfigs.SEMicro.setup('de'),
  
  'search.netapp.com': Omniture.SharedConfigs.OSS,
  'stage.search.netapp.com': Omniture.SharedConfigs.OSS,
  'search-uk.netapp.com': Omniture.SharedConfigs.OSS,
  'search-in.netapp.com': Omniture.SharedConfigs.OSS,
  'search-as.netapp.com': Omniture.SharedConfigs.OSS,
  'search-au.netapp.com': Omniture.SharedConfigs.OSS,
  'search-cn.netapp.com': Omniture.SharedConfigs.OSS,
  'search-de.netapp.com': Omniture.SharedConfigs.OSS,
  'search-jp.netapp.com': Omniture.SharedConfigs.OSS, 
  'search-il.netapp.com': Omniture.SharedConfigs.OSS,   
  'search-ru.netapp.com': Omniture.SharedConfigs.OSS, 
  'search-fr.netapp.com': Omniture.SharedConfigs.OSS,  
  'search-it.netapp.com': Omniture.SharedConfigs.OSS,
  'search-es.netapp.com': Omniture.SharedConfigs.OSS,
  'search-mx.netapp.com': Omniture.SharedConfigs.OSS,
  'search-br.netapp.com': Omniture.SharedConfigs.OSS, 
  'search-ch.netapp.com': Omniture.SharedConfigs.OSS,
  'search-nl.netapp.com': Omniture.SharedConfigs.OSS,
  'search-kr.netapp.com': Omniture.SharedConfigs.OSS,
  'search-se.netapp.com': Omniture.SharedConfigs.OSS,
  'netapp-uk.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-in.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-as.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-au.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-cn.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-de.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-jp.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-il.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-ru.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-fr.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-it.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-es.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-mx.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-br.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-ch.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-nl.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-kr.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'netapp-se.guided.ss-omtrdc.net': Omniture.SharedConfigs.OSS,
  'careers.netapp.com': Omniture.SharedConfigs.Career,
  'stagingjobs.brassring.com': Omniture.SharedConfigs.Career,
  'www.storage-rfp.com': Omniture.SharedConfigs.RFP,
  'storage-rfp.com': Omniture.SharedConfigs.RFP,

  'communicate.netapp.com': {
    'forms': {
      '_preprocess': function() {
        Omniture.SiteSections.Eloqua.preprocessFormPage();
      }
    },
    'content': {
      '_preprocess': function() {
        Omniture.SiteSections.Eloqua.preprocessThankYouPage();
      }
    }
  },
  'investors.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Investors.preprocess();
    },
    '_postprocess': function() {
      Omniture.Listeners.Subdomain.attachCommonListeners();
    }
  },
  'seek.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Search.preprocess();
    },
    '_process': function() {
      Omniture.SiteSections.Search.process();
    },
    '_postprocess': function() {
      Omniture.Listeners.Subdomain.attachCommonListeners();
    }
  },

  'communities.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Communities.preprocess();
    }
  },
  'blogs.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Blogs.preprocess();
    }
  },
  
  'livechat.boldchat.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Chat.preprocess();
    }
  },
  'brand.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Brand.preprocess();
    }
  },
  'live.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.Live.preprocess();
    },
    'docs': {
      '_preprocess': function() {
       Omniture.SiteSections.Live.preprocessDocPage();
      }
    },
    'message': {
      '_preprocess': function() {
        Omniture.SiteSections.Live.preprocessMsgPage();
      }
    },
    'videos': {
      '_preprocess': function() {
        Omniture.SiteSections.Live.preprocessVidPage();
      }
	},
    'thread': {
      '_preprocess': function() {
        Omniture.SiteSections.Live.preprocessThrPage();
      }
    },
    'ideas': {
      '_preprocess': function() {
        Omniture.SiteSections.Live.preprocessIdeaPage();
      }
    }
  },
  'www.dedupecalc.com': {
    '_preprocess': function() {
      Omniture.SiteSections.DedupeCalc.preprocess();
    }
  },
  'mktg-web.corp.netapp.com': {
    '_preprocess': function() {
      Omniture.SiteSections.MktingWeb.preprocess();
    }
  },
  'www.secalc.com': {
    '_preprocess': function() {
      Omniture.SiteSections.SeCalc.preprocess();
    }
  }
};

Omniture.System = {
  findMatches: function(c, depth) {
    var out = [];
    if (depth === undefined) depth = 0;
    var currPathNode = this.pathArray[depth];
    var wildcardMatch = c['*'];
    var exactMatch = c[currPathNode];
    var matchList = [wildcardMatch, exactMatch];
    for (var i = 0; i < matchList.length; i++) {
      var match = matchList[i];
      if (!match) continue;
      out[out.length] = match;
      var matches = this.findMatches(match, depth+1);
      out = out.concat(matches);
    }
    return out;
  },
  getConfigNodes: function() {
    var domain = window.location.hostname;
    var path = window.location.pathname;
    var partialPathArray = path.split('/');
    var len = partialPathArray.length;
    if (partialPathArray[len-1] == '') {
      partialPathArray[len-1] = 'index.html';
    }
    len = partialPathArray.length;
    var compactArray = [];
    for (var i = 0; i < len; i++) {
      var cell = partialPathArray[i];
      if (cell != undefined && cell.length > 0)
        compactArray.push(cell);
    }
    this.pathArray = [domain].concat(compactArray);
    return this.findMatches(Omniture.Config);
  },
  callHooks: function(hookName) {
    for (var i = 0; i < this.matches.length; i++) {
      var match = this.matches[i];
      var fcn = match[hookName];
      if (fcn) fcn();
    }
  },
  preProcess: function() {
    this.matches = this.getConfigNodes();
    this.callHooks('_preprocess');
  },
  process: function() {
    this.callHooks('_process');
    Omniture.PageLoad.callOmniture();
  },
  postProcess: function() {
    this.callHooks('_postprocess');
  }
};

Omniture.Util = {
  isLive: function() {
    var domain = window.location.hostname;
    if ((domain == "dev.www.netapp.com") || (domain == "stage.www.netapp.com")) {
      return false;
    } else {
      return true;
    }
  },
  getGeo: function() {
    return window.location.pathname.substring(1, 3);
  },
  getPageName: function() {
    return window.location.pathname.substring(1).split('/').join(':');
  },
  getStrippedBasename: function() {
    return window.location.pathname.split('/').pop().split('.')[0];
  },
  getNormalizedPageName: function() {
    var path = window.location.pathname;
    var pathArray = path.split('/');
    var last = pathArray.pop(); 
    if (last == '') {
      pathArray.push('index');
    } else {
      var base = last.split('.')[0];
      pathArray.push(base);
    }
    var out = pathArray.join(':');
    return out.substring(1); //remove the leading :
  },
  getNewRepeat: function() {
    return s.getNewRepeat();
  },
  setCookie: function(key, value, exp, domain) {
    var cookieStr = escape(key) + "=" + escape(value) + (exp ? "; expires=" + exp.toUTCString() : "") + "; path=/";
    if (domain) {
      cookieStr += "; domain=" + escape(domain);
    }
    document.cookie = cookieStr;
  },
  deleteCookie: function(key, domain) {
    var exp = new Date(1970, 1, 1);
    this.setCookie(key, '', exp, domain);
  },
  getCookie: function(key) {
    if (document.cookie.length == 0) return;
    var start = document.cookie.indexOf(key + "=");
    if (start != -1) {
      var valStart = start + key.length + 1;
      var end = document.cookie.indexOf(";", valStart);
      if (end == -1) end = document.cookie.length;
      return unescape(document.cookie.substring(valStart, end));
    }
  },
  setDebug: function(val) {
    this.debugOn = val;
  },
  isDebugOn: function() {
    return this.debugOn;
  },
  log: function(thing) {
    if (this.isDebugOn() && window.console) console.log(thing);
  },
  strip: function(s) {
    var out = s;
    if (out.stripTags) { // sometimes Prototype isn't available
      out = out.replace(/</g, ' <');
      out = out.stripTags();
    }
    out = out.replace(/\s+/g, ' ');
    out = out.replace(/^\s+|\s+$/g, '');
    return out;
  },
  getQueryParams: function(sep) {
    var qs = window.location.search.substring(1); //remove the leading '?'
    if (!sep) sep = '&';
    var pairs = qs.split(sep);
    var out = {};
    for (var i = 0; i < pairs.length; i++) {
      var nvArray = pairs[i].split('=');
      var name = nvArray[0];
      var value = nvArray[1];
      out[name] = value; //no need to handle multiple values for now
    }
    return out;
  },
  getQueryParam: function(name, sep) {
    if (!this.queryParams) {
      this.queryParams = this.getQueryParams(sep);
    }
    return this.queryParams[name];
  },
  getPrevPage: function() {
      return Omniture.Util.getCookie('_prevPage');
  }
};

Omniture.Call = {
  customLink: function(element, params, type) {
    Omniture.Util.log(element);
    Omniture.Util.log(params);
    if (type === undefined) type = 'o';
    var keys = "";
    for (key in params) {
      if (keys.length > 0) keys += ',';
      keys += key;
      s[key] = Omniture.Util.strip(params[key]);
    }
    s.linkTrackVars = keys;
    s.linkTrackEvents = params.events;
    var linkName = undefined;
    if (params.linkName) {
      linkName = params.linkName;
      delete params.linkName;
    }
    s.tl(element, type, linkName);
  }
};

Omniture.Listeners = {
  Subdomain: {
    attachCommonListeners: function() {
      Omniture.Listeners.Menu.attachMenuListeners();
      Omniture.Listeners.Menu.attachShelfListeners();
      Omniture.Listeners.Share.attachListeners();
    }
  },
  Menu: {
    attachShelfListeners: function() {
      var self = this;
      $$('.shelf a').each(function(linkNode) {
        linkNode.observe(
          'mousedown', 
          function(event) {
            self.shelfClicked(event);
          }
        );
      });
    },
    shelfClicked: function(event) {
      var e = event.element();
      var text = e.innerHTML;
      Omniture.Util.setCookie('_shelfBc', text, null, 'netapp.com');
    },
    attachMenuListeners: function() {
      var self = this;
      $$('.tabWrapper a').each(
        function(linkNode) {
          linkNode.observe(
            'mousedown',
            function(event) {
              self.menuClicked(event);
            }
          );
        }
      );
    },
    menuClicked: function(event) {
      var e = event.element();
      var td = e.up('td');
      var tab = td.down('a');
      var tabName;
      if(tab.innerText) {
        tabName = tab.innerText;         
      }    
      else {
        tabName = tab.textContent;
      }
      
      var bc = tabName;
      var parentNode = e.parentNode;
      if (parentNode.tagName === 'DD') {
        var dl = $(e).up('dl');
        //var dt = dl.down('dt');
        var dt = parentNode.previous('dt');
        var a = dt.down('a');
        var subHeadName;
        if(a !== undefined) {
          subHeadName = a.innerHTML;
        }
        else {
          subHeadName = dt.innerHTML;
        }
        var leafName = e.innerHTML;
        bc += ' > ' + subHeadName + ' > ' + leafName;
      } else if (parentNode.tagName === 'DT') {
        bc += ' > ' + e.innerHTML;
      }
      Omniture.Util.setCookie('_menuBc', bc, null, 'netapp.com');
    }
  },
  RedirectTracking: {
    readCookie: function() {
      var cookieName = 'refUrl';
      var refUrl = Omniture.Util.getCookie(cookieName);
      if (!refUrl) return;
      Omniture.PageLoad.pageVars.referrer = refUrl;
      Omniture.Util.deleteCookie(cookieName);
    }
  },
  CommunityModule: {
    postprocess: function() {
      var self = this;
      var subHeadings = $$('.exploreSubHeading');
      subHeadings.each(function(subHeadNode) {
        var subHeadText = Omniture.Util.strip(subHeadNode.innerHTML);
        if (subHeadText === "Live Community Discussions") {
          self.attachListeners(subHeadNode);
          return;
        }
      });
    },
    attachListeners: function(subHeadNode) {
      $(subHeadNode.parentNode).getElementsBySelector('a').each(function(linkNode) {
        linkNode.observe('click', function(event) {
          var params = {
            linkName: 'communityfeedclick'
          };
          Omniture.Call.customLink(linkNode, params);
        });
      });
    }
  },
  FeaturedContentDownload: {
    attachListeners: function() {
      var linkNode = $$('#sp-mainContentAreaSingleCol a').first();
      linkNode.observe('click', this.mkCallback(linkNode));
    },
    mkCallback: function(linkNode) {
      return function() {
        var cookieId = 'fcReferringPage';
        var fcReferringPage = Omniture.Util.getCookie(cookieId);
        var dlUrl = linkNode.href;
        var params = {
          'eVar30': fcReferringPage,
          'eVar6': dlUrl,
          'events': 'event3'
        };
        Omniture.Call.customLink(linkNode, params);
      };
    }
  },
  FeaturedContentModule: {
    attachListeners: function() {
      var fcButton = $('fcDownloadNowBtn');
      if (!fcButton) return;
      fcButton.observe('click', this.mkFcCallback());
    },
    mkFcCallback: function() {
      var self = this;
      return function() {
        self.setReferrerCookie();
      };
    },
    setReferrerCookie: function() {
      var key = 'fcReferringPage';
      var value = Omniture.Util.getNormalizedPageName();
      Omniture.Util.setCookie(key, value, null, 'netapp.com');
    }
  },
  Library: {
    attachListeners: function() {
      var searchLinkNode = $$('.searchButtonSpanLib a').first();
      searchLinkNode.observe('click', this.mkSearchCallback());
      var formNode = $('searchForm');
      formNode.observe('submit', this.mkSearchCallback());
      var video_carousel_prev_button = $$('.jcarousel-prev').first();
      var video_carousel_next_button = $$('.jcarousel-next').first();
      if(video_carousel_prev_button !== undefined) {
        video_carousel_prev_button.observe('click', this.mkVideoCarouselCallback('previous'));
      }
      if(video_carousel_next_button !== undefined) {
        video_carousel_next_button.observe('click', this.mkVideoCarouselCallback('next'));
      }  
    },
    mkVideoCarouselCallback: function(name) {
      return function() {
        var params = {
          eVar4: 'video-library-carousel-' + name + '-button',
          events: 'event27'
        };
        Omniture.Call.customLink({href:document.location.pathname}, params);
      };
    },
    mkSearchCallback: function() {
      return function() {
        var keyword = 'library: ' + $F('keywordSearchBox');
        var pathname = window.location.pathname;
        if(pathname.indexOf('video') >= 0) {
          keyword = 'video library: ' + $F('keywordSearchBox');
        }
        var params = {
          prop42: keyword,
          eVar42: keyword,
          events: 'event8'
        };
        Omniture.Call.customLink({href:document.location.pathname}, params);
      };
    }
  },
  Blogs: {
    preprocess: function() {
      this.attachListeners();
    },
    attachListeners: function() {
      var formNode = $('blogPostSearchForm');
      formNode.observe('submit', this.mkSearchCallback());
      var linkNode = $$('.searchButtonBlogs a').first();
      linkNode.observe('click', this.mkSearchCallback());
    },
    mkSearchCallback: function() {
      return function() {
        var keyword = 'blogs: ' + $F('keywordSearchBox');
        var params = {
          prop42: keyword
        };
        Omniture.Call.customLink({href:document.location.pathname}, params);
      };
    }
  },
  Widgets: {
    attachListeners: function() {
      //this is called in a process callback, so we won't get here if prototype is not available
      var letsGetStartedElements = $$('.letsGetStartedWithBottomBorder');
      var hasLetsGetStarted = letsGetStartedElements.length;
      if (!hasLetsGetStarted) return;
      var emailUsLink = $$('.emailUs a').first();
      emailUsLink.observe('click', this.mkWidgetCallback(emailUsLink.innerHTML));
      var self = this;
      var liveChatImg = $('liveChatImage');
      if (liveChatImg) {
        liveChatImg.observe('click', self.mkWidgetCallback("Chat Initiated"));
      }
      var sideBarLinks = $$('#sideBarLink a'); //Print, Send to Colleague
      sideBarLinks.each(function(linkNode) {
        linkNode.observe('click', self.mkWidgetCallback(linkNode.innerHTML));
      });
      var widgetIcons = $$('#tagItIcons img');
      widgetIcons.each(function(iconNode) {
        var widgetName = iconNode.src.split('/').pop().split('.')[0];
        iconNode.observe('click', self.mkWidgetCallback(widgetName));
      });
    },
    mkWidgetCallback: function(linkText) {
      return function() {
        var params = {
          prop43: linkText,
          eVar43: linkText,
          events: 'event5'
        };
        Omniture.Call.customLink({href:'/' + linkText}, params);
      };
    }
  }, 
  Share: {
    attachListeners: function() {
      //this is called in a process callback, so we won't get here if prototype is not available
      var widgetLinks = $$('.sp-shareWidgetLink a');
      var printLinks = $$('.sp-icon2');
      var liveChatImg = $('liveChatImage');
      var emailUsLink = $$('.sp-emailUs a').first();
      var self = this;
      if (liveChatImg) {
        liveChatImg.observe('click', self.mkWidgetCallback("Chat Initiated"));
      }
      if (emailUsLink) {
        emailUsLink.observe('click', self.mkWidgetCallback(emailUsLink.innerHTML));
      }
     widgetLinks.each(function(widgetNode) {
        var widgetName = widgetNode.innerHTML.toLowerCase();
        widgetNode.observe('click', self.mkWidgetCallback(widgetName));
      });
      
      printLinks.each(function(widgetNode) {
        var widgetName = "Print";
        widgetNode.observe('click', self.mkWidgetCallback(widgetName));
      });
      
      var sharebarPrint = $('wibiyaToolbar_item_normal_5043493');
       if(sharebarPrint){
          sharebarPrint.observe('click', self.mkWidgetCallback("Print"));
         }
   
     var sharebarEmail = $('wibiyaToolbar_item_normal_5043533');
      if (sharebarEmail) {
        sharebarEmail.observe('click', self.mkWidgetCallback("send to a colleague"));
      }
      var sharebarFacebook = $('facebooklike');
      if (sharebarFacebook) {
        sharebarFacebook.observe('click', self.mkWidgetCallback("facebook like"));
      }
      var sharebarLinkedin = $('wibiyaToolbar_item_normal_5043229');
      if (sharebarLinkedin) {
        sharebarLinkedin.observe('click', self.mkWidgetCallback("linkedin"));
      }
      var sharebarTweetthis = $('wibiyaToolbar_item_normal_5032335');
      if (sharebarTweetthis) {
        sharebarTweetthis.observe('click', self.mkWidgetCallback("tweet this"));
      }
      var plusOne = $('wibiyaPlusOne');
      if(plusOne){
      	plusOne.observe('click', self.mkWidgetCallback("plusone"));
      }
      var youtube = $('wibiyaToolbar_item_normal_5032332');
      if(youtube){
        youtube.observe('click', self.mkWidgetCallback("youtube videos"));
      }
      var facebook = $('wibiyaToolbar_item_normal_5032329');
      if(facebook){
        facebook .observe('click', self.mkWidgetCallback("facebook"));
      }
      var twitter = $('wibiyaToolbar_item_normal_5032328');
      if(twitter){
        twitter.observe('click', self.mkWidgetCallback("twitter"));
      }
      var facebookticker = $('wibiyaToolbarTicker');
      if(facebookticker){
       facebookticker.observe('click', self.mkWidgetCallback("Facebook Ticker"));
      }
      
    },

    mkWidgetCallback: function(linkText) {
      return function() {
        var params = {
          prop43: linkText,
          eVar43: linkText,
          events: 'event5'
        };
        Omniture.Call.customLink({href:'/' + linkText}, params);
      };
    }
  },


  Spotlight: {
    attachListeners: function() {
      var spotlightContainerNode = $('sp-topBlockRightSpotlight');
      if (!spotlightContainerNode) return;
      var spotlightLinks = $$('#sp-topBlockRightSpotlight a');
      var self = this;
      spotlightLinks.each(function(linkNode) {
        linkNode.observe('click', self.mkCallback(linkNode));
      });
    },
    mkCallback: function(linkNode) {
      return function() {
        var linkText = linkNode.innerHTML;
        var pageName = Omniture.PageLoad.getPageVar('pageName');
        var params = {
          prop8: pageName + '|' + linkText
        };
        Omniture.Call.customLink({href: '/'}, params);
      };
    }
  },
  Microsite: {
    attachListeners: function() {
      var self = this;
      var op_right_links = $$('#bottomBodyRightBox a');  //overview tab
      var fs_right_links = $$('#adBarBlock a'); //feature story page
      var right_links = op_right_links.concat(fs_right_links).uniq();
      right_links.each(function(linkNode) {
        if(linkNode.href.indexOf("blogs") != -1) {
          linkNode.observe('click', self.mkCallback(linkNode, "blog"));
        }
      });
      var twitter_body_links = $$('#twtr-widget-1 a');
      var twitter_footer_links = $$('#twt-footer a');
      var twitter_ico_links = $$('#twt-ico a');
      var twitter_links = twitter_body_links.concat(twitter_footer_links).concat(twitter_ico_links).uniq();
      twitter_links.each(function(linkNode) {
        linkNode.observe('click', self.mkCallback(linkNode, "twitter"));
      });
    },
    mkCallback: function(linkNode, type) {
      return function() {
        var params = {'linkName': "micro-www-jan26|" + type + "click"};
        Omniture.Call.customLink(linkNode, params);
      };
    }

  },
  GetHealthy: {
    attachGHListeners: function() {
      var self=this;
      var socialIcons = $$('#social-contact img');
      socialIcons.each(function(node) {
        node.observe('click', function(event) {
          var img = event.findElement();
          var txt = img.alt;
          if(txt == "Live Chat") {
            txt = "Chat Initiated";
          }
          var params = {
            prop43: txt,
            eVar43: txt,
            events: 'event5'
          };
          Omniture.Call.customLink({href:'/' + txt}, params);
        });
      }); 
      
     var carouselImgs = $$('#carousel img');
      carouselImgs.each(function(node) {
        node.observe('click', function(event){
         var carouselImg = event.findElement();
          if(carouselImg.getHeight() > 320)
            self.callOmniture(carouselImg.id);
          });
      });
      //Test&Target Experience B consists of 3 static modules instead of carousel
      var modules = $$('#ADCtr a');
       modules.each(function(module) {
         module.observe('click', function(event){
          self.callOmniture(event.findElement().id);
         });
       });
    },
    callOmniture:function(id) {
        var formName = '';
         var geo = Omniture.Util.getGeo();
         if(id == 'image1' ||id == 'adImage2'){
              formName = 'indices tool';
          }else if(id == 'image3' || id == 'adImage1'){
              formName = 'se calc';
          }
          var params = {eVar47: formName, events: 'event78',prop34: geo,eVar12: geo };
          Omniture.Call.customLink({href:'/' + formName}, params);
      }
  },
DCF: {
    attachDCFListeners: function() {
      var self=this;
      var socialIcons = $$('#social-contact img, #cl-emailUs a');
      socialIcons.each(function(node) {
        node.observe('click', function(event) {
          var img = event.findElement();
          var txt = img.alt;
          var params = {
            prop43: txt,
            eVar43: txt,
            events: 'event5'
          };
          Omniture.Call.customLink({href:'/' + txt}, params);
        });
      }); 
      var geo = Omniture.Util.getGeo();
      $('adImage1').observe ('click', function (event) {
        var formName = '';        
        formName = 'se calc';
        var params = {eVar47: formName, events: 'event78',prop34: geo,eVar12: geo };
        Omniture.Call.customLink({href:'/' + formName}, params);
        }
      );
      $('adImage2').observe ('click', function (event) {
        var formName = '';        
        formName = 'indices tool';
        var params = {eVar47: formName, events: 'event78',prop34: geo,eVar12: geo };
        Omniture.Call.customLink({href:'/' + formName}, params);
        }
      );
    },
      callOmniture:function(id) {
        var formName = '';
         var geo = Omniture.Util.getGeo();
         if(id == 'adImage2'){
              formName = 'indices tool';
          }else if( id == 'adImage1'){
              formName = 'se calc';
          }
          var params = {eVar47: formName, events: 'event78',prop34: geo,eVar12: geo };
          Omniture.Call.customLink({href:'/' + formName}, params);
      }
     
  },

  FutureReady: {
    attachFRListeners: function() {
      var liveChatImg = $('liveChat');
      var emailUsImg = $('emailUs');
      var videoOpenNodes = $('open').childElements();
      
      var self = this;
      if (liveChatImg) {
        liveChatImg.observe('click', Omniture.Listeners.Share.mkWidgetCallback("Chat Initiated"));
      }
      if (emailUsImg) {
        emailUsImg.observe('click', Omniture.Listeners.Share.mkWidgetCallback("Email Us"));
      }        
      
      var socialIcons = $$('.social img');
      socialIcons.each(function(node) {
        node.observe('click', function(event) {
          var img = event.findElement();
          var txt = img.alt;
          var params = {
            prop43: txt,
            eVar43: txt,
            events: 'event5'
          };
          Omniture.Call.customLink({href:'/' + txt}, params);
        });
      });  
      
      var downloadNowNode = $('FR-Exclusive-Content-Item1').down('a');
      if(downloadNowNode) {
        downloadNowNode.observe('click', function(event) {
          Omniture.Call.customLink(downloadNowNode, {'linkName': "frlp-download-now-" + Omniture.Util.getGeo() } );
        }); 
      }
      
      if($('FR-Exclusive-Content-Item2')) {
        var reserveSpotNode = $('FR-Exclusive-Content-Item2').down('a');
        reserveSpotNode.observe('click', function(event) {
          Omniture.Call.customLink(reserveSpotNode, {'linkName': "frlp-register-now-" + Omniture.Util.getGeo() } );
        });  
      }
      
      var next = $$('.next_button').first();
      next.observe('click', function(event) {
        if(!$$('.next_button_disabled').first())
        {
          var params = {
            'events': 'event27',
            'eVar4': 'video-carousel-next-button'
          };
          Omniture.Call.customLink({'href': "/"}, params);
        }  
      });
      
      var communityTab = $('fr-cme-tab');
      var blogTab = $('fr-blog-tab');
      var twitterTab = $('fr-twitter-tab');
      
      if(communityTab) {
        communityTab.observe('click', function(event) {
          Omniture.Call.customLink({href: '/'}, {'linkName': "frlp-community-tab-click-" + Omniture.Util.getGeo() } );
        });  
      }  
      if(blogTab) {
        blogTab.observe('click', function(event) {
          Omniture.Call.customLink({href: '/'}, {'linkName': "frlp-blog-tab-click-" + Omniture.Util.getGeo() } );
        });  
      }
      if(twitterTab) {
        twitterTab.observe('click', function(event) {
          Omniture.Call.customLink({href: '/'}, {'linkName': "frlp-twitter-tab-click-" + Omniture.Util.getGeo() } );
        });  
      }
      
      videoOpenNodes.each(function(node) {
        node.observe('click', function(event) {
          //fire only on "open" not on "close"
          if($('FR-OpenVideoIcon').src.indexOf('Close') >=0) 
          {
            var params = {
              'events': 'event27',
              'eVar4': 'video-see partner video'
            };
            Omniture.Call.customLink({'href': "/"}, params);
          }
        });
      });
    }

  },
  Partners: {
    attachListeners: function() {
      var self = this;
      $('sp-mainContentAreaDoubleCol').observe('click', self.mkCallback());
    },
    mkCallback: function() {
      return function(event) {
        var clickedNode = event.findElement();
        var videoName = '';
        if (clickedNode.nodeName === "IMG" && clickedNode.parentNode.nodeName === "A" && clickedNode.parentNode.href.indexOf("playYT") != -1) {
          var anchorNode = clickedNode.up('a');
          var titleNode = anchorNode.next('p');  //look for that p node for video title
          if(titleNode !== undefined) {
            if(titleNode.innerText) {
              videoName = titleNode.innerText;         
            }    
            else {
              videoName = titleNode.textContent;
            }
          }
          var params = {
            'events': 'event33',
            'eVar2': 'partners|' + videoName
          };
          Omniture.Call.customLink(anchorNode, params);
        } //if === IMG
      };
    } // mkCallback
  }    
};

Omniture.SiteSections = {
  HomePage: {
    preprocess: function() {
      this.adServerImgNode = $$('#adImage-hp img').first();
      if (!this.adServerImgNode) return;
      this.adServerImgName = this.adServerImgNode.src.split('/').pop();
      Omniture.PageLoad.setCustomParam('prop30', 'impressions|' + this.adServerImgName);
    },
    postprocess: function() {
      this.attachBodyListeners();
      
      if (this.adServerImgNode)
        this.adServerImgNode.observe('click', this.mkAdServerCallback());
    },
    
    mkAdServerCallback: function() {
      return function(event) {
        var params = {
          prop30: 'clickthroughs|' + Omniture.SiteSections.HomePage.adServerImgName
        };
        Omniture.Call.customLink(event.findElement(), params);
      };
    },
    numbers: {
      'one': 1,
      'two': 2,
      'three': 3,
      'four': 4
    },
    tabMap: {
      'first': 'highlights',
      'second': 'news',
      'third': 'events',
      'last': 'resources'
    },
    normalizeTabName: function(name) {
      return this.tabMap[name] || name;
    },
    attachBodyListeners: function() {
      var self = this;
      var i = 1;
      $('news').observe('click', function(event) {
        var targetNode = event.findElement();
        if (targetNode.tagName != "A") return;
        if (targetNode.parentNode.tagName == "TD") return;
        var linkText = targetNode.innerHTML;
        var tabName = $('news').className.split('-')[1];
        tabName = self.normalizeTabName(tabName);
        var liNode = targetNode.up('li');
        var ulNode = liNode.parentNode;
        var i = 0;
        var linkPosition = 0;
        ulNode.childElements().each(function(childNode) {
          i++;
          if (childNode == liNode) linkPosition = i;
        });
        var pageNum = self.getPageNum();
        var pagePosition = pageNum + '.' + linkPosition;
        var params = {
          prop20: 'Hotspot: ' + tabName,
          prop25: 'Hotspot: ' + linkText,
          prop35: pagePosition
        };
        Omniture.Call.customLink(targetNode, params);
      });
      $('solutions').observe('click', function(event) {
        var targetNode = event.findElement();
         
         if (!targetNode.hasClassName("do-not-track")) {
         	
        
        var anchor = targetNode.tagName === 'A' ? targetNode : targetNode.up('a');
        if (!anchor) return;
        if (targetNode.parentNode.tagName == "TD") return; //bail out if it's a tab click
        var tabName = self.getTabName();
        var linkName = '';
        if (targetNode.hasClassName('button')) {
          var containerDiv = targetNode.up('div');
          var firstChild = containerDiv.firstDescendant();
          linkName = firstChild.innerHTML;
          if (targetNode.hasClassName('download-now')) {
            targetNode.observe(
              'click',
              Omniture.Listeners.FeaturedContentModule.setReferrerCookie()
            );
          }
        } else if (targetNode.tagName === 'IMG') {
          var anchor = targetNode.up('a');
          if (anchor.href.indexOf("library/premium") != -1) {
            targetNode.observe(
              'click',
              Omniture.Listeners.FeaturedContentModule.setReferrerCookie()
            );
          }
          linkName = targetNode.alt.split(':')[0];
          linkName = Omniture.Util.strip(linkName);
        } else {
          linkName = targetNode.innerHTML;
        }
        var params = {
          'prop39': tabName,
          'prop41': linkName
        };
        Omniture.Call.customLink(targetNode, params);
    	}
      });
    },
    getPageNum: function() {
      var n = 0;
      var out = 1; //default to page 1 if there are no page icons
      $$('#newsPages img').each(function(imgNode) {
        if (imgNode.src.indexOf("-on-") > 0) out = n;
        n++;
      });
      return out;
    },
    getTabName: function() {
      var className = $('solutions').className;
      var tabNum = className.split('-')[1];
      var n = this.numbers[tabNum];
      var selector = "#sol-tab-" + n + " a";
      var matches = $$(selector);
      var tab = matches.first();
      if(tab.innerHTML.indexOf("img") >= 0) {
        var img = $$("#sol-tab-" + n + " img").first();
        return img.alt;
      }
      else {
        return tab.innerHTML;
      }  
    }
  },
  IVA3: {
    preprocessHomePage: function() {
      var path = document.location.pathname;
      if(path.indexOf("20100126") >= 0) return;
      var pathArray = path.split('/');
      var len = pathArray.length;
      var baseName = pathArray[len-1];
      var geo = pathArray[1];
      var subDomain = document.location.host.split('.')[0];
      if (subDomain == 'dev' || subDomain == 'stage') {
        s_account = 'networkapplnetappcom-' + geo + '-dev,networkapplglobalexternal-dev';
      } else {
        s_account = 'networkapplnetappcom-' + geo + ',networkapplglobalexternal';
      }
      var pageName = geo + ":iva:";
      if (baseName && baseName.length > 0) {
        pageName += baseName.split('.')[0];
      } else {
        pageName += "index";
      }
      var pageVars = {
        pageName: pageName,
        channel: 'iva',
        geo: geo,
        events: 'event29'
      };
      this.pageName = pageVars.pageName; //used for FC cookie later
      if (document.referrer) {
        var refArray = document.referrer.split('/');
        var campaign = refArray[2];
        if (refArray[3]) campaign += '/' + refArray[3];
        pageVars.campaign = campaign;
      }
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  
  IVA: {
    setupGeo: function() {
      this.geo = Omniture.Util.getQueryParam('cc') || 'us';
      var subDomain = document.location.host.split('.')[0];
      if (subDomain == 'dev' || subDomain == 'stage') {
        s_account = 'networkapplnetappcom-' + this.geo + '-dev,networkapplglobalexternal-dev';
      } else {
        s_account = 'networkapplnetappcom-' + this.geo + ',networkapplglobalexternal';
      }
    },
    preprocess: function(eventId) {
      var pageVars = {
        pageName: 'iva:registration',
        channel: 'forms',
        geo: 'us',
        events: 'event29,event' + eventId
      };
      Omniture.PageLoad.setPageVars(pageVars);
      Omniture.PageLoad.setCustomParam('eVar47', 'IVA Registration');
    },
    preprocessFormPage: function() {
      this.preprocess(78);
    },
    preprocessThankYouPage: function() {
      this.preprocess(79);
    },
    preprocessHomePage: function() {
      var pageVars = {
        pageName: this.geo + ':iva:index',
        channel: 'iva',
        geo: this.geo,
        events: 'event29'
      };
      this.pageName = pageVars.pageName; //used for FC cookie later
      if (document.referrer) {
        var refArray = document.referrer.split('/');
        var campaign = refArray[2];
        if (refArray[3]) campaign += '/' + refArray[3];
        pageVars.campaign = campaign;
      }
      Omniture.PageLoad.setPageVars(pageVars);
    },
        
    preprocessContactFormPage: function(geo) {
      this.preprocessIvaFormPage(geo, 'sales-inquiry-form', 78, 'IVA Sales Inquiry Form');
    },
    preprocessContactThankYouPage: function(geo) {
      this.preprocessIvaFormPage(geo, 'sales-inquiry-thankyou', 79, 'IVA Sales Inquiry Form');
    },
    
    preprocessFcFormPage: function() {
      this.preprocessIvaFormPage(geo, 'featured-content-form', 78, 'IVA Featured Content Form');
    },
    preprocessFcThankYouPage: function() {
      this.preprocessIvaFormPage(geo, 'featured-content-thankyou', 79, 'IVA Featured Content Form');
    },
    
    preprocessIvaFormPage: function(geo, basePageName, eventId, formName) {
      if (!geo) geo = 'us';
      s_account = 'networkapplnetappcom-' + geo + ',networkapplglobalexternal';
      var pageVars = {
        pageName: geo + ':iva:' + basePageName,
        channel: 'iva',
        geo: geo,
        events: 'event29,event' + eventId
      };
      Omniture.PageLoad.setPageVars(pageVars);
      if (formName) {
        Omniture.PageLoad.setCustomParam('eVar47', formName);
      }
    },
    attachHomePageListeners: function() {
      var self = this;
      var intlVideoContainerNode = $$('.vodBigBG').first(); 
      if (intlVideoContainerNode) {
        intlVideoContainerNode.observe('mousedown', this.mkIntlVideoPlayCallback());
        //window.setTimeout(function() {
        //  //$('vod2').addViewListener('PLAY', 'Omniture.SiteSections.IVA.mkExecVideoCall');
        //  $('vod2').addViewListener('PLAY', 'alert');
        //}, 1000);
      } else {
        $('ivaVodMain').observe('click', self.mkVideoPlayCallback());
      }
      $$('.adBarBoxLink a').each(function(linkNode) {
        if (linkNode.href.indexOf('imaginevirtuallyanything.com/fc') > 0)
          linkNode.observe('click', self.mkFcCallback(linkNode));        
      });
      $$('#ivaCommunityArea a').each(function(linkNode) {
        linkNode.observe('click', self.mkCommunityCallback(linkNode));        
      });
    },
    mkExecVideoCall: function() {
      if (this.execCallMade) return; // we only want to call this once per page load
      this.execCallMade = true;
      var params = {
        'events': 'event33',
        'eVar2': 'iva|intl|Executive Conversation Video'
      };
      Omniture.Call.customLink({href: '/executive_conversation_video'}, params);
    },
    mkFcCallback: function(linkNode) {
      var linkText = Omniture.Util.strip(linkNode.innerHTML);
      return function() {
        Omniture.Util.setCookie('fcReferringPage', Omniture.SiteSections.IVA.pageName, null);
        var params = {
          eVar48: 'iva|' + linkText
        };
        Omniture.Call.customLink(linkNode, params);
      };
    },
    mkIntlVideoPlayCallback: function() {
      var self = this;
      return function() {
        if (self.execCallMade) return; // we only want to call this once per page load
        self.execCallMade = true;
        var params = {
          'events': 'event33',
          'eVar2': 'iva|intl|Executive Conversation Video'
        };
        Omniture.Call.customLink({href: '/executive_conversation_video'}, params);
      };
    },
    mkVideoPlayCallback: function(linkNode, position) {
      return function(event) {
        var clickedNode = event.findElement();
        var videoName = '';
        if (clickedNode.innerHTML === "Watch Video") {
          videoName = Omniture.Util.strip(clickedNode.up('td').down('p').innerHTML);
        } else if (clickedNode.nodeName === "IMG" && clickedNode.parentNode.parentNode.className == "vodThumbNailBG") {
          videoName = clickedNode.alt;
        } else {
          return;
        }
        var position = 0;
        if (videoName.indexOf("Executive") >= 0) {
          position = 1;
        } else if (videoName.indexOf("Secure") >= 0) {
          position = 2;
        } else if (videoName.indexOf("Customer") >= 0) {
          position = 3;
        } else {
          position = 'x';
        }
        var params = {
          'events': 'event33',
          'eVar2': 'iva|' + position + '|' + videoName
        };
        var anchorNode = clickedNode.up('a');
        Omniture.Call.customLink(anchorNode, params);
      };
    },
    mkCommunityCallback: function(linkNode) {
      return function() {
        var params = {
          linkName: 'micro-iva-jan26|communityclick'
        };
        Omniture.Call.customLink(linkNode, params);
      };
    }
  },
  On24: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageVars = {
        pageName: 'iva-event',
        channel: 'on24',
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  midsize: {
    preprocess: function() {
      if($$('form').last().id.indexOf('vSignUp') >= 0) {
        Omniture.PageLoad.setCustomParam('events', 'event29,event78');
        Omniture.PageLoad.setCustomParam('eVar47', 'vespa prelaunch signup form');
      }
    },
    process: function() {
      if(Omniture.Util.getStrippedBasename().indexOf('vespa-3d')>=0) {
        Omniture.PageLoad.noPageView = true;
      }       
    }
  },
  Blogs: {
    preprocess: function() {
      var geo = this.getGeo();
      var dir = document.location.pathname.split('/')[1];
     
      if (dir == "dave") {
        s_account = 'networkappldavesblog,networkapplglobalexternal';
      } else {
        s_account = 'networkapplnetappcom-' + geo + ',networkapplglobalexternal';
      }
      var pageVars = {
        pageName: geo + ':blogs:' + Omniture.Util.getNormalizedPageName(),
        channel: 'blogs',
        geo: geo,
        events: 'event29'
      };
      console.log("pageName"+pageName);
      Omniture.PageLoad.setPageVars(pageVars);
    },
    getGeo: function() {
      var pathArray = document.location.pathname.split('/');
      var dir = pathArray[1];
      var dirArray = dir.split('_');
      return Omniture.PageLoad.normalizeGeo(dirArray[0]);
    }
  },
  RegistrationThankYou: {
    preprocess: function() {
      //for some reason, c=n is set on the download pages after a registration
      var thankYouVar = Omniture.Util.getQueryParam('c');
      if (thankYouVar != 'n') return;
      Omniture.PageLoad.setCustomParam('events', 'event29,event79,event1');
      var cookieId = 'fcReferringPage';
      var fcReferringPage = Omniture.Util.getCookie(cookieId);
      if (fcReferringPage) { 
        Omniture.PageLoad.setCustomParam('eVar30', fcReferringPage);
      }
    }
  },
  Registration: {
    preprocess: function() {
      //the fc registration process currently takes folks to the root page on form completion
      //there is no thank you page on which to fire event1
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageVars = {
        pageName: 'us:registrations:form',
        channel: 'registrations',
        geo: 'us',
        events: 'event29,event78,event10'
      };
      Omniture.PageLoad.setPageVars(pageVars);
      Omniture.PageLoad.setCustomParam('eVar47', 'Registration');
      var cookieId = 'fcReferringPage';
      var fcReferringPage = Omniture.Util.getCookie(cookieId);
      if (fcReferringPage) {
        Omniture.PageLoad.setCustomParam('eVar30', fcReferringPage);
      }
    }
  },
  Eloqua: {
    preprocessFormPage: function() {
      this.preprocess(78);
    },
    preprocessThankYouPage: function() {
      this.preprocess(79);
    },
    preprocess: function(eventId) {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageVars = {
        pageName: Omniture.Util.getPageName(),
        channel: 'forms',
        geo: 'us',
        events: 'event29,event' + eventId
      };
      var referrer = Omniture.Util.getQueryParam('referrer');
      if (referrer)
        pageVars.referrer = referrer;
      Omniture.PageLoad.setPageVars(pageVars);
      var formName = Omniture.Util.getStrippedBasename();
      Omniture.PageLoad.setCustomParam('eVar47', formName);
    }
  },
  Chat: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageVars = {
        pageName: 'us:contact-us:chat:chat',
        channel: 'contact-us',
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  Forms: {
    setupParameters: function() {
      var baseName = Omniture.System.pathArray[Omniture.System.pathArray.length-1];
      var formName = Omniture.Util.getStrippedBasename();
      
      if (baseName.indexOf("sales-contact") >= 0) {
        formName = 'Sales Inquiry';
      }
      
      // formname-ty or forname-ty-yy (yy is lang code)
      if((formName.indexOf("-ty") >= 0) && ((formName.lastIndexOf("-ty") == formName.length - 3) || (formName.lastIndexOf("-ty") == formName.length - 6) ) ) {
        formName = formName.replace("-ty", "");
      }
      
      if ((document.location.search.indexOf("s=y")>= 0) || (Omniture.Util.getStrippedBasename().indexOf("-ty") >= 0) )
          this.setThankYouParams(formName);
      else
          this.setFormParams(formName);
      
    },
    setFormParams: function(formName) {
      Omniture.PageLoad.setCustomParam('events', 'event29,event78');
      Omniture.PageLoad.setCustomParam('eVar47', formName);
    },
    setThankYouParams: function(formName) {
      var events_str = 'event29,event79';
      if(formName == 'Sales Inquiry') {
        events_str += ',event80';
      }
      if(formName.indexOf('eit-msb-library') >= 0) {
        events_str += ',event1';
      }
      Omniture.PageLoad.setCustomParam('events', events_str);
      Omniture.PageLoad.setCustomParam('eVar47', formName);
      var geo = Omniture.Util.getGeo();
      Omniture.PageLoad.setCustomParam('pageName', geo + ':forms:thankyou-' + Omniture.Util.getStrippedBasename());
    },
    preprocessForm: function() {
      Omniture.PageLoad.setCustomParam('events', 'event29,event78');
      Omniture.PageLoad.setCustomParam('eVar47', Omniture.Util.getStrippedBasename());
    },
    preprocessTY: function() {
      Omniture.PageLoad.setCustomParam('events', 'event29,event79');
      Omniture.PageLoad.setCustomParam('eVar47', Omniture.Util.getStrippedBasename());
    }
  },
  Investors: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      Omniture.PageLoad.setPageVars({
        pageName: 'us:investors:' + this.getBaseName(),
        channel: 'investors',
        events: 'event29',
        geo: 'us'
      });
    },
    getBaseName: function() {
      return window.location.pathname.split('/').pop().split('.')[0] || 'index';
    }
  },
  MktingWeb: {
    preprocess: function() {
      s_account = 'netappmarketingweb';
      Omniture.PageLoad.setPageVars({
        pageName: 'us:marketingweb:' + Omniture.Util.getNormalizedPageName(),
        channel: 'marketingweb',
        events: 'event29',
        geo: 'us'
      });
    }
  },
  Communities: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageName = 'us:communities:' + Omniture.Util.getNormalizedPageName();
      if (window.location.pathname.indexOf('dave') >=0) {
		s_account = 'networkappldavesblog,networkapplglobalexternal';        
		var pageVars = {
		pageName: pageName,
		channel: 'daves blog',
		geo: 'us',
		events: 'event29'
		};
		}
      else{
		var pageVars = {
		pageName: pageName,
		channel: 'communities',
		geo: 'us',
		events: 'event29'
		};
      }
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  Careers: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageName = 'us:careers:' + Omniture.Util.getNormalizedPageName();
      var pageVars = {
        channel: 'careers',
        pageName: pageName,
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  Live: {
    preprocess: function() {
      if(window.location.pathname.indexOf('edit-video') >= 0){
      	var pageTitle = $$("#jive-compose-header h4").first().innerHTML.stripTags().replace(/\s+/g," ").strip();
      	var tempPageName = $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()});
	  	var pageName = 'us:live:video:'+ tempPageName.concat(pageTitle.toLowerCase()).join(':'); 
  	  }
  	  else if(window.location.pathname.indexOf('edit-idea') >= 0){
  	  	var pageName = 'us:live:idea:' + $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()}).join(":");
  	  }
  	  else{    	
      	var pageName = 'us:live:' + Omniture.Util.getNormalizedPageName();
  	  }
      this.setPageVars(pageName);
    },    
    preprocessDocPage: function() {    	
      if(window.location.pathname.indexOf('edit') >= 0){
	      	var pageName = 'us:live:docs:' + $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()}).join(":");	      
      }
      else{	
	      var pageTitle = $$(".jive-content-title h2").first().innerHTML.stripTags().replace(/\s+/g," ").strip();	            
	      var tempPageName = $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()});
	      var pageName = 'us:live:docs:'+tempPageName.without(tempPageName.last()).concat(pageTitle.toLowerCase()).join(':');
	  }
      this.setPageVars(pageName);
    },
    preprocessMsgPage: function() {
      if(window.location.pathname.indexOf('edit') >= 0){
      	var pageTitle = $$("#jive-compose-header h4").first().innerHTML.stripTags().replace(/\s+/g," ").strip();
      	var tempPageName = $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()});
	  	var pageName = 'us:live:video:'+ tempPageName.concat(pageTitle.toLowerCase()).join(':'); 
  	  }
  	  else{
      	var pageName = 'us:live:' + Omniture.Util.getNormalizedPageName() + ':' + $$('.jive-thread-post-subject-content h2 a').first().innerHTML.toLowerCase().strip();
    }
      this.setPageVars(pageName);
    },
    preprocessVidPage: function(){        
        var pageTitle = $$("#jive-video-header h2").first().innerHTML.stripTags().replace(/\s+/g," ").strip();
        var tempPageName = $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()});
	  	var pageName = 'us:live:video:'+ tempPageName.concat(pageTitle.toLowerCase()).join(':');	  		
        this.setPageVars(pageName);    	
    },
    preprocessThrPage: function(){
    	var pageTitle = $$(".jive-thread-post-subject-content h2").first().innerHTML.stripTags().replace(/\s+/g," ").strip();
		var tempPageName = $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip();});
		var pageName = 'us:live:thread:'+ tempPageName.without(tempPageName.last()).concat(pageTitle.toLowerCase()).join(':');		
		this.setPageVars(pageName); 
	},
   preprocessIdeaPage: function(){
	   	if(Omniture.PageLoad.parseTargetPath(window.location.pathname)=="ideas"){
	   		 var pageName = 'us:live:ideas:' + $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()}).join(":");
	   	}
	   	else{
		   	var pageTitle = $$(".jive-content-title h2").first().innerHTML.stripTags().replace(/\s+/g," ").strip();		
			var tempPageName = $$('#jive-breadcrumb a').map(function(e) {return e.innerHTML.toLowerCase().strip()});
			var pageName = 'us:live:ideas:'+ tempPageName.without(tempPageName.last()).concat(pageTitle.toLowerCase()).join(':');	
		}
		this.setPageVars(pageName);		
    },
    setPageVars: function(pageName) {
      s_account = 'netappbrand';
      var pageVars = {
        pageName: pageName,
        channel: 'live',
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  OSS: { //Omniture Site Search
    preprocess: function() {
      //grab globals populated by OSS
      var geo = ossCountry_cd;
      var link = document.location.host;
      //go to live report suite for all urls
      s_account = 'networkapplnetappcom-' + geo + ',networkapplglobalexternal';
      
      var refinement = ossRefinement;
      var searchTerm = ossSearchterm;
      if ($$('.searchResultsRowContainer').length === 0 && searchTerm != "") {
        searchTerm = 'null:' + searchTerm;
      }
      //s_account = 'networkapplnetappcom-' + geo + ',networkapplglobalexternal';
      var pageVars = {
        pageName: geo + ':search',
        channel: 'search',
        geo: geo
      };
      Omniture.PageLoad.setPageVars(pageVars);
      //we only want to fire these on initial search, not on pagination
      if (!(Omniture.Util.getQueryParam('page', ';') || Omniture.Util.getQueryParam('all', ';')) && searchTerm != "") {
        var customParams = {
          events: 'event8',
          prop5: searchTerm,
          eVar1: searchTerm,
          prop6: Omniture.Util.getPrevPage()
        };
        if (refinement) {
          customParams.prop7 = refinement;
        }
        Omniture.PageLoad.setCustomParams(customParams);
      }
    }
  },
  Search: {
    preprocess: function() {
      var qParams = Omniture.Util.getQueryParams();
      Omniture.SiteSections.Search.queryParams = qParams;
      var geo = qParams['cc'];
      s_account = 'networkapplnetappcom-' + geo + ',networkapplglobalexternal';
    },
    process: function() {
      var qParams = Omniture.SiteSections.Search.queryParams;
      var geo = qParams['cc'];
      var pageName = geo + ':search';
      var pageVars = {
        pageName: pageName,
        channel: 'search',
        geo: geo
      };
      Omniture.PageLoad.setPageVars(pageVars);
      var startIndex = qParams['st'];
      //we get to the following block only if this is the first page after a search is performed
      //we don't want to set these variables otherwise
      if (!startIndex || startIndex == 1) {
        //adding decodeURI to deal with Unicode characters
        //casting to lower case as search is case insensitive
        var searchString = decodeURI(qParams['q']).toLowerCase();
        if (document.getElementById('bn_navigation').childNodes.length == 0) {
          searchString = 'null:' + searchString;
        }
        var customParams = {
          events: 'event8',
          prop5: searchString,
          eVar1: searchString
        };
        Omniture.PageLoad.setCustomParams(customParams);
      }
    }
  },
  WWW: {
    preprocess: function() {
      this.calculatePageVars();
    },
    postprocess: function() {
      Omniture.Listeners.Widgets.attachListeners();
      Omniture.Listeners.Spotlight.attachListeners();
      Omniture.Listeners.Share.attachListeners();
    },
    calculatePageVars: function() {
      var path = document.location.pathname;
      var pathArray = path.split('/');
      var len = pathArray.length;
      var baseName = pathArray[len-1];
      var geo = pathArray[1];
      var channel = pathArray.length > 3 ? pathArray[2] : 'home';
      var subSection = pathArray.length >= 5 ? pathArray[3] : '';
      var pageName = pathArray.slice(1, len-1).join(':') + ':';
      if (baseName && baseName.length > 0) {
        pageName += baseName.split('.')[0];
      } else if (len == 3) {
        pageName += 'index';
      } else {
        pageName += pathArray[len-2];
      }
      var pageVars = {
        'baseName': baseName,
        'channel': channel,
        'pageName': pageName,
        'geo': geo,
        'events': 'event29'
      };
      var referrer = Omniture.Util.getQueryParam('referrer');
      if (referrer) {
        pageVars.referrer = referrer;
      }
      var shelfBc = Omniture.Util.getCookie('_shelfBc');
      var menuBc = Omniture.Util.getCookie('_menuBc');
      if (shelfBc) {
        Omniture.Util.deleteCookie('_shelfBc', 'netapp.com');
        pageVars.events += ',event6'; //FIXME
        Omniture.PageLoad.setCustomParam('eVar9', shelfBc);
        Omniture.PageLoad.setCustomParam('eVar3', Omniture.Util.getPrevPage());
      } else if (menuBc) {
        Omniture.Util.deleteCookie('_menuBc', 'netapp.com');
        pageVars.events += ',event2'; //FIXME
        Omniture.PageLoad.setCustomParam('eVar9', menuBc);
        Omniture.PageLoad.setCustomParam('eVar3', Omniture.Util.getPrevPage());
      }
      Omniture.PageLoad.setPageVars(pageVars);
      //report suite stuff
      if (Omniture.Channels.isKnown(channel)) {
        var isLive = Omniture.Util.isLive();
        var suffix = isLive ? '' : '-dev';
        s_account = 'networkapplnetappcom-' + geo + suffix + ',networkapplglobalexternal' + suffix;
      } else {
        s_account = 'networkapplnetappcom-spam';
      }
    }
  },
  WWWError: {
    process: function() {
      var errorURL = s.getQueryParam('errorURL'); 
      Omniture.PageLoad.customParams = {
        pageType: 'errorPage',
        pageName: '404:' + errorURL,
        prop16: errorURL
      };
    }
  },
  DedupeCalc: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageName = 'dedupecalc:index';
      var pageVars = {
        pageName: pageName,
        channel: 'calculator',
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  SeCalc: {
    preprocess: function() {
      s_account = 'networkapplnetappcom-us,networkapplglobalexternal';
      var pageName = 'secalc:index';
      var pageVars = {
        pageName: pageName,
        channel: 'calculator',
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  Brand: {
    preprocess: function() {
      s_account = 'netappbrand';
      var pageName = 'brand:' + Omniture.Util.getNormalizedPageName();
      var pageVars = {
        pageName: pageName,
        channel: 'brand',
        geo: 'us',
        events: 'event29'
      };
      Omniture.PageLoad.setPageVars(pageVars);
    }
  },
  RfpTool: {
    preprocess: function() {
      s_account = 'networkapplglobalexternal';
      var pageName = 'storage-rfp:' + window.location.pathname.substring(1);
      var events = 'event29';
      var form_name = '';
      if(Omniture.Util.getCookie('_rfp_form')) {
        if(window.location.pathname.indexOf('your-storage-needs') >= 0) {
          events += ',event78'; 
          form_name = Omniture.Util.getCookie('_rfp_form');
        }
        if(window.location.pathname.indexOf('thankyou') >= 0) {
          events += ',event79,event80'; 
          form_name = Omniture.Util.getCookie('_rfp_form');
        }   
      }  
      var pageVars = {
        pageName: pageName,
        channel: 'storage-rfp',
        geo: 'us',
        events: events
      };
      Omniture.PageLoad.setPageVars(pageVars);
      Omniture.PageLoad.setCustomParam('eVar47', form_name);
    },
    postprocess: function() {
      $$('#partner_img img').each(function(imgNode) {
        if (imgNode.src.indexOf("partner") > 0) {
          imgNode.observe('click', function(event) {
            Omniture.Util.setCookie('_rfp_form', 'storage-rfp-partner-form', null, 'storage-rfp.com');
          });
        }
      });
      $$('#customer_img img').each(function(imgNode) {
        if (imgNode.src.indexOf("customer") > 0) {
          imgNode.observe('click', function(event) {
            Omniture.Util.setCookie('_rfp_form', 'storage-rfp-customer-form', null, 'storage-rfp.com');
          });
        }
      });
      
    }
  }
};

Omniture.Channels = {
  known: {
    'products': 1,
    'careers': 2,
    'communities': 3,
    'company': 5,
    'solutions': 6,
    'library': 7,
    'blogs': 8,
    'home': 9,
    'services': 10,
    'forms': 11,
    'seek': 12,
    'how-to-buy': 13,
    'contact-us': 14,
    'campaigns': 15,
    'investors': 16,
    'partners': 17,
    'technology': 18,
    'support': 19,
    'search': 20,
    'error': 21,
    'media': 22,
    'site': 23,
    'bizapps': 24,
    'communicate': 25,
    'sitemap': 26,
    'suppliers': 27,
    'on24': 28,
    'cisco-vmware': 29,
    'iva': 30,
    'storage-efficiency': 31,
    'nurture': 32,
    'midsize-storage-efficiency': 33
  },
  isKnown: function(channel) {
    return this.known[channel];
  }
};

Omniture.Campaigns = {
  Diff: {
    attachListeners: function() {
      var self = this;
      $$('#mainContentAreaDoubleCol a').each(function(linkNode) {
        if(linkNode.href && linkNode.href.startsWith('javascript:playFile')) {
          linkNode.observe('click', self.mkCallback(linkNode));
        }
      });
    },
    mkCallback: function(linkNode) {
      return function() {
        var videoUrl = linkNode.href.match(/\(["'](.+)["']\)/)[1];
        var videoName = videoUrl.split('/').pop();
        var params = {
          'events': 'event33',
          'eVar2': 'differentiate|' + videoName
        };
        Omniture.Call.customLink(linkNode, params);
      };
    }
  },
  And: {
    attachListeners: function() {
      var self = this;
      //per request, set this to a us-only report suite
      s_account = 'networkapplnetappcom-us';
      if (!Omniture.Util.isLive()) s_account += '-dev';
      var leftNode = $$('.andLeft h3 a').first();
      leftNode.observe('click', this.mkCallback(leftNode, 'event18'));
      var rightNode = $$('.andRight h3 a').first();
      rightNode.observe('click', this.mkCallback(rightNode, 'event19'));
      $$('.regularList a').each(function(linkNode) {
        linkNode.observe('click', self.mkCallback(linkNode, 'event20'));
      });
    },

    mkCallback: function(linkNode, eventId) {
      var self = this;
      return function(e) {
        var params = {
          'events': eventId,
          'eVar38': linkNode.innerHTML,
          'eVar39': self.getType()
        };
        Omniture.Call.customLink(linkNode, params);
      };
    },
    getType: function() {
      var baseName = Omniture.PageLoad.pageVars.baseName;
      var out = baseName.split('.')[0];
      return out;
    }
  },
  EpicStory: {
    preprocess: function() {
      if(window.location.href.indexOf('story3') > 0) {
        Omniture.PageLoad.setCustomParam('events', 'event29,event78');
        Omniture.PageLoad.setCustomParam('eVar47', 'epic story');
      }
      
      if(window.location.href.indexOf('story4') > 0) {
        Omniture.PageLoad.setCustomParam('events', 'event29,event79');
        Omniture.PageLoad.setCustomParam('eVar47', 'epic story');
      }
    }
  }
  /*,
  SE: {
    attachListeners: function() {
      var self = this;
      $$('#productList a').each(function(linkNode) {
        if (linkNode.innerHTML != "Watch Now") return;
        linkNode.observe('click', self.mkCallback());
      });
    },
    mkCallback: function() {
      return function(event) {
        var linkNode = event.findElement();
        var hrefArray = linkNode.href.split('/');
        var videoName = hrefArray[hrefArray.length-1];
        videoName = videoName.substring(0, videoName.length-2);
        var params = {
          'events': 'event33',
          'eVar2': 'se|' + videoName
        };
        Omniture.Call.customLink(linkNode, params);
      };
    }
  } */
};

Omniture.System.preProcess();
if (window.Event && Event.observe) {
  Event.observe(window, 'load', function() {
    Omniture.System.postProcess();
  });
}





































