
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=jQuery.extend({},options);options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};var otwmg=function(){};otwmg.squeeze=function(str){var chars=[],i=0,whiteSpaceCount=0,newStr="";chars=str.split('');for(i=0;i<str.length;i++){if(otwmg.isWhiteSpace(str[i])){whiteSpaceCount++;}
else{whiteSpaceCount=0;}
if(whiteSpaceCount<=1&&str[i]!=='\f'&&str[i]!=='\r'&&str[i]!=='\n'){newStr=newStr+str[i];}}
return newStr;}
otwmg.isWhiteSpace=function(chr){switch(chr)
{case' ':case'\n':case'\r':case'\f':case'\t':return true;default:return false;}}
otwmg.configuration={"DebugMode":true,"userPublicKey":"9bc10dce-14f9-40dc-9545-a5942291da95","skuTrackingMethod":"JavaScript","skuTrackingVariableName":"ESPTrackingProductSKU"};otwmg.isConsoleAvailable=function(){try{if(window.console!==undefined){return true;}
else{return false;}}catch(err){otwmg.logErrorToCookie(err,"otwmg.isConsoleAvailable");}};otwmg.logToConsole=function(msg){if(otwmg.isConsoleAvailable()===true&&otwmg.configuration.DebugMode===true){console.log(msg);}};jQuery.cookie("otwmgTrackerLibVersion","2.23",{expires:365,path:'/'});otwmg.queryString={};otwmg.initQueryString=function(){try{var query=unescape(window.location.search.substring(1));var pairs=query.split("&");var initStr="";for(var i=0;i<pairs.length;i++){var pos=pairs[i].indexOf('=');if(pos>=0){var argname=pairs[i].substring(0,pos);var value=pairs[i].substring(pos+1);initStr=initStr+"otwmg.queryString."+argname.toLowerCase()+"='"+value+"';";}}
if(initStr!==""){eval(initStr);}}catch(err){otwmg.logErrorToCookie(err,"otwmg.initQueryString");}};otwmg.getQueryStringValue=function(key){try{var query=unescape(window.location.search.substring(1));var pairs=query.split("&");var initStr="";for(var i=0;i<pairs.length;i++){var pos=pairs[i].indexOf('=');if(pos>=0){var argname=pairs[i].substring(0,pos);var value=pairs[i].substring(pos+1);if(argname===key){return value;}}}
return null;}catch(err){otwmg.logErrorToCookie(err,"otwmg.getQueryStringValue");}};if(jQuery.cookie("otwmgTrackingCodeErrors")!==undefined){if(jQuery.cookie("otwmgTrackingCodeErrors")!==null){otwmg.errors=jQuery.cookie("otwmgTrackingCodeErrors").split("^^");}}
otwmg.errors=[];otwmg.logErrorToCookie=function(err,details){};otwmg.isAOLUser=function(){try{if(navigator.userAgent.indexOf("AOL ")>-1||navigator.userAgent.indexOf("America Online")>-1){return true;}
else{return false;}}catch(err){otwmg.logErrorToCookie(err,"otwmg.isAOLUser userAgent="+navigator.userAgent);return false;}};otwmg.formatString=function(){var num=arguments.length;var oStr=arguments[0];for(var i=1;i<num;i++){var pattern="\\{"+(i-1)+"\\}";var re=new RegExp(pattern,"g");oStr=oStr.replace(re,arguments[i]);}
return oStr;}
otwmg.initQueryString();if(otwmg===undefined){var otwmg=function(){};}
otwmg.cryptography=function(){};otwmg.cryptography.sha1=new function(){};otwmg.cryptography.sha1.sha1Hash=function(msg){var K=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];msg+=String.fromCharCode(0x80);var l=Math.ceil(msg.length/4)+2;var N=Math.ceil(l/16);var M=new Array(N);for(var i=0;i<N;i++){M[i]=new Array(16);for(var j=0;j<16;j++){M[i][j]=(msg.charCodeAt(i*64+j*4)<<24)|(msg.charCodeAt(i*64+j*4+1)<<16)|(msg.charCodeAt(i*64+j*4+2)<<8)|(msg.charCodeAt(i*64+j*4+3));}}
M[N-1][14]=((msg.length-1)*8)/Math.pow(2,32);M[N-1][14]=Math.floor(M[N-1][14])
M[N-1][15]=((msg.length-1)*8)&0xffffffff;var H0=0x67452301;var H1=0xefcdab89;var H2=0x98badcfe;var H3=0x10325476;var H4=0xc3d2e1f0;var W=new Array(80);var a,b,c,d,e;for(var i=0;i<N;i++){for(var t=0;t<16;t++)W[t]=M[i][t];for(var t=16;t<80;t++)W[t]=otwmg.cryptography.sha1.ROTL(W[t-3]^W[t-8]^W[t-14]^W[t-16],1);a=H0;b=H1;c=H2;d=H3;e=H4;for(var t=0;t<80;t++){var s=Math.floor(t/20);var T=(otwmg.cryptography.sha1.ROTL(a,5)+otwmg.cryptography.sha1.f(s,b,c,d)+e+K[s]+W[t])&0xffffffff;e=d;d=c;c=otwmg.cryptography.sha1.ROTL(b,30);b=a;a=T;}
H0=(H0+a)&0xffffffff;H1=(H1+b)&0xffffffff;H2=(H2+c)&0xffffffff;H3=(H3+d)&0xffffffff;H4=(H4+e)&0xffffffff;}
return otwmg.cryptography.sha1.toHexStr(H0)
+otwmg.cryptography.sha1.toHexStr(H1)
+otwmg.cryptography.sha1.toHexStr(H2)
+otwmg.cryptography.sha1.toHexStr(H3)
+otwmg.cryptography.sha1.toHexStr(H4);};otwmg.cryptography.sha1.f=function(s,x,y,z){switch(s){case 0:return(x&y)^(~x&z);case 1:return x^y^z;case 2:return(x&y)^(x&z)^(y&z);case 3:return x^y^z;}};otwmg.cryptography.sha1.ROTL=function(x,n){return(x<<n)|(x>>>(32-n));};otwmg.cryptography.sha1.toHexStr=function(val){var s="",v;for(var i=7;i>=0;i--){v=(val>>>(i*4))&0xf;s+=v.toString(16);}
return s;};otwmg.cryptography.TEA=function(){};otwmg.cryptography.TEA.TEAEncrypt=function(plaintext,password)
{if(plaintext.length==0)return('');var asciitext=escape(plaintext).replace(/%20/g,' ');var v=otwmg.cryptography.TEA.strToLongs(asciitext);if(v.length<=1)v[1]=0;var k=otwmg.cryptography.TEA.strToLongs(password.slice(0,16));var n=v.length;var z=v[n-1],y=v[0],delta=0x9E3779B9;var mx,e,q=Math.floor(6+52/n),sum=0;while(q-->0){sum+=delta;e=sum>>>2&3;for(var p=0;p<n;p++){y=v[(p+1)%n];mx=(z>>>5^y<<2)+(y>>>3^z<<4)^(sum^y)+(k[p&3^e]^z);z=v[p]+=mx;}}
var ciphertext=otwmg.cryptography.TEA.longsToStr(v);return otwmg.cryptography.TEA.escCtrlCh(ciphertext);};otwmg.cryptography.TEA.TEADecrypt=function(ciphertext,password)
{if(ciphertext.length==0)return('');var v=otwmg.cryptography.TEA.strToLongs(otwmg.cryptography.TEA.unescCtrlCh(ciphertext));var k=otwmg.cryptography.TEA.strToLongs(password.slice(0,16));var n=v.length;var z=v[n-1],y=v[0],delta=0x9E3779B9;var mx,e,q=Math.floor(6+52/n),sum=q*delta;while(sum!=0){e=sum>>>2&3;for(var p=n-1;p>=0;p--){z=v[p>0?p-1:n-1];mx=(z>>>5^y<<2)+(y>>>3^z<<4)^(sum^y)+(k[p&3^e]^z);y=v[p]-=mx;}
sum-=delta;}
var plaintext=otwmg.cryptography.TEA.longsToStr(v);plaintext=plaintext.replace(/\0+$/,'');return unescape(plaintext);};otwmg.cryptography.TEA.strToLongs=function(s){var l=new Array(Math.ceil(s.length/4));for(var i=0;i<l.length;i++){l[i]=s.charCodeAt(i*4)+(s.charCodeAt(i*4+1)<<8)+
(s.charCodeAt(i*4+2)<<16)+(s.charCodeAt(i*4+3)<<24);}
return l;};otwmg.cryptography.TEA.longsToStr=function(l){var a=new Array(l.length);for(var i=0;i<l.length;i++){a[i]=String.fromCharCode(l[i]&0xFF,l[i]>>>8&0xFF,l[i]>>>16&0xFF,l[i]>>>24&0xFF);}
return a.join('');};otwmg.cryptography.TEA.escCtrlCh=function(str){return str.replace(/[\0\t\n\v\f\r\xa0'"!]/g,function(c){return'!'+c.charCodeAt(0)+'!';});};otwmg.cryptography.TEA.unescCtrlCh=function(str){return str.replace(/!\d\d?\d?!/g,function(c){return String.fromCharCode(c.slice(1,-1));});};jQuery.fn.extend({textNodes:function(){return jQuery(jQuery.map(this,function(n){return jQuery.grep(n.childNodes,function(n){return n.nodeType==3;});}));}});if(otwmg===undefined){var otwmg=function(){};}
otwmg.trackerLib=function(){};otwmg.trackerLib.globals={"sitesOfInterest":["www.circlebloom.com"],"webServiceLocation":"https://tracker.espsoftware.com/esptracker2k8/ws_tracker2k8.asmx","insertCalls":0,"proxyPlatform":".net","displayTrackingCode":false};otwmg.trackerLib.globals.sitesOfInterest.contains=function(url){try{for(var i=0;i<otwmg.trackerLib.globals.sitesOfInterest.length;i++){if(url.toLowerCase().indexOf(otwmg.trackerLib.globals.sitesOfInterest[i].toLowerCase())!==-1){return true;}}
return false;}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.globals.sitesOfInterest.contains, url="+url);return false;}};otwmg.trackerLib.trackingData={"trackingId":null,"trackingCode":null,"expiration":null,"adId":null,"productSku":null,"trackingKey":function(){if(otwmg.queryString.trackingkey!==undefined){return otwmg.queryString.trackingkey;}
else{return"";}}()};otwmg.trackerLib.getRootDirectory=function(){try{return window.location.protocol+'//'+window.location.hostname;}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.getRootDirectory");}};otwmg.trackerLib.readTrackingDataFromCookie=function(){try{if(jQuery.cookie("trackingid")!==null){otwmg.trackerLib.trackingData.trackingId=jQuery.cookie("trackingid");otwmg.trackerLib.trackingData.trackingCode=jQuery.cookie("trackingcode");otwmg.trackerLib.trackingData.expiration=jQuery.cookie("trackingexpiration");return true;}
else{return false;}}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.readTrackingDataFromCookie");}};otwmg.trackerLib.readSkuIntoTrackingData=function(){try{var ProductSKU=null;switch(otwmg.configuration.skuTrackingMethod){case"JavaScript":if(ESPTrackingProductSKU===undefined&&otwmg.configuration.skuTrackingVariableName!==null){ProductSKU=eval(otwmg.configuration.skuTrackingVariableName);}
if(ESPTrackingProductSKU!==null&&ESPTrackingProductSKU!==undefined){otwmg.trackerLib.trackingData.productSku=ESPTrackingProductSKU;}
else if(ProductSKU!==null){otwmg.trackerLib.trackingData.productSku=ProductSKU;}
break;case"QueryString":if(otwmg.configuration.skuTrackingVariableName!==null){otwmg.trackerLib.trackingData.productSku=otwmg.getQueryStringValue(otwmg.configuration.skuTrackingVariableName);}
break;}}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.readSkuIntoTrackingData");}};otwmg.trackerLib.saveTrackingDataToCookie=function(){try{if(otwmg.trackerLib.trackingData.trackingCode!==undefined&&otwmg.trackerLib.trackingData.trackingCode!==null){jQuery.cookie("trackingid",otwmg.trackerLib.trackingData.trackingId,{expires:365,path:"/"});jQuery.cookie("trackingcode",otwmg.trackerLib.trackingData.trackingCode,{expires:365,path:"/"});jQuery.cookie("trackingexpiration",otwmg.trackerLib.trackingData.expiration,{expires:365,path:"/"});}}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.saveTrackingDataToCookie");}};otwmg.trackerLib.deleteTrackingDataFromCookie=function(){try{jQuery.cookie("trackingid",null);jQuery.cookie("trackingcode",null);jQuery.cookie("trackingexpiration",null);}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.deleteTrackingDataFromCookie");}};otwmg.trackerLib.getTrackingJSReference=function(){var lib=otwmg.trackerLib,baseUrl=otwmg.trackerLib.globals.webServiceLocation;switch(otwmg.trackerLib.globals.proxyPlatform){case".net":baseUrl=baseUrl+"/GetTrackingID7?";break;case"php":baseUrl=baseUrl+"/GetTrackingID7.php?";break;};var cookieReferrer=jQuery.cookie("cookieReferrer")
var referrer=((document.referrer==''&&lib.trackingData.adId==undefined&&cookieReferrer!==window.location.href)?cookieReferrer:document.referrer);return baseUrl
+"AdID="+lib.trackingData.adId
+"&TrackingID="+lib.trackingData.trackingId
+"&TrackingCode="+lib.trackingData.trackingCode
+"&RealReferer="+escape(referrer)
+"&DocumentURL="+escape(window.location.href)
+"&RequestKey="+otwmg.trackerLib.trackingData.trackingKey
+"&PublicKey="+escape(otwmg.configuration.userPublicKey)
+"&ProductSku="+escape(otwmg.trackerLib.trackingData.productSku)
+"&_="+Math.floor(Math.random()*100000).toString();};otwmg.trackerLib.beginGetTrackingData=function(){try{otwmg.logToConsole("Entering begin get tracking data. Attempting to read from cookie");var lib=otwmg.trackerLib;lib.readTrackingDataFromCookie();lib.readSkuIntoTrackingData();if(lib.trackingData.trackingCode!==null){otwmg.logToConsole("data retrieved from cookie");otwmg.logToConsole("TrackingCode = "+lib.trackingData.trackingCode);otwmg.logToConsole("TrackingID = "+lib.trackingData.trackingId);otwmg.logToConsole("ProductSKU = "+lib.trackingData.productSku);}
otwmg.logToConsole("Calling GetTrackingID6 on proxy with the following parameters");otwmg.logToConsole("AdID = "+otwmg.trackerLib.trackingData.adId);otwmg.logToConsole("trackingId = "+otwmg.trackerLib.trackingData.trackingId);otwmg.logToConsole("trackingCode = "+otwmg.trackerLib.trackingData.trackingCode);otwmg.logToConsole("encodeURI(document.referrer) = "+encodeURI(document.referrer));otwmg.logToConsole("encodeURI(location.href) = "+encodeURI(window.location.href));$.ajax({url:otwmg.trackerLib.globals.webServiceLocation+"/GetTrackingID6",success:otwmg.trackerLib.trackingDataRecieved,error:otwmg.trackerLib.trackingDataRequestError,cache:false,dataType:"text",data:{AdID:otwmg.trackerLib.trackingData.adId,TrackingID:otwmg.trackerLib.trackingData.trackingId,TrackingCode:otwmg.trackerLib.trackingData.trackingCode,ProductSku:escape(otwmg.trackerLib.trackingData.productSku),Document_Referer:encodeURI(document.referrer),CurrentDocument_URL:encodeURI(location.href),PublicKey:escape(otwmg.configuration.userPublicKey),TrackingKey:otwmg.trackerLib.trackingData.trackingKey}});}
catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.beginGetTrackingData,"
+"otwmg.trackerLib.trackingData.trackingId="+otwmg.trackerLib.trackingData.trackingId
+",otwmg.trackerLib.trackingData.trackingCode="+otwmg.trackerLib.trackingData.trackingCode
+",otwmg.trackerLib.trackingData.adID="+otwmg.trackerLib.trackingData.adID
+",otwmg.trackerLib.trackingData.productSku="+otwmg.trackerLib.trackingData.productSku);}};otwmg.trackerLib.trackingDataRecieved=function(data,textStatus){try{otwmg.logToConsole("TrackingDataRecieved called");otwmg.logToConsole("textStatus = "+textStatus);otwmg.logToConsole("Response text = "+data);var vals=new Array();var resp=data.substr(99);resp=resp.substr(0,resp.lastIndexOf('<'));vals=resp.split('|');otwmg.trackerLib.trackingData.trackingId=vals[0];otwmg.trackerLib.trackingData.trackingCode=vals[1];otwmg.trackerLib.trackingData.expiration=vals[2];otwmg.trackerLib.trackingData.trackingKey=vals[3];otwmg.trackerLib.saveTrackingDataToCookie();}
catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.trackingDataRecieved, "
+",data="+data
+",textStatus="+textStatus);}};otwmg.trackerLib.trackingDataRequestError=function(xhr,textStatus,errorThrown){try{otwmg.logToConsole("TrackingDataRequestError was called and the error was : "+errorThrown);}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.trackingDataRequestError,"
+"textStatus="+textStatus
+"errorThrown="+errorThrown);}};otwmg.trackerLib.logXDomainTransferRequest=function(url,anchor){var lib=otwmg.trackerLib,baseUrl=otwmg.trackerLib.globals.webServiceLocation;switch(otwmg.trackerLib.globals.proxyPlatform){case".net":baseUrl=baseUrl+"/LogXDomainTransferRequest?";break;case"php":baseUrl=baseUrl+"/LogXDomainTransferRequest.php?";break;};try{if(otwmg.isAOLUser()===false){otwmg.logToConsole("Entered logXDomainTrasferRequest");jQuery.get(baseUrl,{AdID:otwmg.trackerLib.trackingData.adId,TrackingID:otwmg.trackerLib.trackingData.trackingId,TrackingCode:otwmg.trackerLib.trackingData.trackingCode,RequestURL:escape(url),PublicKey:escape(otwmg.configuration.userPublicKey)});otwmg.logToConsole("AdID="+otwmg.trackerLib.trackingData.adId);otwmg.logToConsole("TrackingID="+otwmg.trackerLib.trackingData.trackingId);otwmg.logToConsole("TrackingCode="+otwmg.trackerLib.trackingData.trackingCode);otwmg.logToConsole("RequestURL="+escape(url));}
else{otwmg.logToConsole("Entered logXDomainTrasferRequest, AOL user detected");if(url.indexOf("?")>-1){anchor.href=anchor.href+"&"}
else{anchor.href=anchor.href+"?"}
anchor.href=anchor.href+"TrackingKey="+otwmg.trackerLib.trackingData.trackingKey;return true;}}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.logXDomainTransferRequest, url="+url);}};otwmg.trackerLib.assignProductHit=function(ProductSku,DocumentURL,TrackingID){baseUrl=otwmg.trackerLib.globals.webServiceLocation;switch(otwmg.trackerLib.globals.proxyPlatform){case".net":baseUrl=baseUrl+"/AssignProductHit?";break;case"php":baseUrl=baseUrl+"/AssignProductHit.php?";break;};try{jQuery.get(baseUrl,{ProductSku:ProductSku,DocumentURL:DocumentURL,TrackingID:otwmg.trackerLib.trackingData.trackingId});}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.assignProductHit");}};otwmg.trackerLib.attachXDomainEvent=function(){try{otwmg.logToConsole("Entered attachXDomainEvent");var i,anchors=jQuery('a:not(.class.OTWMG_DONOTATTACHXDOMAINEVENT)');var root=otwmg.trackerLib.getRootDirectory();for(i=0;i<anchors.length;i++){if(otwmg.trackerLib.globals.sitesOfInterest.contains(anchors[i].href.toLowerCase())&&anchors[i].href.indexOf(root)===-1){anchors[i].onmousedown=function(){otwmg.trackerLib.logXDomainTransferRequest(this.href,this);};}}}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.attachXDomainEvent");}};otwmg.trackerLib.insertTrackingCode=function(){try{if(otwmg.trackerLib.globals.displayTrackingCode==true){if(otwmg.trackerLib.trackingData.trackingCode!==null&&otwmg.trackerLib.trackingData.trackingCode!==undefined){jQuery("span[id^='ESPTrackingCode']").text(otwmg.trackerLib.trackingData.trackingCode);}
else{setTimeout("otwmg.trackerLib.insertTrackingCode();",25);}}}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.insertTrackingCode");}};otwmg.logToConsole("Tracking script started");otwmg.logToConsole("Trying to retrieve adid from query string");otwmg.trackerLib.trackingData.adId=otwmg.queryString.adid;if(otwmg.queryString.adid===undefined){otwmg.trackerLib.trackingData.adId=null;otwmg.logToConsole("No adid present");}
else{otwmg.logToConsole("adid = "+otwmg.queryString.adid);}
otwmg.trackerLib.onDocumentReady=function(){var sku=null,elm=null;try{otwmg.logToConsole("Document is ready");if(otwmg.configuration.skuTrackingMethod==="HTMLElement"){elm=jQuery(otwmg.configuration.skuTrackingVariableName)
if(elm!==null){if(elm.text()!==null&&elm.text()!=='')sku=elm.text();if(elm.val()!==null&&elm.val()!=='')sku=elm.val();otwmg.trackerLib.waitForAndAssignTrackingId(jQuery.trim(sku),10,1,0);}}
else if(otwmg.configuration.skuTrackingMethod==="HTMLElementTextNode"){elms=otwmg.configuration.skuTrackingVariableName.split('~');for(i=0;i<elms.length;i++){elm=eval(elms[i]);if(elm!==null&&elm!==undefined){sku=elm.textContent;otwmg.trackerLib.waitForAndAssignTrackingId(jQuery.trim(sku),10,1,0);break;}}}
else if(otwmg.configuration.skuTrackingMethod==="jQueryEval"){sku=eval(otwmg.configuration.skuTrackingVariableName)
if(sku!==null&&sku!==undefined)
otwmg.trackerLib.waitForAndAssignTrackingId(jQuery.trim(sku),10,1,0);}
else{otwmg.trackerLib.insertTrackingCode();}
otwmg.trackerLib.attachXDomainEvent();}catch(err){otwmg.logErrorToCookie(err,"jQuery(document).ready");}};
jQuery.cookie("otwmgTrackerLibVersion",jQuery.cookie("otwmgTrackerLibVersion")+"_NoProxy",{expires:365,path:'/'});delete otwmg.trackerLib.beginGetTrackingData;delete otwmg.trackerLib.trackingDataRecieved;delete otwmg.trackerLib.trackingDataRequestError;delete otwmg.trackerLib.insertTrackingCode;delete otwmg.trackerLib.assignProductHit;otwmg.trackerLib.assignProductHit=function(ProductSku,DocumentURL,TrackingID){try{otwmg.logToConsole("Entered assignProductHit");otwmg.logToConsole("TrackingID="+TrackingID);otwmg.logToConsole("ProductSku="+ProductSku);otwmg.logToConsole("DocumentURL="+DocumentURL);otwmg.logToConsole("WebServiceLocation="+otwmg.trackerLib.globals.webServiceLocation+"/AssignProductHit");var url=otwmg.trackerLib.globals.webServiceLocation+"/AssignProductHitJS?"
+"ProductSku="+ProductSku
+"&DocumentURL="+encodeURI(DocumentURL)
+"&TrackingID="+TrackingID;otwmg.logToConsole(url);jQuery("head").append("<script src=\""+url+"\" type=\"text/javascript\"></script>");}catch(err){otwmg.logErrorToCookie(err,"otwmg.trackerLib.assignProductHit");}};otwmg.trackerLib.getTrackingJSReference=function(){var lib=otwmg.trackerLib;var cookieReferrer=jQuery.cookie("cookieReferrer")
var referrer=((document.referrer==''&&lib.trackingData.adId==undefined&&cookieReferrer!==window.location.href)?cookieReferrer:document.referrer);return"https://tracker.espsoftware.com/esptracker2k8/ws_tracker2k8.asmx/GetTrackingJS?"
+"AdID="+lib.trackingData.adId
+"&TrackingID="+lib.trackingData.trackingId
+"&TrackingCode="+lib.trackingData.trackingCode
+"&RealReferer="+encodeURI(referrer)
+"&DocumentURL="+encodeURI(window.location.href)
+"&RequestKey="+otwmg.trackerLib.trackingData.trackingKey
+"&PublicKey="+escape(otwmg.configuration.userPublicKey)
+"&ProductSku="+escape(otwmg.trackerLib.trackingData.productSku);};otwmg.trackerLib.beginGetTrackingData=function(){jQuery.cookie("cookieReferrer",window.location.href);otwmg.trackerLib.readTrackingDataFromCookie();otwmg.trackerLib.readSkuIntoTrackingData();jQuery("head").append("\x3Cscript src=\""+otwmg.trackerLib.getTrackingJSReference()+"\" type=\"text/javascript\">\x3C/script>");};otwmg.trackerLib.trackingDataRecieved=function(){otwmg.trackerLib.saveTrackingDataToCookie();var lib=otwmg.trackerLib.trackingData,spd=otwmg.trackerLib.scriptProvidedTrackingData;lib.trackingCode=spd.trackingCode;lib.trackingId=spd.trackingId;lib.expirationDate=spd.expirationDate;lib.trackingKey=spd.trackingKey;otwmg.trackerLib.saveTrackingDataToCookie();};otwmg.trackerLib.insertTrackingCode=function(){if(otwmg.trackerLib.globals.displayTrackingCode==true){if(otwmg.configuration.skuTrackingMethod==="HTMLElement"){var codeElm=jQuery(otwmg.configuration.skuTrackingVariableName);codeElm.text(codeElm.text()+"-"+otwmg.trackerLib.trackingData.trackingCode);}
else if(otwmg.configuration.skuTrackingMethod==="HTMLElementTextNode"){var codeElm=eval(otwmg.configuration.skuTrackingVariableName);if(codeElm!==null&&codeElm!==undefined){codeElm.textContent=codeElm.textContent+"-"+otwmg.trackerLib.trackingData.trackingCode;}}
else{jQuery("span[id^='ESPTrackingCode']").text(otwmg.trackerLib.trackingData.trackingCode);}}};otwmg.trackerLib.beginGetTrackingData();jQuery(document).bind("ready",otwmg.trackerLib.onDocumentReady);otwmg.trackerLib.waitForAndAssignTrackingId=function(sku,maxAttempts,delay,currentIteration){otwmg.logToConsole("Entered waitForAndAssignTrackingId");if(delay===undefined||delay===null){delay=1;}
currentIteration++;if(otwmg.trackerLib.trackingData.trackingId===null){if(currentIteration>maxAttempts){otwmg.logToConsole("Could not retrieve tracking ID");return;}
otwmg.logToConsole("Waiting for tracking ID "+currentIteration.toString()+" times.");setTimeout("otwmg.trackerLib.waitForAndAssignTrackingId('"+sku+"',"+
maxAttempts.toString()+","+delay.toString()+","+
currentIteration.toString()+");");}
else{otwmg.trackerLib.assignProductHit(sku,window.location.href,otwmg.trackerLib.trackingData.trackingId);otwmg.trackerLib.insertTrackingCode();}};if(otwmg===undefined){var otwmg=function(){};}
if(otwmg.trackerLib===undefined){otwmg.trackerLib=function(){};}
otwmg.trackerLib.orderLogging=function(){};otwmg.trackerLib.orderLogging.lineItem=function(sku,qty,price){this.sku=(sku===undefined)?"":sku;this.qty=(qty===undefined)?0.0:qty;this.price=(price===undefined)?0.0:price;this.toQueryString=function(ix){var myself=this;return otwmg.formatString("&SKU{3}={0}&Quantity{3}={1}&Price{3}={2}",encodeURI(myself.sku),encodeURI(myself.qty),encodeURI(myself.price),ix);};};otwmg.trackerLib.orderLogging.header=function(){this.orderID="";this.trackingID="";this.trackingCode="";this.firstName="";this.lastName="";this.clientIP="";this.billingKey="";this.notes="";this.lineItems=[];this.addLineItem=function(sku,qty,price){this.lineItems.push(new otwmg.trackerLib.orderLogging.lineItem(sku,qty,price));};this.getLineItemsQueryString=function(){return function(){var opStr="";var i=0;for(i=0;i<this.lineItems.length;i++){opStr=opStr+this.lineItems[i].toQueryString(i+1);}
return opStr;};}();this.toQueryString=function(ix){var myself=this;return otwmg.formatString("?OrderID={0}"
+"&TrackingID={1}"
+"&TrackingCode={2}"
+"&FirstName={3}"
+"&LastName={4}"
+"&ClientIP={5}"
+"&BillingKey={6}"
+"&Notes={7}"
+"&DetailCount={8}",encodeURI(myself.orderID),encodeURI(myself.trackingID),encodeURI(myself.trackingCode),encodeURI(myself.firstName),encodeURI(myself.lastName),encodeURI(myself.clientIP),encodeURI(myself.billingKey),encodeURIComponent(myself.notes),encodeURI(myself.lineItems.length))
+this.getLineItemsQueryString();};};otwmg.trackerLib.orderLogging.logOrder=function(header,successCallBack){if((successCallBack!==undefined)&&(jQuery.isFunction(successCallBack)===false)){return false;}
else{var url="https://tracker.espsoftware.com/esptracker2k8/ws_tracker2k8.asmx/LogOrder"+header.toQueryString();jQuery("head").append("\x3Cscript src=\""+url+"\" type=\"text/javascript\">\x3C/script>");return true;}};
delete otwmg.trackerLib.orderLogging.logOrder;otwmg.trackerLib.orderLogging.logOrder=function(header){var url="https://tracker.espsoftware.com/esptracker2k8/WS_Tracker2K8.asmx/LogOrder"
+header.toQueryString()
otwmg.logToConsole(url);jQuery("head").append("\x3Cscript src=\""+url+"\" type=\"text/javascript\">\x3C/script>");return true;};
