﻿// Spira eMarketing2 post-click tracking script
// ============================================

// Please change the value of 'spiraAiAddress' to the location of your AI admin installation.  This will probably be something like:
// var spiraAiAddress = 'aiadmin.sc3.spirahellic.com';
// ^ ... but this is only an example.  Please obtain your AI admin installation address from Spira if you don't know it.

var spiraAiAddress = 'morseem.spirahellic.com';

// ======================================================================
// Implementation - you shouldn't need to touch anything below this line!
// ======================================================================

// Returns a random integer between min and max... using Math.round() will give you a non-uniform distribution!
function spira_getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }

// Get a new image to cause CrmTrack to record this page visit
var trackerInvoker = new Image();
trackerInvoker.src = 'http://' + spiraAiAddress + '/emarketing/api/CrmTrack.aspx?url=' + encodeURIComponent(top.location) + '&title=' + encodeURIComponent(document.title) + '&r=' + encodeURIComponent(spira_getRandomInt(1, 100000));