    var page_category = null;
	var page_name = null;	
	var orderId_value = null;
	
	if ( (typeof cm_page_cat != "undefined")  && (cm_page_cat != null) ) {
		page_category = cm_page_cat;
	}
    if ( (typeof cm_page_name != "undefined")  && (cm_page_name != null) ) {
    	page_name = cm_page_name;
    }
     if ( (typeof cm_orderId != "undefined")  && (cm_orderId != null) ) {
    	orderId_value = cm_orderId;
    	
    }
   
    if (typeof cm_page_type!= "undefined" && cm_page_type == "SEARCH") {
	    if ( ( typeof original_query_value == "undefined") || ( original_query_value == null) || (original_query_value.length==0) ) {
	        original_query_value = null;
	    }
	    if ( ( typeof cmTotalResults == "undefined") || ( cmTotalResults == null) || (cmTotalResults.length==0) ) {
	        cmTotalResults = null;
	    }
	      if ( ( typeof ma_search == "undefined") || ( ma_search == null) || (ma_search.length==0) ) {
	        ma_search = null;
	    }
	    
	    if ( ( typeof ma_ref_name_val_1 == "undefined") || ( ma_ref_name_val_1 == null) || (ma_ref_name_val_1.length==0) ) {
	        ma_ref_name_val_1 = null;
	    }
	    if ( ( typeof ma_ref_name_val_2 == "undefined") || ( ma_ref_name_val_2 == null) || (ma_ref_name_val_2.length==0) ) {
	        ma_ref_name_val_2 = null;
	    }
	    if ( ( typeof ma_ref_name_val_3 == "undefined") || ( ma_ref_name_val_3 == null) || (ma_ref_name_val_3.length==0) ) {
	        ma_ref_name_val_3 = null;
	    }
	    if ( ( typeof ma_ref_name_val_4 == "undefined") || ( ma_ref_name_val_4 == null) || (ma_ref_name_val_4.length==0) ) {
	        ma_ref_name_val_4 = null;
	    }
	    if ( ( typeof ma_ref_name_val_5 == "undefined") || ( ma_ref_name_val_5 == null) || (ma_ref_name_val_5.length==0) ) {
	        ma_ref_name_val_5 = null;
	    }
	    if ( ( typeof ma_ref_name_val_6 == "undefined") || ( ma_ref_name_val_6 == null) || (ma_ref_name_val_6.length==0) ) {
	        ma_ref_name_val_6 = null;
	    }
	      if ( ( typeof ma_ref_name_val_7 == "undefined") || ( ma_ref_name_val_7 == null) || (ma_ref_name_val_7.length==0) ) {
	        ma_ref_name_val_7 = null;
	    }
	     if ( ( typeof ma_search_type == "undefined") || ( ma_search_type == null) || (ma_search_type.length==0) ) {
	        ma_search_type = null;
	    }
	    if ( ( typeof ma_numrecords == "undefined") || ( ma_numrecords == null) || (ma_numrecords.length==0) ) {
	        ma_numrecords = null;
	    }
	    if ( ( typeof ma_bu == "undefined") || ( ma_bu == null) || (ma_bu.length==0) ) {
	        ma_bu = null;
	    }
	    if ( ( typeof ma_Dominant_category_id == "undefined") || ( ma_Dominant_category_id == null) || (ma_Dominant_category_id.length==0) ) {
	        ma_Dominant_category_id = null;
	    }
	    if ( ( typeof ma_Dominant_brand == "undefined") || ( ma_Dominant_brand == null) || (ma_Dominant_brand.length==0) ) {
	        ma_Dominant_brand = null;
	    }
	     if ( ( typeof ma_search_query_id == "undefined") || ( ma_search_query_id == null) || (ma_search_query_id.length==0) ) {
	        ma_search_query_id = null;
	    }	  	    
	     if ( ( typeof ma_mvt_params == "undefined") || ( ma_mvt_params == null) || (ma_mvt_params.length==0) ) {
	        ma_mvt_params = null;
	    }
	     if ( ( typeof ma_Alt_Searches == "undefined") || ( ma_Alt_Searches == null) || (ma_Alt_Searches.length==0) ) {
	        ma_Alt_Searches = null;
	    }
	     if ( ( typeof ma_rbt_used == "undefined") || ( ma_rbt_used == null) || (ma_rbt_used.length==0) ) {
	        ma_rbt_used = null;
	    }
	     if ( ( typeof ma_page_type == "undefined") || ( ma_page_type == null) || (ma_page_type.length==0) ) {
	        ma_page_type = null;
	    }
	    if ( ( typeof ma_Result_type == "undefined") || ( ma_Result_type == null) || (ma_Result_type.length==0) ) {
	        ma_Result_type = null;
	    }
	     if ( ( typeof ma_Partial == "undefined") || ( ma_Partial == null) || (ma_Partial.length==0) ) {
	        ma_Partial = null;
	    }
	        

 //     new     function cmCreatePageviewTag(pageID, searchString, categoryID, searchResults, *memberID, *orderID, *attributes, MercadoSearchTerm, RefOpt1,RefOpt2,RefOpt3,RefOpt4,RefOpt5,RefOpt6,RefOpt7,MercadoSearchType,ResultsCount,DomBusUnit,DomCatID,DomBrand,SearchQueryID,MVTParams,MercadoAlt,RBTUsed,PageType,Resultype,Partial)                                 
    	cmCreatePageviewTag(page_name, original_query_value, page_category, cmTotalResults, null, null, null, ma_search, ma_ref_name_val_1, ma_ref_name_val_2, ma_ref_name_val_3, ma_ref_name_val_4, ma_ref_name_val_5, ma_ref_name_val_6, ma_ref_name_val_7, ma_search_type, ma_numrecords, ma_bu, ma_Dominant_category_id, ma_Dominant_brand, ma_search_query_id, ma_mvt_params, ma_Alt_Searches, ma_rbt_used, ma_page_type, ma_Result_type, ma_Partial);
    } else if (typeof cm_page_type!= "undefined" && cm_page_type == "PRODUCT") {
              // function cmCreateProductviewTag(storeName, productID, productName, brand, categoryID, memberID, orderID, attributes, queryID)
    	cmCreateProductviewTag(storeName, wcs_prod_style, wcs_prod_name, wcs_prod_brand, page_category,null,null,null,getCookie('queryId'));
    } else if (typeof cm_orderId!= "undefined" &&  cm_page_cat == "CHECKOUT"){
              cmCreatePageviewTag(cm_page_name, null, cm_page_cat, null, orderId_value, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, getCookie("queryId"));
     } else {
	cmCreatePageviewTag(page_name, null, page_category);
    } 
	

