
function customTracking (action,ml){
    var querystring;
    
    var strHC1;
    var strHC2;
    var arrBCrumb;
    var strBCrumb;
    var strPN=action;
    var strMLC="/weekly+ad";
    var strbrandid;
    var strBrandName;
    var strcategoryid;
    var strCategoryName;
    var strSearchText;
    var strSearchCount;
    var strPromotionCode;
    var strPromotionPage;
    var strPromotionType;
    
    var strViewType="flash";
    
    if(ml.promotion !== null){   
        if(ml.promotion.typeid == "1") {
            strPromotionType = "circular+insert";
        }else{
        strPromotionType = "guide";
        }
    }
      
    switch (action)
    {         
        // 4.2 - updated
        case "EVENT_ZIPENTRY":
            strPN = "nuep: flash";
            trackEvent.event("event.view", { page: strPN });
            break;
    	  
	    // 4.2 - updated
        case "EVENT_HOME_PAGE":
            strPN = "entry: flash";
            trackEvent.event("event.view", { page: strPN });
            break;
	  	
	  	// 4.2 - updated
        case "EVENT_ITEMLIST_CHANGE":
            switch (ml.currentListingView) {
                case "CATEGORY_LISTINGS":
                    strPN = "browsecategory";
                    strcategoryid = ml.category.cattreeid;
                    strCategoryName = ml.category.name;

                    trackEvent.event("event.view", { page: strPN + ": " + strCategoryName + ": flash" });
                    break;

                case "SEARCH_LISTINGS":
                    strSearchText = ml.searchText.replace('"', '');
                    strSearchCount = ml.listings.data.length;
                    strPN = "search: " + strSearchText;
                    trackEvent.event("event.view", { page: strPN + ": flash" });
                    break;

                default:
            }
            break;
                         
        // 4.2 - updated
        case "EVENT_PAGEVIEW_SINGLE":
            strPN = "browsepagesingle:" + ml.promotion.code + ": flash";
            var track = {};
            track.section = ml.promotion.title + ": flash";
            track.page = strPN;
            trackEvent.event("event.view", track);
            break;
	   	
	   	// 4.2 - updated
        case "EVENT_PAGEVIEW_LARGE":
            strPN = "magnify:" + ml.promotion.code + ": flash";
            trackEvent.event("event.view", { page: strPN });
            break;

        // 4.2 - updated
        case "EVENT_ITEM_CHANGE":
            strPN = "detail: " + ml.listing.retailerproductcode + ": flash";
            trackEvent.event("event.view", { page: strPN });
            break;
	    
	    // 4.2 - updated	    
	    case "EVENT_CHANGE_LOCATION":
		    strPN="browsestorelocation: flash";
	        trackEvent.event("event.view",{page: strPN});  							
	    break;
	       
        default:
    }
}

