function Lucky_zpf(a_product_ids,           // Array of recommended product IDs
                     zone,                  // Zone ID specified in the request (as entered on zone edit screen)
                     symbolic,              // Target type:
                                            //      _SP_  Specified Product ID
                                            //      _SC_  Specified Category ID
                                            //      _RVP_ Most Recently Viewed Product
                                            //      _RPP_ Most Recently Purchased Product
                                            //      _NR_  No Recommendations
                                            //      _LCP_ Last Carted Product
                                            //      _MPC_ Visitor's Most Popular Category
                                            //      _SS_  Specified Search Term
                     target_id,             // Target ID recommendations are based on
                     category,              // Category of Target ID - EPR Category ID if the Target ID is a product
                     rec_attributes,        // 2 dimensional array of attributes for each recommendation
                     target_attributes,     // Array of attribute for the target
                     target_header_txt,     // Header text (as entered on recommendation plan edit screen)
                     ab_test_id,            // String containing AB Test Name, a semicolon, AB test ID for the test element requested
                                            //      Null if no AB Test
                                            // 
                                            // The final 2 parameters are not standard parameters passed into zone population function
                                            // They ared added via the function calls at bottom of this file
                     div_id,                //      div id - must match desired div id in DW isml template
                     b_display_target		//      indicates whether target will be displayed
					)      

{
	var attr_set = [];
	
	for (var i=0; i<rec_attributes.length; i++) {
		var cSet = rec_attributes[i];
		attr_set.push ({
			name: cSet[0],
			color: cSet[1],
			imgURL: cSet[2],
			prodURL: cSet[3],
			prodPrice: Number (cSet[4]).toFixed(2),
			prodSalePrice: Number (cSet[5]).toFixed(2)
		});
	}
	for (var i=0; i<attr_set.length; i++) {
		var Current = attr_set[i];
		Current.imgURL = Current.imgURL.replace ('prod_large', 'prod_suggest');
		
		if (Current.prodPrice != Current.prodSalePrice) {
			Current.prodPrice = Current.prodSalePrice;
		}
		
		//Check if using HTTP or HTTPS
		if (cmHttp_Protocol.toLowerCase() == 'https') {
			Current.imgURL = Current.imgURL.replace (/(^http)/gi, 'https');
		}

		jQuery ('.pdpRecommendations_Container').append (
			jQuery ('<li />')
			.append (
				jQuery ('<a />')
				.attr ('href', Current.prodURL + cmNavID)
				.append (
					jQuery ('<img />')
					.attr ('src', Current.imgURL)
					.attr ('alt', Current.name)
					.css ({
						'width': '136px',
						'height': '173px'
					})
				)
			)
			.append (
				jQuery ('<span />').css({ 'width': '120px' }).attr ('class', 'product-title').html (Current.name)
			)
			.append (
				jQuery ('<div />').css ({ 'width': '120px' }).attr ('class', 'product-title').html ('$' + Current.prodPrice)
			)
		);
		if (cmLimit !== undefined) { if (i == cmLimit-1) { break; } } 
		else{ if (i == 3) {  break; } }
	}
	jQuery('#carousel').jcarousel({
        'scroll' : 3
    });
}

// !!CLIENT DEPENDENT!! - add a function named ZoneID_zp (where ZoneID is the actual zone id) for all zones the Lucky zpf should be called 
function PDPZ1_zp(a,b,c,d,e,f,g,h,i,j)  
{
   Lucky_zpf(a,b,c,d,e,f,g,h,i,'pdpRecommendations',false);
}
function CARTZ1_zp(a,b,c,d,e,f,g,h,i)  
{
   Lucky_zpf(a,b,c,d,e,f,g,h,i,'pdpRecommendations',false);
}
