ES.trackpage.addGoal({
    NavigationBrowsing: {
        getData: function (category) {
            var da = {
                CAT: category || ''
            };
            return da;
        }
    }
});
ES.trackpage.addAction({
    Close: {
        getData: function (area) {
            var da = {
                FCS: area || ''
            };
            return da;
        }
    },
    EverydaySourceLogo: { keepingwith: 'Close' },
    CreateAccount: { keepingwith: 'Close' },
    GoToMyAccount: { keepingwith: 'Close' },
    SignIn: {
        getData: function (area, emailAddress) {
            var da = {
                FCS: area || '',
                EML: emailAddress || ''
            };
            return da;
        }
    },
    SignOut: { keepingwith: 'Close' },
    WishList: { keepingwith: 'Close' },
    RecentlyViewed: { keepingwith: 'Close' },
    ItemImageClick: { 
        getData: function (area, actionContent, itemNum, cate, brand, series, model, proType, subProType) {
            var da = {
                FCS: area || '',
                ACC: actionContent || '',
                ITM: itemNum || '',
                CAT: cate || '', //category name
                PRD: proType || '', //Producttype name
                SBP: subProType || '', //Sub producttype name
                BRN: brand || '', //BrandName
                SRS: series || '', //Series name,
                MDL: model || '' //model name
            };
            return da;
        }
    },
    ItemNameClick: { keepingwith: 'ItemImageClick' },
    ItemTitleClick: { keepingwith: 'ItemImageClick' },

    Cart: { keepingwith: 'Close' },
    ViewCart: { keepingwith: 'Close' },
    SubscribeNewsLetter: { keepingwith: 'Close' },
    Rewarded: { keepingwith: 'Close' },
    Ebaydsrbanner: { keepingwith: 'Close' },
    Click: {
        getData: function (area, actionContent) {
            var da = {
                FCS: area || '',
                ACC: actionContent || ''
            };
            return da;
        }
    },
    Banner: { keepingwith: 'Click' },
    //QuickInfo: {  },
    AutoNotification: {
        getData: function (itemNum) {
            var da = {
                ITM: itemNum || ''
            };
            return da;
        }
    },
    BreadCrumb: { keepingwith: 'Click' },
    AllModel: {
        getData: function (area, cate, brand, actionContent) {
            var da = {
                CAT: cate || '',
                BRN: brand || '',
                FCS: area || '',
                ACC: actionContent || ''
            };
            return da;
        }
    },
    MostPopularModels: { keepingwith: 'AllModel' },
    NarrowDown: {  
        getData: function (area, actionContent, cate, brand, series, model, proType, subProType) {
            var da = {
                FCS: area || '',
                ACC: actionContent || '',
                CAT: cate || '', //category name
                PRD: proType || '', //Producttype name
                SBP: subProType || '', //Sub producttype name
                BRN: brand || '', //BrandName
                SRS: series || '', //Series name,
                MDL: model || '' //model name
            };
            return da;
        }
    },
    TabSwitch: {
        getData: function (area, actionContent, itemNum) {
            var da = {
                FCS: area || '',
                ACC: actionContent || '',
                ITM: itemNum || ''
            };
            return da;
        }    
     },
    Review: { keepingwith: 'TabSwitch' },
    ViewLarger: {
        getData: function (area, itemNum) {
            var da = {
                FCS: area || '',
                ITM: itemNum || ''
            };
            return da;
        }
    },
    MoreBuyChoices: { keepingwith: 'TabSwitch' },
    ViewFull: { keepingwith: 'ViewLarger' },
    NeedHelp: { keepingwith: 'Click' },
    Sharelink: { keepingwith: 'Click' },
    QuickLink: { keepingwith: 'Click' },
    ShopWithConfidence: { keepingwith: 'Click' },
    BackToQuickFinder: {
        getData: function (cate, brand, series, model, proType, subProType) {
            var da = {
                CAT: cate || '', //category name
                PRD: proType || '', //Producttype name
                SBP: subProType || '', //Sub producttype name
                BRN: brand || '', //BrandName
                SRS: series || '', //Series name,
                MDL: model || '' //model nam
            };
            return da;
        }
    },
    FindFastCat: {
        getData: function (area, cate, brand, series, model, proType, subProType, actionContent) {
            var da = {
                FCS: area || '',
                ACC: actionContent || '',
                CAT: cate || '', //category name
                PRD: proType || '', //Producttype name
                SBP: subProType || '', //Sub producttype name
                BRN: brand || '', //BrandName
                SRS: series || '', //Series name,
                MDL: model || '' //Model name
            };
            return da;
        }
    },
    ViewStyleSwitch: { keepingwith: 'FindFastCat' },
    Sorting: { keepingwith: 'FindFastCat' },
    SeeAllClick: { keepingwith: 'FindFastCat' },
    PageSizeSwitch: { keepingwith: 'FindFastCat' },
    Paging: { keepingwith: 'FindFastCat' },
    FIndPassword: { keepingwith: 'Close' },
    Update: { keepingwith: 'TabSwitch' },
    Remove: { keepingwith: 'TabSwitch' },
    MoveToCart: { keepingwith: 'TabSwitch' },
    ContinueShopping: { keepingwith: 'Close' },
    CheckOut: { keepingwith: 'Close' },
    PaypalCheckout: { keepingwith: 'Close' },
    ViewWishList: { keepingwith: 'Close' },
    MoveToSaveItem: { keepingwith: 'TabSwitch' },
    MoveToWishList: { keepingwith: 'TabSwitch' },
    MovetoCart: { keepingwith: 'TabSwitch' },
    ApplyCoupon: { keepingwith: 'Click' },
    ShippingMethodSwitch: { keepingwith: 'Click' },
    CheckOutAsGuest: { keepingwith: 'Close' },
    NeedHelpWithCheckOut: { keepingwith: 'Close' },
    ViewShoppingInfo: { keepingwith: 'Close' },
    Back: { keepingwith: 'Close' },
    PreviewOrder: { keepingwith: 'Close' },
    Confirm: { keepingwith: 'Close' },
    Impression: { keepingwith: 'ViewLarger' }
});
/*-- tracking code --*/
(function () {
    ES.callbackTuple.add({
        'Close': function (pagetype, area) {
            ES.trackpage.doAction('Close', pagetype, area);
        },
        'EverydaySourceLogo': function (pagetype, area) {
            ES.trackpage.doAction('EverydaySourceLogo', pagetype, area);
        },
        'CreateAccount': function (pageType, area) {
            ES.trackpage.doAction('CreateAccount', pageType, area);
        },
        'GoToMyAccount': function (pageType, area) {
            ES.trackpage.doAction('GoToMyAccount', pageType, area);
        },
        'SignIn': function (pageType, area, emailAddress) {
            ES.trackpage.doAction('SignIn', pageType, area, emailAddress);
        },
        'SignOut': function (pageType, area) {
            ES.trackpage.doAction('SignOut', pageType, area);
        },
        'WishList': function (pageType, area) {
            ES.trackpage.doAction('WishList', pageType, area);
        },
        'RecentlyViewed': function (pagetype, area) {
            ES.trackpage.doAction('RecentlyViewed', pagetype, area);
        },
        'Cart': function (pagetype, area) {
            ES.trackpage.doAction('Cart', pagetype, area);
        },
        'ViewCart': function (pagetype, area) {
            ES.trackpage.doAction('ViewCart', pagetype, area);
        },
        'Banner': function (pagetype, area, actionContent) {
            ES.trackpage.doAction('Banner', pagetype, area, actionContent);
        },
        'SubscribeNewsLetter': function (pageType, area) {
            ES.trackpage.doAction('SubscribeNewsLetter', pageType, area);
        },
        'Rewarded': function (pagetype, area) {
            ES.trackpage.doAction('Rewarded', pagetype, area);
        },
        'Ebaydsrbanner': function (pagetype, area) {
            ES.trackpage.doAction('Ebaydsrbanner', pagetype, area);
        },
        'Click': function (pageType, area, actionContent) {
            ES.trackpage.doAction('Click', pageType, area, actionContent);
        },
        //'QuickInfo': function (itemNum) {
        //    ES.trackpage.doAction('QuickInfo', get_siteinfo.pagetype(), itemNum);
        //},
        'AutoNotification': function (pagetype, itemNum) {
            ES.trackpage.doAction('AutoNotification', pagetype, itemNum);
        },
        'BreadCrumb': function (pagetype, area, actionContent) {
            ES.trackpage.doAction('BreadCrumb', pagetype, area, actionContent);
        },
        'AllModel': function (pagetype, area, cate, brand, actionContent) {
            ES.trackpage.doAction('AllModel', pagetype, area, cate, brand, actionContent);
        },
        'MostPopularModels': function (pagetype, area, cate, brand, actionContent) {
            ES.trackpage.doAction('MostPopularModels', pagetype, area, cate, brand, actionContent);
        },
        'NarrowDown': function (pagetype, area, actionContent, cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('NarrowDown', pagetype, area, actionContent, cate, brand, series, model, proType, subProType);
        },
        'Review': function (pagetype, area, actionContent, itemNum) {
            ES.trackpage.doAction('Review', pagetype, area, actionContent, itemNum);
        },
        'ViewLarger': function (pagetype, area, itemNum) {
            ES.trackpage.doAction('ViewLarger', pagetype, area, itemNum);
        },
        'MoreBuyChoices': function (pagetype, area, actionContent, itemNum) {
            ES.trackpage.doAction('MoreBuyChoices', pagetype, area, actionContent, itemNum);
        },
        'TabSwitch': function (pagetype, area, itemNum, actionContent) {
            ES.trackpage.doAction('TabSwitch', pagetype, area, actionContent, itemNum);
        },
        'ViewFull': function (pagetype, area, itemNum) {
            ES.trackpage.doAction('ViewFull', pagetype, area, itemNum);
        },
        'NeedHelp': function (pagetype, area, actionContent) {
            ES.trackpage.doAction('NeedHelp', pagetype, area, actionContent);
        },
        'Sharelink': function (pagetype, area, actionContent) {
            ES.trackpage.doAction('Sharelink', pagetype, area, actionContent);
        },
        'ShopWithConfidence': function (pagetype, area, actionContent) {
            ES.trackpage.doAction('ShopWithConfidence', pagetype, area, actionContent);
        },
        'QuickLink': function (pagetype, area, actionContent) {
            ES.trackpage.doAction('QuickLink', pagetype, area, actionContent);
        },
        'BackToQuickFinder': function (pagetype, cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('BackToQuickFinder', pagetype, cate, brand, series, model, proType, subProType);
        },
        'FindFastCat': function (pagetype, area, cate, brand, series, model, proType, subProType, actionContent) {
            ES.trackpage.doAction('FindFastCat', pagetype, area, cate, brand, series, model, proType, subProType, actionContent);
        },
        'ViewStyleSwitch': function (pagetype, area, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('ViewStyleSwitch', pagetype, area, cate, brand, series, model, proType, subProType,actionContent);
        },
        'Sorting': function (pagetype, area, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('Sorting', pagetype, area,cate, brand, series, model, proType, subProType, actionContent);
        },
        'SeeAllClick': function (pagetype, area, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('SeeAllClick', pagetype, area,cate, brand, series, model, proType, subProType, actionContent);
        },
        'PageSizeSwitch': function (pagetype, area, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('PageSizeSwitch', pagetype, area,cate, brand, series, model, proType, subProType, actionContent);
        },
        'Paging': function (pagetype, area, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('Paging', pagetype, area,cate, brand, series, model, proType, subProType, actionContent);
        },
        'FIndPassword': function (pageType, area) {
            ES.trackpage.doAction('FIndPassword', pageType, area);
        },
        'Update': function (pageType, area, itemNum) {
            ES.trackpage.doAction('Update', pageType, area, itemNum);
        },
        'Remove': function (pageType, area, itemNum) {
            ES.trackpage.doAction('Remove', pageType, area, itemNum);
        },
        'MoveToCart': function (pageType, area, itemNum) {
            ES.trackpage.doAction('MoveToCart', pageType, area, itemNum);
        },
        'ItemImageClick': function (pagetype, area, itemNum, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('ItemImageClick', pagetype, area, actionContent, itemNum,cate, brand, series, model, proType, subProType);
        },
        'ItemNameClick': function (pagetype, area, itemNum, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('ItemNameClick', pagetype, area, actionContent, itemNum,cate, brand, series, model, proType, subProType);
        },
        'ItemTitleClick': function (pagetype, area, itemNum, actionContent,cate, brand, series, model, proType, subProType) {
            ES.trackpage.doAction('ItemTitleClick', pagetype, area, actionContent, itemNum,cate, brand, series, model, proType, subProType);
        },
        'ContinueShopping': function (pagetype, area) {
            ES.trackpage.doAction('ContinueShopping', pagetype, area);
        },
        'CheckOut': function (pagetype, area) {
            ES.trackpage.doAction('CheckOut', pagetype, area);
        },
        'PaypalCheckout': function (pageType, area) {
            ES.trackpage.doAction('PaypalCheckout', pageType, area);
        },
        'ViewWishList': function (pageType, area) {
            ES.trackpage.doAction('ViewWishList', pageType, area);
        },
        'MoveToSaveItem': function (pageType, area, itemNum) {
            ES.trackpage.doAction('MoveToSaveItem', pageType, area, itemNum);
        },
        'MoveToWishList': function (pageType, area, itemNum) {
            ES.trackpage.doAction('MoveToWishList', pageType, area, itemNum);
        },
        'MovetoCart': function (pageType, area, itemNum) {
            ES.trackpage.doAction('MovetoCart', pageType, area, itemNum);
        },
        'ApplyCoupon': function (pageType, area, actionContent) {
            ES.trackpage.doAction('ApplyCoupon', pageType, area, actionContent);
        },
        'ShippingMethodSwitch': function (pageType, area, actionContent) {
            ES.trackpage.doAction('ShippingMethodSwitch', pageType, area, actionContent);
        },
        'CheckOutAsGuest': function (pageType, area) {
            ES.trackpage.doAction('CheckOutAsGuest', pageType, area);
        },
        'NeedHelpWithCheckOut': function (pageType, area) {
            ES.trackpage.doAction('NeedHelpWithCheckOut', pageType, area);
        },
        'ViewShoppingInfo': function (pageType, area) {
            ES.trackpage.doAction('ViewShoppingInfo', pageType, area);
        },
        'Back': function (pageType, area) {
            ES.trackpage.doAction('Back', pageType, area);
        },
        'PreviewOrder': function (pageType, area) {
            ES.trackpage.doAction('PreviewOrder', pageType, area);
        },
        'Confirm': function (pageType, area) {
            ES.trackpage.doAction('Confirm', pageType, area);
        },
        'Impression': function (area,itemNum) {
            ES.trackpage.doAction('Impression', 'Item', area,itemNum);
        }
    });

    //top navigation tracking
    $(function () {
        $('#NavMain').click(function (e) {
            var tar = e.target,
				tag = tar && tar.tagName,
				cate;
            if (tag === 'A' || tag === 'SPAN') {
                if(tag==='SPAN')
                  tar=$(tar).parent();
                cate =$(tar).attr('href').match(/Accessories\/(\d+)/im);
                if(cate !=null)
                  cate=cate[1];
                ES.trackpage.tracking('NavigationBrowsing', get_siteinfo.pagetype(), cate);
            }
        });
        $('#NavSonWrap').click(function (e) {
            var tar = e.target,
				tag = tar && tar.tagName,
				cate;
            if (tag === 'A') {
                cate =$(tar).attr('href').match(/Accessories\/(\d+)\?/im);
                if(cate !=null)
                  cate=cate[1];
                ES.trackpage.tracking('NavigationBrowsing', get_siteinfo.pagetype(), cate);
            }
        });
        //TopHeader_Left   
        $('a[title="EverydaySouce"]').click(function () {
            ES.callbackTuple.execute('EverydaySourceLogo', get_siteinfo.pagetype(), 'TopHeader_Left');
        });
        $('#headTL a:first').click(function () {
            var actionConten = this.innerHTML.toLowerCase(),
                action;
            if (actionConten.indexOf('create') > -1) {
                action = 'CreateAccount';
            }
            else {
                action = 'GoToMyAccount';
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'TopHeader_Left');
        });
        $('#headTL a:last').click(function () {
            var signInStatus = $.trim(this.innerHTML.toLowerCase());
            if (signInStatus == 'sign in') {
                ES.callbackTuple.execute('SignIn', get_siteinfo.pagetype(), 'TopHeader_Left', '');
            }
            else if (signInStatus == 'click here') {
                ES.callbackTuple.execute('SignOut', get_siteinfo.pagetype(), 'TopHeader_Left');
            }
        });
        //TopHeader_Right  
        $('.head-links a').click(function () {
            ES.callbackTuple.execute('Click', get_siteinfo.pagetype(), 'TopHeader_Right', $(this).text());
        });
        $('.mcafee a').click(function () {
            ES.callbackTuple.execute('Click', get_siteinfo.pagetype(), 'TopHeader_Right', 'mcafee');
        });
        //MyAcount   
        $('#MyAccount').click(function () {
            ES.callbackTuple.execute('GoToMyAccount', get_siteinfo.pagetype(), 'TopHeader_MyAccount');
        });
        $('#MyAccountShow').each(function () {
            var signInBtn = $(this).find('#SignInSumbit');
            var createAccountBtn = $(this).find('.create-account .link-red');
            var goToMyAccountBtn = $(this).find('.login-done a[title="Go to My Account"]');
            var signOutBtn = $(this).find('.login-done a[title="Sign Out"]');
            var close = $(this).find('.dialog-close');
            signInBtn.click(function () { ES.callbackTuple.execute('SignIn', get_siteinfo.pagetype(), 'TopHeader_MyAccount', $('#MyAccountShow #emailAddress').val()); });
            createAccountBtn.click(function () { ES.callbackTuple.execute('CreateAccount', get_siteinfo.pagetype(), 'TopHeader_MyAccount'); });
            goToMyAccountBtn.click(function () { ES.callbackTuple.execute('GoToMyAccount', get_siteinfo.pagetype(), 'TopHeader_MyAccount'); });
            signOutBtn.click(function () { ES.callbackTuple.execute('SignOut', get_siteinfo.pagetype(), 'TopHeader_MyAccount'); });
            close.click(function () { ES.callbackTuple.execute('Close', get_siteinfo.pagetype(), 'MyAccount'); });
        });
        //WishList  
        $('#WishList').click(function () {
            ES.callbackTuple.execute('WishList', get_siteinfo.pagetype(), 'TopHeader_Wishlist');
        });
        $('#DialogWishList').each(function () {
            $(this).find('.dialog-close').click(function () { ES.callbackTuple.execute('Close', get_siteinfo.pagetype(), 'WishList'); });
            $(this).find('.wrap-item .data-item dt a').live('click', function () {
                ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'TopHeader_Wishlist', getItemNum($(this).attr('href')), '','', '', '', '', '', '');
            });
        });
        //RecentlyViewed  
        $('#RecentlyViewed').click(function () {
            ES.callbackTuple.execute('RecentlyViewed', get_siteinfo.pagetype(), 'TopHeader_RecentlyViewed');
        });
        $('#DialogRecentlyViewed').each(function () {
            $(this).find('.dialog-close').click(function () { ES.callbackTuple.execute('Close', get_siteinfo.pagetype(), 'RecentlyViewed'); });
            $(this).find('.wrap-item .data-item').each(function () {
                var title = $(this).find(' a:first');
                title.click(function () { ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'TopHeader_RecentlyViewed', getItemNum($(this).attr('href')), '','', '', '', '', '', ''); });
            });
        });
        //Cart  
        $('#MyCart').click(function () {
            ES.callbackTuple.execute('Cart', get_siteinfo.pagetype(), 'TopHeader_Cart');
        });
        $('#DialogMyCart').each(function () {
            $(this).find('.dialog-close').click(function () { ES.callbackTuple.execute('Close', get_siteinfo.pagetype(), 'MyCart'); });
            $(this).find('.link-redgo').click(function () { ES.callbackTuple.execute('ViewCart', get_siteinfo.pagetype(), 'TopHeader_Cart'); });
            $(this).find('.wrap-item .cart-item .title a').live('click', function () {
                ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'TopHeader_Cart', getItemNum($(this).attr('href')), '','', '', '', '', '', '');
            });
            $(this).find('.wrap-item .cart-item .pic a').live('click', function () {
                ES.callbackTuple.execute('ItemImageClick', get_siteinfo.pagetype(), 'TopHeader_Cart', getItemNum($(this).attr('href')), '','', '', '', '', '', '');
            });
        });
        //MainBanner  
        $('.banner area').click(function () {
            ES.callbackTuple.execute('Banner', get_siteinfo.pagetype(), 'Main_Banner', $(this).attr('alt'));
        });
        //FraturedBanner   
        $('.bn-indexcol area').click(function () {
            ES.callbackTuple.execute('Banner', get_siteinfo.pagetype(), 'Featured_Banner', $(this).attr('alt'));
        });
        //Bottom_Upper_Banner   
        $('#Subscription_btn').click(function () {
            ES.callbackTuple.execute('SubscribeNewsLetter', get_siteinfo.pagetype(), 'Bottom_Upper_Banner');
        });
        $('#SubscribeBtn').click(function () {
            ES.callbackTuple.execute('SubscribeNewsLetter', get_siteinfo.pagetype(), 'UnSubscribe');
        });
        $('#submitSubcribe').click(function () {
            ES.callbackTuple.execute('SubscribeNewsLetter', get_siteinfo.pagetype(), 'Subscribe');
        });
        $('.bn-foot a').click(function () {
            var action;
            if ($(this).attr('title') === 'rewarded') {
                action = 'Rewarded';
            }
            else {
                action = 'Ebaydsrbanner';
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'Bottom_Upper_Banner');
        });
        //Footer_Info  
        $('.guide-links').find('a').each(function () {
            $(this).click(function () {
                ES.callbackTuple.execute('Click', get_siteinfo.pagetype(), 'Footer_Info', $(this).text());
            });
        });
        $('.site-security').find('a').each(function(){
            $(this).click(function () {
                    var actioncontent;
                    actioncontent=$(this).attr('title');
                    if(actioncontent === undefined||actioncontent === "")
                    {              
                        actioncontent=$(this).find('img').attr('alt');
                    }
                    ES.callbackTuple.execute('Click', get_siteinfo.pagetype(), 'Site_Security', GetActionContent(actioncontent));
                });
        });
        //BestSeller   
        $('#BestSellersCarousel li').each(function () {
            var image = $(this).find('.pic a');
            var name = $(this).find('.info h2 a');
            var desc = $(this).find('.info .desc a');
            image.click(function () { ES.callbackTuple.execute('ItemImageClick', get_siteinfo.pagetype(), 'Best_Seller', getItemNum($(this).attr('href')), '','', '', '', '', '', ''); });
            name.click(function () { ES.callbackTuple.execute('ItemNameClick', get_siteinfo.pagetype(), 'Best_Seller', getItemNum($(this).attr('href')), '','', '', '', '', '', ''); });
            desc.click(function () { ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'Best_Seller', getItemNum($(this).attr('href')), '','', '', '', '', '', ''); });
        });
//        //AutoNotification   DialogÓÐÎÊÌâ:Summary 
//        $('#NotifyDialogBox').each(function () {
//            var close = $(this).find('.dialog-close');
//            var notifyMe = $(this).find('input[name="ANSumbit"]');
//            var itemNum = $(this).find('#ItemNum').val();
//            close.click(function () { ES.callbackTuple.execute('Close', get_siteinfo.pagetype(), 'AutoNotification'); });
//            notifyMe.click(function () { ES.callbackTuple.execute('AutoNotification', get_siteinfo.pagetype(), itemNum); });
//        });
        //BreadCrumb    
        $('.nav-path a').click(function () {
            ES.callbackTuple.execute('BreadCrumb', get_siteinfo.pagetype(), 'BreadCrumb', $(this).text());
        });
        //MostPopularModels    
        $('#MostPopularModelsContainer .item-pop').each(function () {
            var params=GetParama().split('##');
            var brand =params[1];
            var cate =params[0];
            var actionContent = $(this).find('.title a').text();
            $(this).find('a').click(function () { ES.callbackTuple.execute('MostPopularModels', get_siteinfo.pagetype(), 'Most_Pop_Model', cate, brand, actionContent); });
        });
        //AllModel    
        $('#ModelContainer .item-pop a').live('click', function () {
            var params=GetParama().split('##');
            var brand =params[1];
            var cate =params[0];
            var actionContent = $(this).parent().parent().find('.title a').text();
            ES.callbackTuple.execute('AllModel', get_siteinfo.pagetype(), 'Model_Container', cate, brand, actionContent);
        });
        //RefineSearch    
        $('#CateByType .cate-type').each(function () {
            var type = $(this).find('h2').text();//Model,Brand,Producttype,SubProducttype,PriceRange,Color,Length,UsefulLinks
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }  
            $(this).find('ul li a').each(function () {
                $(this).click(function () {
                    var action = 'Refine_Search_' + type.replace(' ', '');
                    var actionContent = $(this).text().split('(')[0];
                    ES.callbackTuple.execute('NarrowDown', get_siteinfo.pagetype(), action, actionContent, cate, brand, series, model, proType, subProType);
                });
            });
        });
        //link-seeall
        $('#CateByType .cate-type a').live('click', function () {
            if ($(this).text().split('(')[0] === 'see fewer') {
                var type = $(this).parents('.cate-type').find('h2').text();
                var action = 'Refine_Search_' + type.replace(' ', '');
                var parama=GetParama();
                var cate, brand, series, model, proType, subProType;
                if(parama!=undefined)
                {
                    var arr=parama.split("##");
                    cate=arr[0];
                    brand=arr[1];
                    model=arr[2];
                    series=arr[3];
                    proType=arr[4];
                    subProType=arr[5];
                }  
                ES.callbackTuple.execute('SeeAllClick', get_siteinfo.pagetype(), action, 'SeeAll',cate, brand, series, model, proType, subProType);
            }
        });
        //$('#J_ListQuickLink li a').live('click',function () {alert($(this).text().split('(')[0]);
        //    if($(this).text().split('(')[0]==='see fewer')
        //    {
        //        ES.callbackTuple.execute('SeeAllClick', 'Quick_Link','SeeAll');
        //    }
        //});
        //Promotion   
        $('#SearchResultContainer .et-subtype').click(function (e) {
            var tar = e.target,
				tag = tar && tar.tagName,
				cate, itemNum, promotionType, action;
            if (tag === 'A' || tag === 'IMG') {
                //cate = $.trim(replaceNavCatName($('.cate-title').find('strong').html()));
                itemNum = $(tar).parents('div.box-subtype').find('.et-subtype .cot .title span').text();
                promotionType = $.trim(replaceNavCatName($(tar).parents('div.box-subtype').find('.mod-title').text()));
                var parama=GetParama();
                var cate, brand, series, model, proType, subProType;
                if(parama!=undefined)
                {
                    var arr=parama.split("##");
                    cate=arr[0];
                    brand=arr[1];
                    model=arr[2];
                    series=arr[3];
                    proType=arr[4];
                    subProType=arr[5];
                }
                if (tag === 'IMG') {
                    action = 'ItemImageClick';
                }
               else {
                     if ($(tar).parent().hasClass('title') === true) {
                        action = 'ItemNameClick';
                    }
                    else if ($(tar).parent().hasClass('desc') === true) {
                        action = 'ItemTitleClick';
                    }
                }
                if (action != undefined) {
                    ES.callbackTuple.execute(action, get_siteinfo.pagetype(), promotionType, itemNum, '',cate, brand, series, model, proType, subProType);
                }
            }
        });
        //ItemPage   
        $('.item-rating a').click(function () {
            var itemNum = $.trim($('#ItemNumLbl').html()),
                actionContent = $.trim($(this).text());
            ES.callbackTuple.execute('Review', get_siteinfo.pagetype(), 'Item_Info', actionContent, itemNum);
        });
        $('#J_OpenLarger').click(function () {
            var itemNum = $.trim($('#ItemNumLbl').html());
            ES.callbackTuple.execute('ViewLarger', get_siteinfo.pagetype(), 'Item_Info', itemNum);
        });
        //    
        $('#MoreBuyChoices a').click(function () {
            var itemNum = $.trim($('#ItemNumLbl').html());
            var actionContentItemNum = getItemNum($(this).attr('href').replace('/?','?')); // ?????????
            ES.callbackTuple.execute('MoreBuyChoices', get_siteinfo.pagetype(), 'More_Buying_Choices', actionContentItemNum, itemNum);
        });
        $('#ItemDetailTab a').click(function () {
            var itemNum = $.trim($('#ItemNumLbl').html());
            ES.callbackTuple.execute('TabSwitch', get_siteinfo.pagetype(), 'Item_Details_Tabs', itemNum, $(this).find('span').html());
        });
        $('#BetterTogether .item-fbt').each(function () {
            var itemNum = $.trim($('#ItemNumLbl').html());
            var image = $(this).find('.pic img');
            var title = $(this).find('.cot a');
            var actionContentItemNum = $(this).find('.pic input').val();
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            image.click(function () { ES.callbackTuple.execute('ItemImageClick', get_siteinfo.pagetype(), 'Better_Together', itemNum, actionContentItemNum,cate, brand, series, model, proType, subProType); });
            title.click(function () { ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'Better_Together', itemNum, actionContentItemNum,cate, brand, series, model, proType, subProType); });
        });
        $('#J_BoxNeedHelp a').click(function () {
            ES.callbackTuple.execute('NeedHelp', get_siteinfo.pagetype(), 'Need_Help', $(this).text());
        });
        $('#J_BoxSharelink a').click(function () {
            ES.callbackTuple.execute('Sharelink', get_siteinfo.pagetype(), 'Share_This', $(this).text());
        });
        $('#J_ListQuickLink a').click(function () {
            ES.callbackTuple.execute('QuickLink', get_siteinfo.pagetype(), 'Quick_Link', $(this).text());
        });
        $('#J_BoxShopWithConfidence a').click(function () {
            var actionContent = '';
            var href = $(this).attr('href');
            if (href.indexOf('mcafeesecure') > -1) {
                actionContent = 'mcafee secure';
            }
            else if (href.indexOf('truste') > -1) {
                actionContent = 'truste';
            }
            else if (href.indexOf('returnpolicy') > -1) {
                actionContent = 'returnpolicy';
            }
            ES.callbackTuple.execute('ShopWithConfidence', get_siteinfo.pagetype(), 'Shop_With_Confidence', actionContent);
        });
        $('.box-MaySuggest .data-item-side a[class="MWSTitle"]').click(function () {
            var itemNum = $.trim($('#ItemNumLbl').html());
            var actionContentItemNum = $(this).parent().parent().find('#MItemNumHid').val();
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'May_We_Suggest', itemNum, actionContentItemNum,cate, brand, series, model, proType, subProType);
        });
        //
        $('#QFBackTo').click(function () {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }      
            ES.callbackTuple.execute('BackToQuickFinder', get_siteinfo.pagetype(), cate, brand, series, model, proType, subProType);
        });
        $('#FindFastCat span').click(function () {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }      
            ES.callbackTuple.execute('FindFastCat', get_siteinfo.pagetype(), 'Result_ProdType_Filter', cate, brand, series, model, proType, subProType, $(this).text());
        });
        //Result_Container_Header
        $('#RsOrderBy a').live('click', function () {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }      
            ES.callbackTuple.execute('ViewStyleSwitch', get_siteinfo.pagetype(), 'Result_Container_Header', $(this).text(),cate, brand, series, model, proType, subProType);
        });
        $('#selSortBy').live('change', function () {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }      
            var acionContent = $(this).children('option:selected').val() ? $(this).children('option:selected').text() : '';
            ES.callbackTuple.execute('Sorting', get_siteinfo.pagetype(), 'Result_Container_Header', acionContent,cate, brand, series, model, proType, subProType);
        });
        $("div.item-page-nav a").live('click', function () {
            var actionContent;
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }  
            if ($(this).children('img').length) {
                actionContent = $(this).parent('div').attr('class');
            }
            else {
                if ($(this).hasClass('see-all')) {
                    ES.callbackTuple.execute('SeeAllClick', get_siteinfo.pagetype(), 'Result_Container_Header', $(this).text(),cate, brand, series, model, proType, subProType);
                }
                else {
                    actionContent = $(this).find("span:first-child").text().replace(/^\s+|\s+$/g, "");
                }
            }
            if (actionContent != undefined) {
                ES.callbackTuple.execute('Paging', get_siteinfo.pagetype(), 'Result_Container_Header', actionContent,cate, brand, series, model, proType, subProType);
            }
        });
        $('#selPageSize').live('change', function (e) {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }  
            var acionContent = $(this).children('option:selected').val() ? $(this).children('option:selected').text() : '';
            ES.callbackTuple.execute('PageSizeSwitch', get_siteinfo.pagetype(), 'Result_Container_Header', acionContent,cate, brand, series, model, proType, subProType);
        });
        $("#SortBySel").live('change', function () {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }     
            var acionContent = $(this).children('option:selected').val() ? $(this).children('option:selected').text() : '';
            ES.callbackTuple.execute('Sorting', get_siteinfo.pagetype(), 'Wish_List_Header', acionContent,cate, brand, series, model, proType, subProType);
        });
        //Result_Container_Items
        $('.item-rs').each(function () {
            var itemNum = $(this).find('span[name=RSItemNum]').text();
            var image = $(this).find('.pic .pic-inner a');
            var title = $(this).find('.info .item-title a');
            var pageType = get_siteinfo.pagetype().toLowerCase(),
                area;
            if (pageType === 'quickfinderresult') {
                area = 'Result_Container_Main';
            }
            else if (pageType === 'searchresult') {
                area = 'Search_Result_Container_Main';
            }
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            image.click(function () { ES.callbackTuple.execute('ItemImageClick', get_siteinfo.pagetype(), area, itemNum, '',cate, brand, series, model, proType, subProType); });
            title.click(function () { ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), area, itemNum, '',cate, brand, series, model, proType, subProType); });
        });
        //Member 
        $('#SignInRegisteredLogin a').click(function () {
            ES.callbackTuple.execute('FIndPassword', get_siteinfo.pagetype(), 'Login_Pane');
        });
        $('#SignInBtnSignIn').click(function () {
            var emailAddress = $('#SignInLoginContent #emailAddress').val();
            ES.callbackTuple.execute('SignIn', get_siteinfo.pagetype(), 'Login_Pane', emailAddress);
        });
        $('#SignInBtnNewAccount').click(function () {
            ES.callbackTuple.execute('CreateAccount', get_siteinfo.pagetype(), 'Login_Pane');
        });
        //WishList
        $('.BtnList img').live('click', function () {
            var rArr = GetWishListSelectedItem();
            var selCnt = rArr.length;
            if (selCnt == 0) {
                return;
            }
            var index = $('.BtnList img').index(this),
                action;
            if (index === 0) {
                action = 'Update';
            }
            else if (index === 1) {
                action = 'Remove';
            }
            else if (index === 2) {
                action = 'MoveToCart';
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'Wish_List_Main', rArr);
        });
        $('#WishListGrid .WishListLine .ItemDesc a').live('click', function () {
            var itemNum = $(this).parents('#WishListGrid .WishListLine').find("input[name='ItemNumHid']").val();
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'Wish_List_Main', itemNum, '',cate, brand, series, model, proType, subProType);
        });
        $("#WishListGrid .WishListLine img[name='UpdateWLBtn']").live('click', function () {
            var itemNum = $(this).parents('#WishListGrid .WishListLine').find("input[name='ItemNumHid']").val();
            var qty = parseInt($(this).parent().find("input[name='ItemQtyTxt']").val(), 10);
            if (isNaN(qty) || qty <= 0) {
                $.dialog("Please enter a valid quantity.");
                return;
            }
            ES.callbackTuple.execute('Update', get_siteinfo.pagetype(), 'Wish_List_Main', itemNum);
        });
        $("#WishListGrid .WishListLine a[name='DelWLBtn']").live('click', function () {
            var itemNum = $(this).parents('#WishListGrid .WishListLine').find("input[name='ItemNumHid']").val();
            ES.callbackTuple.execute('Remove', get_siteinfo.pagetype(), 'Wish_List_Main', itemNum);
        });
        //Paging
        $("#WLSort a").live('click', function () {
            var actionContent;
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }  
            if ($(this).children('img').length) {
                var index = $('#WLSort img').index($(this).children('img'));
                if (index === 0) {
                    actionContent = 'Previous';


                }
                else if (index === 1) {
                    actionContent = 'Next';
                }
            }
            else {
                actionContent = $(this).find("span:first-child").text().replace(/^\s+|\s+$/g, "");
            }
            if (actionContent != undefined) {
                ES.callbackTuple.execute('Paging', get_siteinfo.pagetype(), 'Wish_List_Header', actionContent,cate, brand, series, model, proType, subProType);
            }

        });
        $("input[name='member.IsSubscribeNews']").live('click', function () {
            ES.callbackTuple.execute('SubscribeNewsLetter', get_siteinfo.pagetype(), 'Subcribe_Panel');
        });
        $("Input[name='SignOut']").click(function () {
            ES.callbackTuple.execute('SignOut', get_siteinfo.pagetype(), 'MyAccount');
        });
        //cart    
        $("#guideline a").click(function () {
            ES.callbackTuple.execute('BreadCrumb', get_siteinfo.pagetype(), 'BreadCrumb', $(this).text());
        });
        $("#CartContentLAlsoContent .LitmLetters a").click(function () {
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'Also_Bought', getItemNum($(this).attr('href'), '',cate, brand, series, model, proType, subProType));
        });
        $('#CS_btn_CS_top a').click(function () {
            ES.callbackTuple.execute('ContinueShopping', get_siteinfo.pagetype(), 'Cart_Main');
        });
        $("a[name='general']").click(function () {
            ES.callbackTuple.execute('CheckOut', get_siteinfo.pagetype(), 'Cart_Main');
        });
        $("#CsNotEmpty a[name='paypal']").click(function () {
            ES.callbackTuple.execute('PaypalCheckout', get_siteinfo.pagetype(), 'Cart_Main');
        });
        $("#CsViewWishList").click(function () {
            ES.callbackTuple.execute('ViewWishList', get_siteinfo.pagetype(), 'Cart_Main');
        });
        //cartSummary   
        $("#CsOperationBtn a").live('click', function () {
            var items = GetCartSelectedItem("#CsProductList");
            var selCnt = items.length;
            if (selCnt == 0) {
                return;
            }
            var index = $('#CsOperationBtn a').index(this);
            var action;
            if (index === 0) {
                action = 'Update'
            }
            else if (index === 1) {
                action = 'Remove'
            }
            else if (index === 2) {
                action = 'MoveToSaveItem'
            }
            else if (index === 3) {
                action = 'MoveToWishList'
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'Cart_Main', items);
        });

        $("#CsProductList table .CsListProductInfoDetails a").live('click', function () {
            var itemNum = $(this).parents().find('#CsProductList table .CsListProductInput input').val();
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'Cart_Main', itemNum, '',cate, brand, series, model, proType, subProType);
        });
        $("#CsProductList table .CsListQty a").live('click', function () {
            var itemNum = $(this).parents().find('#CsProductList table .CsListProductInput input').val();
            ES.callbackTuple.execute('Update', get_siteinfo.pagetype(), 'Cart_Main', itemNum);
        });
        $("#CsProductList table .CsListOperation a").live('click', function () {
            var itemNum = $(this).parents().find('#CsProductList table .CsListProductInput input').val();
            var index = $("#CsProductList table .CsListOperation a").index(this);
            var action;
            if (index === 0) {
                action = 'Remove'
            }
            else if (index === 1) {
                action = 'MoveToSaveItem'
            }
            else if (index === 2) {
                action = 'MoveToWishList'
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'Cart_Main', itemNum);
        });
        //SavedItem  OK
        $("#SiListOperationBtn img").live('click', function () {
            var items = GetCartSelectedItem("#SiProductList");
            var selCnt = items.length;
            if (selCnt == 0) {
                return;
            }
            var index = $("#SiListOperationBtn img").index(this);
            var action;
            if (index === 0) {
                action = 'Update'
            }
            else if (index === 1) {
                action = 'Remove'
            }
            else if (index === 2) {
                action = 'MovetoCart'
            }
            else if (index === 3) {
                action = 'MoveToWishList'
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'Save_Item', items);
        });
        $("#SiProductList table .CsListProductInfoDetails a").live('click', function () {
            var itemNum = $(this).parents().find('#SiProductList table .CsListProductInput input').val();
            var parama=GetParama();
            var cate, brand, series, model, proType, subProType;
            if(parama!=undefined)
            {
                var arr=parama.split("##");
                cate=arr[0];
                brand=arr[1];
                model=arr[2];
                series=arr[3];
                proType=arr[4];
                subProType=arr[5];
            }               
            ES.callbackTuple.execute('ItemTitleClick', get_siteinfo.pagetype(), 'Save_Item', itemNum, '',cate, brand, series, model, proType, subProType);
        });
        $("#SiProductList table .CsListQty a").live('click', function () {
            var itemNum = $(this).parents().find('#SiProductList table .CsListProductInput input').val();
            ES.callbackTuple.execute('Update', get_siteinfo.pagetype(), 'Save_Item', itemNum);
        });
        $("#SiProductList table .CsListOperation a").live('click', function () {
            var itemNum = $(this).parents().find('#SiProductList table .CsListProductInput input').val();
            var index = $("#SiProductList table .CsListOperation a").index(this);
            var action;
            if (index === 0) {
                action = 'Remove'
            }
            else if (index === 1) {
                action = 'MovetoCart'
            }
            else if (index === 2) {
                action = 'MoveToWishList'
            }
            ES.callbackTuple.execute(action, get_siteinfo.pagetype(), 'Save_Item', itemNum);
        });
        //
        $("#CsCoupon table tr:first a").live('click', function () {
            var couponCode = $('#CsShippingZ').val();
            ES.callbackTuple.execute('ApplyCoupon', get_siteinfo.pagetype(), 'Cart_Main', couponCode);
        });
        $("#J_CalculateBtn").live('click', function () {
            var shipMethod = $('#ShipMethods').val();
            ES.callbackTuple.execute('ShippingMethodSwitch', get_siteinfo.pagetype(), 'Cart_Main', shipMethod);
        });
        $("#SiListEmptyCreate").click(function () {
            ES.callbackTuple.execute('CreateAccount', get_siteinfo.pagetype(), 'Save_Item');
        });
        $("#SiListEmptySign").click(function () {
            ES.callbackTuple.execute('SignIn', get_siteinfo.pagetype(), 'Save_Item', '');
        });
        //CheckOut    OK
        var pageType;
        $("#Top a").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('NeedHelpWithCheckOut', pageType, 'CheckOut');
        });
        $("#ReturningCustomers a").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('FIndPassword', pageType, 'CheckOut');
        });
        $("#ReturningCustomers img").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            var emailAddress = $("#ReturningCustomers").find('input[name="emailAddress"]').val();
            ES.callbackTuple.execute('SignIn', pageType, 'CheckOut', emailAddress);
        });
        $("#NewCustomer img").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('CreateAccount', pageType, 'CheckOut');
        });
        $("#AsGuest img").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('CheckOutAsGuest', pageType, 'CheckOut');
        });
        $("#OtherCkotWay img").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('PaypalCheckout', pageType, 'CheckOut');
        });
        $("#B a").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('Click', pageType, 'CheckOut', GetActionContent($(this).text()));
        });
        $("#MostOrders a").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('ViewShoppingInfo', pageType, 'Shipping_Info');
        });
        $("#OrderInfo input[name='Subscribers']").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('SubscribeNewsLetter', pageType, 'Subscribe with us');
        });
        $("#CkotTruste img").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('Click', pageType, 'CheckOut', GetActionContent($(this).attr('alt')));
        });
        $("#CkotContentBtn a").live('click', function () {
            var index = $("#CkotContentBtn a").index(this),
                action;
            pageType = $.trim($("TITLE").html().split('|')[0]).toLowerCase();
            if ($("#CkotContentBtn a").length===2) {
                if (index === 0) {
                    action = 'Back';
                }
                else if (index === 1) {
                    action = 'PreviewOrder';
                }
            }
            else if ($("#CkotContentBtn a").length===1) {
                action = 'ContinueShopping';
            }
            ES.callbackTuple.execute(action, pageType, 'CheckOut');
        });
        $("#CkotContentBtnp a").live('click', function () {
            var index = $("#CkotContentBtnp a").index(this),
                action;
            pageType = $.trim($("TITLE").html().split('|')[0]).toLowerCase();
            if (index === 0) {
                action = 'Back';
            }
            else if (index === 1) {
                action = 'Confirm';
            }
            ES.callbackTuple.execute(action, pageType, 'CheckOut');
        });
        $("#CkotTitle a").click(function () {
            pageType = $.trim($("TITLE").html().split('|')[0]);
            ES.callbackTuple.execute('Click', pageType, 'CheckOut', 'ContactUs');
        });
    });
    function getItemNum(href) {
        if (href != '' && href != undefined) {
            href = href.split('?')[0];
            var itemNum = href.split('/')[href.split('/').length - 1];
            return itemNum.toUpperCase();
        }
        else {
            return null;
        }
    }
    function replaceNavCatName(cate) {
        return cate.replace(/(shop|accessories)/gim, '');
    }
    function GetWishListSelectedItem() {
        var arr = [];
        $("#WishListGrid tr[class='WishListLine']").each(function () {
            var chk = $(this).find("input[type='checkbox'][name='ChkLine']").get(0).checked;
            if (chk == true) {
                arr.push([$(this).find("input[name='ItemNumHid']").val()]);
            }
        });
        return arr;
    }
    function GetCartSelectedItem(id) {
        var itemData = [];
        if ($(id + " :input[checked='true']").length > 0) {
            $(id + " table").each(function () {
                if ($(this).find(".CsListProductInput > :input").attr("checked") == true) {
                    itemData.push([$(this).find(".CsListProductInput > :input").val()]);
                }
            });
        }
        return itemData;
    }
    function GetActionContent(actionContent)
    {
        if(actionContent.length > 100){
            return actionContent.substring(0,100);
        }
        else{
            return actionContent;
        }
    }
    function GetCategory()
    { 
        return GetParama().split('##')[0];
    }
})();
    function GetParama()
    {
        return "##########";
    }
//function translateImpression() {
//    var areas = '';
//    if ($('#Foot').length > 0) {
//        areas += ',Bottom_Upper_Banner,Footer_Info,Top_Banner,Top_NavBar,TopHeader_Left,TopHeader_MyAccount';
//        areas += ',TopHeader_RecentlyViewed,TopHeader_Right,TopHeader_SearchBar,TopHeader_Wishlist';
//    }

//    if ($('.nav-path a').length > 0)
//        areas += ',BreadCrumb';

//    //cart
//    if ($('#CsNotEmpty').length > 0)
//        areas += ',Cart_Main';
//    if ($('#SiListNotEmpty').length > 0)
//        areas += ',Save_Item';
//    if ($('#CartContentLAlsoContent div').length > 0)
//        areas += ',Also_Bought';

//    //checkout
//    if ($('#PaymentInfo').length > 0)
//        areas += ',Payment_Info';
//    if ($('#ShippingInfo').length > 0)
//        areas += ',Shipping_Info';
//    if ($('#BillInfo').length > 0)
//        areas += ',Billing_Info';
//    if ($('#OptionInfo input[name="Subscribers"]').length > 0)
//        areas += ',Subcribe_Panel';


//    //member
//    if ($('#WLNoEmptyT').length > 0)
//        areas += ',Wish_List_Header';
//    if ($('#WLNoEmptyM').length > 0)
//        areas += ',Wish_List_Main';
//    if ($('#SignInRegisteredLogin').length > 0)
//        areas += ',Login_Panel';

//    //ES
//    if ($('#RefineSrhText').length > 0)
//        areas += ',Search_Left';
//    if ($('div[class="finder finder-or"]').length > 0)
//        areas += ',Text_Quick_Finder';
//    if ($('#MostPopularModelsContainer .item-pop').length > 0)
//        areas += ',Most_Pop_Model';
//    if ($('#CateModel').length > 0)
//        areas += ',Model_Container,Refine_Search_Model';
//    if ($('#CateType').length > 0)
//        areas += ',Refine_Search_Prod';
//    if ($('#CateSubType').length > 0)
//        areas += ',Refine_Search_SubProd';
//    if ($('#CatePriceRange').length > 0)
//        areas += ',Refine_Search_PriceRange';
//    if ($('#CateColor').length > 0)
//        areas += ',Refine_Search_Color';
//    if ($('#CateLength').length > 0)
//        areas += ',Refine_Search_Length';
//    if ($('#CateUsefulLinks').length > 0)
//        areas += ',Refine_Search_Useful_Links';

//    if ($('#FindFastCat').length > 0)
//        areas += ',Result_ProdType_Filter';
//    if ($('#SearchResultContainer .item-list-top').length > 0)
//        areas += ',Result_Container_Header';
//    if ($('#SearchResultContainer .item-list-wrap').length > 0)
//        areas += ',Result_Container_Main';
//    var temp = $('#SearchResultContainer .mod-title');
//    if (temp.length > 0) {
//        for (var i = 0; i < temp.length; i++) {
//            switch (temp[i].innerHTML) {
//                case 'BEST SELLER': areas += ',BEST_SELLER'; break;
//                case 'HOT DEAL': areas += ',Hot_Deal'; break;
//                case 'CLEARANCE': areas += ',CLEARANCE'; break;
//                case 'NEW ARRIVAL': areas += ',New_Arrival'; break;
//            }
//        }
//    }

//    //home
//    if ($('.idx-qFinder').length > 0)
//        areas += ',Quick_Finder';
//    if ($('.banner').length > 0)
//        areas += ',Main_Banner';
//    if ($('.bn-indexcol').length > 0)
//        areas += ',Featured_Banner';
//    if ($('.best-seller-wrap').length > 0)
//        areas += ',Best_Seller';

//    //item
//    if ($('#ItemDetailTab').length > 0 || $('#TabItemDetail').length > 0)
//        areas += ',Item_Details_Tabs';
//    if ($('.item-info').length > 0)
//        areas += ',Item_Info';
//    if ($('.box-item-others boxMoreChoice').length > 0)
//        areas += ',More_Buying_Choices';
//    if ($('#BetterTogether').length > 0)
//        areas += ',Better_Together';
//    if ($('#J_BoxNeedHelp').length > 0)
//        areas += ',Need_Help';
//    if ($('#J_BoxSharelink').length > 0)
//        areas += ',Share_This';
//    if ($('div[class="side-box box-QuickLink"]').length > 0)
//        areas += ',Quick_Link';
//    if ($('#J_BoxShopWithConfidence').length > 0)
//        areas += ',Shop_With_Confidence';
//    if ($('div[class="side-box box-MaySuggest"]').length > 0)
//        areas += ',May_We_Suggest';

//    if (areas.length == 0)
//        return;
//    var areaArray = areas.substring(1, areas.length).split(',');
//    for (var i = 0; i < areaArray.length; i++) {
//        ES.callbackTuple.execute('Impression', areaArray[i], '');
//    }
//}


