/*
 * @fileoverview
 * SiteCatalyst implementation for QMI ecommerce common platform
 * SiteCatalyst code version: H.20.3.
 * @author SHamel@immeria.net
 * @version v1.23 Fix cookie path, taxes, shipping, gift certificate values 2009/10/30
 * @version v1.22 Fix store name in scView & purchase 2009/10/28
 * @version v1.21 Fix reFilterDomains global var 2009/10/28
 * @version v1.2 Self tag diagnostic and minor tweaks 2009/10/27
 * @version v1.1 Bug fixes & enhancements
 * @version v1.0 Initial implementation
 * @see http://immeria.net/jitt
 */
/************************** CONFIG SECTION **************************/
// storeList - If a new store is created, update the list with the ATG store id and corresponding Omniture Report Suite
var storeList = {
    'qmi': 'cnomyshoppingbagprod', // MonPanierDAchats.ca
    'ach': 'cnoarchambaultprod', // Archambault.ca
    'tsh': 'cnoshoppingtvaprod', // ShoppingTVA.ca
    'scl': 'cnoclodineprod', // ShoppingClodine.ca
    'car': 'cnocarolineprod', // BijouxCarolineNeron.ca
    'zik': 'cnozikprod', // Zik.ca
    'unk': 'cnomyshoppingbagdev' // can't determine Store, use a dev Report Suite...
};
var store = 'unk';

// globalStore - Roll up Report Suite of all stores
var globalStore = ''; //var globalStore = 'cnomyshoppingbadprod';
// storeDomains - List of valid domains hosting stores
var storeDomains = ['monpanierdachat.ca', 'archambault.ca', 'shoppingtva.ca', 'shoppingclodine.ca', 'bijouxcarolineneron.com', 'zik.ca'];

//s.trackingServer = 'metric.canoe.ca'; // 1st party cookie
//s.trackingServerSecure = 'metrics.canoe.ca'; // 1st party cookie for SSL

// *** TODO
// prop=evar=PPC|organic|email|banner|referrer|social|direct
// check product merchandising

/************************** CUSTOM PLUGINS SECTION *************************/
var $jitt = jQuery.noConflict(); // avoid conflict with possible existing definition of $

// Reportsuite & internal filters setup based on specified storeList & storeDomains
var sFilterDomains = s.linkInternalFilters = '';
$jitt.each(storeDomains, function(){
    s.linkInternalFilters += this + ',';
    sFilterDomains += this.replace(/\..+$/, '|');
});
s.linkInternalFilters += 'javascript:,storage.canoe.ca,monpanierdachats.ca';
var reFilterDomains = new RegExp('(' + sFilterDomains.replace(/\|$/, ')'), 'gi');

/*
 * Multiple replacement regex string replacement
 * @addon
 * @param hash of regex & replacement
 * @param options regex.replace() options (optional)
 * @return Modified string
 * @type String
 */
String.prototype.mreplace = function(hash, options){
    if (!options) 
        options = 'g';
    var str = this;
    for (key in hash) 
        if (Object.prototype.hasOwnProperty.call(hash, key)) 
            str = str.replace(new RegExp(key, options), hash[key]);
    return str;
};

/*
 * Filter special characters
 * @addon
 * @param string object
 * @return String filtered for special characters
 * @type String
 */
String.prototype.clean = function(){
    return this.toLowerCase().mreplace({
        '(^\\s+|\\s+$)': '',
        '[\xe0-\xe6]': 'a',
        '[\xe8-\xeb]': 'e',
        '[\xec-\xef]': 'i',
        '[\xf2-\xf6]': 'o',
        '[\xf9-\xfc]': 'u',
        '\xfd': 'y',
        '\xe7': 'c',
        '\\s+': ' ',
        ':\\s*': ':'
    }, 'gi');
};

/*
 * jQuery.cookie handler
 * @addon
 * @param name Cookie name
 * @param value Cookie value to set
 * @param options Cookie expiration date (optional)
 * @see http://plugins.jquery.com/files/jquery.cookie.js.txt
 */
jQuery.cookie = function(name, value, options){
    if (typeof value != 'undefined') {
        options = options ||
        {};
        if (value === null) 
            value = '', 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();
        }
        document.cookie = [name, '=', encodeURIComponent(value), expires, '; path=' + (options.path ? options.path : '/'), (options.domain ? '; domain=' + options.domain : ''), (options.secure ? '; secure' : '')].join('');
    }
    else {
        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 + '=')) 
                    return decodeURIComponent(cookie.substring(name.length + 1));
            }
        }
        return null;
    }
};

/*
 * Choose the right Report Suite based on actual context
 * @param store_overwrite forces the store to be set at the specified value
 */
function setReportSuite(store_overwrite){
    if (store_overwrite) 
        store = store_overwrite;
    else 
        // Pick Store ID from specified body class
        if (x = $jitt('body').attr('class').match(/store(...)/i)) 
            store = x[1].toUpperCase();
        else // If Store ID isn't specified, try to find it in URL
             for (key in storeList) {
                var re = new RegExp('-' + key + '-', 'i'); // *** CHECK
                if (re.test(location.pathname)) {
                    store = key;
                    break;
                }
            }
    
    if (!store) // or use last known Store ID if it can't be determined (i.e. QMI global pages)
        store = $jitt.cookie('store');
    if (!store) 
        store = 'unk';
    store = store.toLowerCase();
    $jitt.cookie('store', store);
    
    if (reFilterDomains.test(location.host)) // If we're not on one of the production server, use DEV report suite
        s.sa(storeList[store] + (globalStore ? ',' + globalStore : ''));
    else 
        s.sa(storeList[store].replace(/prod$/, 'dev') + (globalStore ? ',' + globalStore : ''));
}

/*
 * Set SiteCatalyst tag values
 */
$jitt.tags = function(){
    try {
        /************************** Page, sections, hierarchy **************************/
        setReportSuite();
        
        //s.server = ''; // in load balancing environment
        
        // 404 Erorr page special handling - nothing else should be set
        if (/errors\/404/.test(location.pathname)) 
            s.pageType = 'errorPage';
        
        // language - from DOM or URL
        var language = '';
        if (x = $jitt.trim($jitt('.genMenu a:first').text().toLowerCase())) 
            language = (x == 'english' ? 'fr' : 'en');
        else 
            if (x = location.pathname.match(/-(fr|en)-/i)) 
                language = x[1].toLowerCase();
            else 
                language = 'fr';
        
        // pageName - standardized unique page naming taxonomy
        if ($jitt('.breadcrumbs').length) { // If breadcrumb is available use it
            s.pageName = language;
            $jitt('.breadcrumbs li').each(function(){
                // Use s.apl (append to list) to get rid of duplicate category levels on Archambault.ca
                s.pageName = s.apl(s.pageName, $jitt.trim($jitt(this).text()).mreplace({
                    ':\\s*': '-'
                }), ':', 2);
            });
            s.pageName = s.pageName.mreplace({
                'Home:': '',
                ':$': ''
            });
        }
        else {// else use the URL
            s.pageName = location.pathname.mreplace({
                '[-\\/]': ':', // change dashes for :
                '\\.[^\\/]+$': '' // strip extension
            }, 'gi').replace(reFilterDomains, '').replace(/^:/, '');
        }
        var splitPageName = s.pageName.split(/:/);
        s.pageName = (store + ':' + s.pageName).clean();
        
        // channel - Global channel
        s.channel = (splitPageName.length < 4 ? 'home' : splitPageName[3]).clean();
        
        // hier1 - Site specific hierarchy, exclude store
        s.hier1 = s.pageName.mreplace({
            '^[^:]+:': '',
            ':': '|',
            '^|': ''
        });
        // hier2 - Full hierarchy, including store & language
        s.hier2 = s.pageName.mreplace({
            ':': '|',
            '^|': ''
        });
        // hier3
        s.hier3 = (store + ':' + language + ':shopping' + s.hier1.replace(/^[^|]+|/, '')).replace(/:/g, '|').clean();
        // hier4
        s.hier4 = '';
        // hier5
        s.hier5 = '';
        
        // campaign - External Campaigns
        s.campaign = s.getQueryParam('cmpid,cid,mid');
        // Deflate campaign click-throughs
        s.campaign = s.getValOnce(s.campaign, 'ctc', 0);
        
        /************************** Traffic variables (aka Custom Insights or props) **************************/
        // 1. Top Stories
        // 2. Video Sub Account
        // 3. Site Section Level 2	
        if (splitPageName[3]) 
            s.prop3 = splitPageName[3].clean();
        // 4. Site Section Level 3
        if (splitPageName[4]) 
            s.prop4 = splitPageName[4].clean();
        // 5. Site Section Level 4
        if (splitPageName[5]) 
            s.prop5 = splitPageName[5].clean();
        // 6. Site Section Level 5
        if (splitPageName[6]) 
            s.prop6 = splitPageName[6].clean();
        // 7. Division/Store
        s.prop7 = store;
        // 8. Time Parting (hour)
        var yr = new Date().getFullYear();
        s.prop8 = s.getTimeParting('h', '-5', yr);
        // 9. Time Parting (day)
        s.prop9 = s.getTimeParting('d', '-5', yr);
        // 10. Time Parting (weekday/weekend)
        s.prop10 = s.getTimeParting('w', '-5', yr);
        // 11.
        // 12. Article Name
        // 13. Article Author
        // 14. Article Pagination
        // 15. Photo Galleries
        // 16. Photo/slide number
        // 17. Top Blogs
        // 18. Top Printed pages
        // 20. Content Source
        // 21. Days since last visit & set on all pages if found
        s.prop21 = s.getDaysSinceLastVisit('s_lv');
        // 22. Global channel
        s.prop22 = 'shopping';
        // 23. Language
        s.prop23 = language;
        // 24. Product Name - set on product pages
        // 25. Product type and name
        // 26. Visit number
        s.prop26 = s.getVisitNum();
        // 27.
        // 28.
        // 29.
        // 30. Form Analysis (s_code)
        // 31. Internal Search Term
        if ($jitt('.searchedWord').length) 
            s.prop31 = $jitt('#searchSelect option:selected').text().clean() + ' (' + $jitt('#searchSelect').val() + '):' + $jitt.trim($jitt('.searchedWord').text().replace(/[«»]/g, '')).clean();
        // 32. Nbr of Search Results Returned
        if ($jitt('.nbResults').length) 
            s.prop32 = $jitt('.nbResults').text().match(/\d+/)[0];
        // 33. User ID
        // 34. Flash tracking
        // 35. AJAX tracking
        // 36. Site Section Level 6
        if (splitPageName[7]) 
            s.prop36 = splitPageName[7].clean();
        // 37. Province *** TODO
        s.prop37 = 'qc';
        // 38. Video Title
        // 39. Video ID
        // 40. 
        // 41. User Selected City
        // 42. Trade Region
        // 43. RID Campaigns
        // 44.
        // 45.
        // 46.
        // 47.
        // 48.
        // 49.
        // 50.
        
        /************************** Conversion variables (aka eVars) **************************/
        // 1. Internal Campaigns
        s.eVar1 = s.getQueryParam('icid,imid');
        // 2. PageName
        s.eVar2 = s.pageName;
        // 3. Channel
        s.eVar3 = s.channel;
        // 4. Content hierarchy
        s.eVar4 = s.hier1;
        // 5. Site Search Terms (s_code)
        s.eVar5 = s.prop31;
        // 6. Days Since Last Visit
        s.eVar6 = s.prop21;
        // 7. Merchandising Category (see event1)
        // 8. Job Type Searched
        // 9. Job Location Searched
        // 10. Lead Type
        // 11. Ad Merchandising
        // 12. Form Analysis
        // 13. User Type
        // 14. Button Clicked
        // 15. User Content
        // 16. Picture ID
        // 17. Album ID
        // 18. Video Sub-Account
        // 19. Video Title
        // 20. Video ID
        // 21. Content Length
        // 22. Video Playerlist
        // 23. Video Player ID
        // 24. Shipping Method (for purchase event)
        // 25. Multi purpose
        // 26. Payment Method (for purchase event)
        // 27. Finding Method
        s.eVar27 = 'browse';
        if (s.campaign) 
            s.eVar27 = 'campaign';
        if (s.eVar1) // internal campaign
            s.eVar27 = 'icampaign';
        if (/-...\d+-.+-ct/i.test(location.pathname)) // Catalogue browsing by topics
            s.eVar27 = 'category';
        if ($jitt('searchWord').length) // Internal search
            s.eVar27 = 'search';
        // 28. Product Discount (for purchase event)
        // 29. Order Discount (for purchase event)
        // 30. Form Analysis
        // s.eVar30 = s.prop30;
        // 31. Content Source - Unique search term (see event2)
        // 32. Album Hierarchy
        // 33. Flash Tracking
        // 34. URL
        // 35. Category
        if (/-...\d+-.+-ct/i.test(location.pathname)) 
            s.eVar35 = s.hier1.replace(/\|/g, ':');
        // 36. Language
        s.eVar36 = s.prop23;
        
        /************************** Events **************************/
        // prodView - Product page custom handling
        if (m = location.pathname.match(/-(...\d+)-.+-pr/)) {
            s.prop11 = m[1]; // Article/Product ID
            if ($jitt('.status-preorder').length) 
                s.prop11 = 'P' + s.prop11;
            s.prop12 = $jitt('.productInfos>h3').text().clean() + '(' + s.prop11 + ')'; // Product Name:SKU
            s.prop13 = $jitt('.prodDescr').text().clean() + '(' + s.prop11 + ')'; // Author:SKU
            s.prop19 = 'ecom:' + s.channel; // Content Type
            s.prop24 = $jitt('.productInfos>h3').text().clean(); // Product name
            s.prop26 = 'yes'; // Indicate if a product has information on the page
            s.eVar7 = '';
            for (var x = 3; x < splitPageName.length - 1; x++) 
                s.eVar7 += splitPageName[x].clean() + ':'; // Marchandising Category
            s.eVar7 = s.eVar7.replace(/:$/, '');
            s.prop25 = s.eVar7 + ':' + s.prop24; // Product type & name
            s.products = ';' + s.prop11;
            s.events = s.apl(s.events, 'prodView', ',', 2);
            s.events = s.apl(s.events, 'event11', ',', 2);
        }
        
        // scAdd, scOpen - Add to cart custom handling - triggered when clicking the 'ajouter au panier' button
        $jitt('form[action*=_add_to_cart_inline_form],form[action*=_addToCartForm],.btnAddToCart').submit(function(){
            // scOpen - Cart Create triggered only 1st time add to card is called
            if (!$jitt.cookie('scOpen')) {
                s.events = s.apl(s.events, 'scOpen', ',', 2);
                $jitt.cookie('scOpen', '1');
            }
            s.events = s.apl(s.events, 'scAdd', ',', 2);
            s.products = ';' + $jitt('input[name$=.productId]', this).val();
            s.t();
        });
        
        // scRemove - Remove from cart custom handling - triggered when clicking the 'efface' button (on the cart page)
        $jitt('form[action*=_main_content]').submit(function(){
            s.events = s.apl(s.events, 'scRemove', ',', 2);
            s.products = ';' + $jitt('input:checked[class*=effacer]', this).val();
            s.t();
        });
        
        // scView - Shopping cart custom handling - Triggered when visiting the cart page
        if (/:cart$/.test(s.pageName)) {
            s.events = s.apl(s.events, 'scView', ',', 2);
            var products = {};
            validStores = '';
            for (key in storeList) 
                validStores = s.apl(validStores, key.toUpperCase(), '|', 2);
            var validStores = new RegExp('(' + validStores + ')');
            
            $jitt('#cart tbody tr').each(function(){ // for each product found, keep the product SKU in an associative array specific to each store
                store = $jitt('.company A IMG', this).attr('alt').toLowerCase();
                sku = $jitt('input[name^=pid_]', this).val();
                products[store] = s.apl(products[store], ';' + sku, ',', 2);
            });
            for (store in products) { // Loop again in each store
                var backup = {// Keep current values
                    un: s.un,
                    prop7: s.prop7,
                    pageName: s.pageName,
                    hier2: s.hier2,
                    hier3: s.hier3,
                    hier4: s.hier4,
                    hier5: s.hier5
                };

                s.products = products[store];
				var re = new RegExp('^...');
                s.pageName = s.pageName.replace(re, store); // Replace the store name in pageName, hier2 and others
                s.eVar2 = s.eVar2.replace(re, store);
                s.hier2 = s.hier2.replace(re, store);
                s.hier3 = s.hier3.replace(re, store);
                s.hier4 = s.hier4.replace(re, store);
                s.hier5 = s.hier5.replace(re, store);
                s.prop7 = store;
                setReportSuite(store); // Overwrite the Report Suite
                if (s.un != backup.un) // Make sure to generate a page view only if it's not the default store, otherwise double page views will be generated by the default SC call
                    s.t();
                $jitt.each(backup, function(){ // Reset vars to their original values
                    s[this] = backup[this];
                });
            }
        }
        
        // scCheckout - Begin checkout custom handling - triggered on 'Commanded maintenant' button click
        $jitt('.buyNowAction').click(function(){
            $jitt('form[action*=_main_content]').each(function(){
                s.products = s.apl(s.products, ';' + $jitt('input[id*=pid_]', this).val(), ',', 2);
            });
            s.events = s.apl(s.events, 'scCheckout', ',', 2);
        });
        
        // purchase - Confirmation custom handling - initiated on 'Purchase confirmation' page, completed on 'Thank you' page
        if (/co_confirm.jsp/.test(location.pathname)) {
            var products = {};
            validStores = '';
            for (key in storeList) 
                validStores = s.apl(validStores, key.toUpperCase(), '|', 2);
            var validStores = new RegExp('(' + validStores + ')');
            
            $jitt('.shopping-cart .cart-item').each(function(){
                store = ($jitt(this).attr('class').match(validStores)[1]).toLowerCase();
                sku = $jitt(this).attr('title');
                qty = $jitt('h5', this).text().match(/\((\d+)\)/)[1];
                price = $jitt('.price', this).text().replace(/\s*(\d+),(\d+)\s*\$/, '$1.$2');
                // 28. Product Discount *** TODO
                products[store] = s.apl(products[store], ';' + sku + ';' + qty + ';' + price, ',', 2);
            });
            var purchase = '';
            for (store in products) { // Loop again in each store	
            	var STORE = store.toUpperCase();
                // event12. Total shipping cost
                products[store] += ';event12=' + $jitt('.erp-raw-shipping-' + STORE).text().replace(/\s*(\d+),(\d+)\s*\$/, '$1.$2');
                // event13. Total tax amount
                products[store] += '|event13=' + (parseFloat($jitt('.erp-country-tax-' + STORE).text().replace(/\s*(\d+),(\d+)\s*\$/, '$1.$2')) + parseFloat($jitt('.erp-state-tax-' + STORE).text().replace(/\s*(\d+),(\d+)\s*\$/, '$1.$2')));
                // event15. Gift certificate value *** TODO
                products[store] += '|event15=0.00';
                purchase += 'products["' + store + '"]="' + products[store] + '";';
            }
            
            purchase += 's.state="' + ($jitt('.userInfos').text().match(/\xA0([^\xA0]+)\w\d\w\s*\d[a-z]\d/i)[1]).clean() + '";';
            purchase += 's.zip="' + ($jitt('.userInfos').text().match(/(.\d.\s*\d.\d)/)[1]).replace(/\s/g, '').toLowerCase() + '";';
            // 24. Shipping Method *** TODO
            // 26. Payment Method *** TODO
            // 29. Order Discount *** TODO
            $jitt.cookie('purchase', purchase);
        }
        
        //;sku70005;1;45.99;event12=0.00|event13=5.92|event15=0.00
        //products["ACH"]=";ACH002300639;1;13.59;event12=3.48|event13=2.19|event15=0.00";products["TSH"]=";sku110023;1;22.99;event12=4.95|event13=3.6|event15=0.00";s.state="quebec";s.zip="g6v9w3";
        //products["CAR"]=";sku70005;1;45.99;event12=0.00|event13=5.92|event15=0.00";s.state="quebec";s.zip="h4z0a3";
        if (/co_thank_you.jsp/.test(location.pathname)) {
            s.purchaseID = $jitt('.conf-num').text().match(/(.\d+)/)[0];
            s.events = s.apl(s.events, 'purchase', ',', 2);
            s.events = s.apl(s.events, 'event12', ',', 2);
            s.events = s.apl(s.events, 'event13', ',', 2);
            s.events = s.apl(s.events, 'event15', ',', 2);
            var products = {};
            eval($jitt.cookie('purchase'));
            for (store in products) { // Loop again in each store	
                var backup = {// Keep current values (use s.sa() to set a new account)
                    un: s.un,
                    prop7: s.prop7,
                    pageName: s.pageName,
                    hier2: s.hier2,
                    hier3: s.hier3,
                    hier4: s.hier4,
                    hier5: s.hier5
                };
                
                s.products = products[store];
				var re = new RegExp('^...');
                s.pageName = s.pageName.replace(re, store); // Replace the store name in pageName, hier2 and others
                s.eVar2 = s.eVar2.replace(re,store);
                s.hier2 = s.hier2.replace(re, store);
                s.hier3 = s.hier3.replace(re, store);
                s.hier4 = s.hier4.replace(re, store);
                s.hier5 = s.hier5.replace(re, store);
                s.prop7 = store;
                setReportSuite(store); // Overwrite the Report Suite
                if (s.un != backup.un) // Make sure to generate a page view only if it's not the default store, otherwise double page views will be generated by the default SC call
                    s.t();
                $jitt.each(backup, function(){ // Reset vars to their original values
                    s[this] = backup[this];
                });
            }
        }
        
        // 1. Page view
        s.events = s.apl(s.events, 'event1', ',', 2);
        // 2. Unique Searches - see event14
        // 3. Registration signup custom handling - triggered on home page after the registration form
        if (/qmi\/user\/homepage/.test(location.pathname) && /qmi\/user\/register/.test(document.referrer)) 
            s.events = s.apl(s.events, 'event3', ',', 2);
        // 4. Ad Impression
        // 5. Ad Clickthrough
        // 6. Resumes Submitted
        // 7. Jobs Viewed
        // 8. Jobs Applications
        // 9. Leads Initiated
        // 10. Leads Completed
        // 11.
        // 12. Shipping Cost (for purchase event)
        // 13. Tax Amount (for purchase event)
        // 14. Internal Search
        if ($jitt('searchedWord').length) {
            s.events = s.apl(s.events, 'event14', ',', 2);
            if (s.getValOnce(s.prop31, 'ust', 0)) 
                s.events = s.apl(s.events, 'event2', ',', '1');
        }
        // 15. Gift Certificate value (for purchase event)
        // 16.
        // 17. Search Center Impressions
        // 18. Search Center Pos Variable
        // 19. Search Center Keyword Cost
        // 20. Search Center Clicks
        // 21. Succesful logon - triggered after login form	
        if (/qmi\/user\/login/.test(document.referrer)) 
            s.events = s.apl(s.events, 'event21', ',', 2);
        // 22. Logout - triggered when 'deconnexion' button is clicked
        $jitt('.connexion a').click(function(){
            s.events = s.apl(s.events, 'event22', ',', 2);
            s.t();
        });
        // 23.
        // 24.
        // 25. Video Starts
        // 26. Video 25% Complete
        // 27. Video 50% Complete
        // 28. Video 75% Complete
        // 29. Video Complete
        // 30. Video % Complete
        // 31. Video Ad Starts
        // 32. Video Ad Complete
        // 33. Video Ad Clicks
        // 34. Video Ad Seconds Whatched
        // 35.
        // 36. Picture or album viewed
        // 37. Button clicked
        
        setTimeout("$jitt.tagIntegrity();", 600);
    } 
    catch (e) {
        $jitt.get('//canoe.112.2O7.net/b/ss/' + s.un + '/1/H.20.3--NS/0?ch=error&pageName=error:tag:' + e + (typeof e.name != 'undefined' ? ':' + e.name : '') + (typeof e.description != 'undefined' ? ':' + e.description : ''));
    }
}

/*
 * Self-error tag detection - check total tag length
 * @addon
 */
$jitt.tagIntegrity = function(){
    try {
        var t = (window['s_i_' + s.un] || window['s_i_' + s.visitorNamespace]).src;
        if (t.length > 2023) 
            $jitt.get('//canoe.112.2O7.net/b/ss/' + s.un + '/1/H.20.3--NS/0?ch=error&pageName=error:length:' + t.length + ':' + location.pathname);
        if (x = t.match(/(\w+)=undefined/)) 
            $jitt.get('//canoe.112.2O7.net/b/ss/' + s.un + '/1/H.20.3--NS/0?ch=error&pageName=error:undefined:' + x[0] + ':' + location.pathname);
    } 
    catch (e) {
        // ignore errors...
    }
}

$jitt.tags();
