function PDPZ1_zp(a_product_ids, zone, symbolic, target_id, category,
		rec_attributes, target_attributes, target_header_txt) {
	var html = zone + "_zp: No recommendations returned";
	if (symbolic != '_NR_') {
		// special case. Over ride of the header text passed from the configuration file
		var target_header_txt = "You May Also Like:";
		var demandPrefix = getElementValuebyId('demandPrefix', '11');
		var mode = getElementValuebyId('mode', 'Browsing');
		var parentSku = getElementValuebyId('productId', 'IN');
		var bv_default_url_cdn = getElementValuebyId('bv_default_url_cdn', 'NA');
		var product_url = '/ui/browse/processRequest.do?demandPrefix='
				+ demandPrefix + '&mode=' + mode
				+ '&requestURI=processProductsCatalog&xsaleSku=' + target_id
				+ '&sku=';
		var bv_read_reviews = '/ui/browse/processRequest.do?requestURI=processProductsCatalog&sku=';
		var bv_write_review_end = '/submission.htm?return=%2Fui%2Fbrowse%2FprocessRequest.do%3FrequestURI%3DprocessProductsCatalog%26sku%3D';
		var div_top = '<div class=\"productDetail-top\">\n<div class=\"productDetail-bg\">\n<div id=\"productdetail_sub_standard\">\n';
		var div_top_end = '<div class=\"clear\">\n</div>\n</div>\n</div> <!-- End productDetail-bg -->\n</div> <!-- End productDetail-top -->\n';
		var div_photo_holder = '<div id=\"productdetail_photo_holder\">\n<div id=\"productdetail_subphoto_standard\">';
		var n_recs = a_product_ids.length;
		var div_title = '<h2>' + target_header_txt + '<\/h2>\n';
		var lines = new Array();
		var image_url = '//s7.orientaltrading.com/is/image/OrientalTrading/';
		for ( var ii = 0; ii < n_recs && ii < 5; ii++) {
			var rec_prod_id = a_product_ids[ii];
			var short_desc = rec_attributes[ii][0];
			var smsrp_price = rec_attributes[ii][1];
			var ssale_price = rec_attributes[ii][2];
			var rating = rec_attributes[ii][3];
			var image_name = rec_attributes[ii][4];
			var uom = rec_attributes[ii][5];
			var msrp_price = 0.00;
			var sale_price = 0.00;
			var flag = 'true';
			try {
				msrp_price = parseFloat(smsrp_price);
			} catch (e) {
				msrp_price = 0.00;
			}
			if (ssale_price != 'NA') {
				try {
					sale_price = parseFloat(ssale_price);
				} catch (e) {
					sale_price = 0.00;
				}
			}
			if (!isNaN(msrp_price) && msrp_price == 999)
				continue;
			lines.push(div_photo_holder);
			lines.push('<a href=\"' + product_url + rec_prod_id + '\" alt=\"'
					+ short_desc + '\">');
			lines.push('<img onerror=\"this.src=noThumb.src\" src=\"'
					+ image_url + image_name + '?$CROSS_SIZE$\" alt=\"'
					+ short_desc + '"/></a>');
			lines.push('<p>' + short_desc + '</p>');
			if (uom != 'NA') {
				lines.push('<p>' + uom + '</p>');
			}
			if (sale_price == 0.00 || msrp_price <= sale_price)
				lines
						.push('<p class=\"regularPrice\">$' + msrp_price + '</span></p>');
			else if (!isNaN(msrp_price) && msrp_price > 0.00) {
				lines
						.push('<p><span class=\"strike\">$' + msrp_price + '</span></p>');
				lines
						.push('<p><span class=\"red\">$' + sale_price + '</span></p>');
			} else {
				flag = 'false';
				break;
			}
			if (rating != null && rating != '0.0') {
				lines.push('<img border=\"0\" src=\"/images/rating-' + rating
						.replace(".", "_") + '.gif\" class=\"ratingStars\">');
				lines.push('<br/>');
				lines.push('<b>' + rating + '</b> out of <b>5</b><br/>');
				lines.push('<a href=\"' + bv_read_reviews + rec_prod_id
						+ '#BVRRWidgetID\">Read all reviews</a>');
				lines.push('&nbsp;&nbsp;&nbsp;');
			} else {
				if (bv_default_url_cdn != 'NA') {
					lines.push('<a href=\"' + bv_default_url_cdn
							+ rec_prod_id.replace("/", "_")
							+ bv_write_review_end
							+ rec_prod_id.replace("/", "%2F")
							+ '\">Write a review</a>');
				}
			}
			lines.push('</div> <!-- End productdetail_subphoto_standard -->');
			lines.push('</div> <!-- End productdetail_photo_holder -->');
		}
		if (flag == 'true') {
			html = div_top + div_title + lines.join("\n") + div_top_end;
			document.getElementById('productDetail-crosssale').innerHTML = html;
		}
		showDivContent('productDetail-crosssale');
	} else {
		showDivContent('productDetail-crosssale');
	}
}
function SBDPZ1_zp(a_product_ids, zone, symbolic, target_id, category,
		rec_attributes, target_attributes, target_header_txt) {
	var html = zone + "_zp: No recommendations returned";
	if (symbolic != '_NR_') {
		// special case. Over ride of the header text passed from the configuration file
		var target_header_txt = "You May Also Like:";
		var product_url = '/ui/shared/sharedFlowController.goToBrowseController.do?requestURI=processProductsCatalog&cm_sp=Cross%20Sell-_-Shopping%20Cart-_- Shopping%20Cart&mode=Browsing&demandPrefix=17&sku=';
		var div_top = '\n<div class=\"crossSellContainer\">\n';
		var div_top_end = '</div> <!-- End \"crossSellContainer\" -->\n';
		var image_url = '//s7.orientaltrading.com/is/image/OrientalTrading/';
		var n_recs = a_product_ids.length;
		var div_title = '<h3>' + target_header_txt + '<\/h3>\n';
		var lines = new Array();
		for ( var ii = 0; ii < n_recs && ii < 5; ii++) {
			var rec_prod_id = a_product_ids[ii];
			var short_desc = rec_attributes[ii][0];
			var smsrp_price = rec_attributes[ii][1];
			var ssale_price = rec_attributes[ii][2];
			var rating = rec_attributes[ii][3];
			var image_name = rec_attributes[ii][4];
			var uom = rec_attributes[ii][5];
			var msrp_price = 0.00;
			var sale_price = 0.00;
			try {
				msrp_price = parseFloat(smsrp_price);
			} catch (e) {
				msrp_price = 0.00;
			}
			if (ssale_price != 'NA') {
				try {
					sale_price = parseFloat(ssale_price);
				} catch (e) {
					sale_price = 0.00;
				}
			}
			if (!isNaN(msrp_price) && msrp_price == 999)
				continue;
			if (ii == 4) {
				lines.push('<div class=\"crossSellLastItem\">');
			} else {
				lines.push('<div class=\"crossSellItem\">');
			}
			lines.push('<a href=\"' + product_url + rec_prod_id + '&xsaleSku='
					+ rec_prod_id + '\" alt=\"' + short_desc + '\">');
			lines.push('<img onerror=\"this.src=noThumb.src\" src=\"'
					+ image_url + image_name + '?$CROSS_SIZE$\" alt=\"'
					+ short_desc + '"/>');
			lines.push('</a>');
			lines.push('<p>');
			lines.push('<a href=\"' + product_url + rec_prod_id + '&xsaleSku='
					+ rec_prod_id + '\">');
			lines.push('<strong>' + short_desc + '</strong>');
			lines.push('</a>');
			lines.push('</p>');
			if (sale_price == 0.00 || msrp_price <= sale_price)
				lines
						.push('<p class=\"crossSellText\">$' + msrp_price + '</p>');
			else
				lines
						.push('<p class=\"crossSellText\">$' + sale_price + '</p>');
			lines.push('<a href=\"' + product_url + rec_prod_id + '&xsaleSku='
					+ rec_prod_id + '\">');
			lines
					.push('<img src=\"/images/viewItem_btn.gif\" alt=\"View Item\" width=\"96\" height=\"29\"/>');
			lines.push('</a>');
			lines.push('</p>');
			lines.push('</div>');
		}
		html = div_top + div_title + lines.join("\n") + div_top_end;
		document.getElementById('cartSidebar').innerHTML = html;
		showDivContent('cartSidebar');
	} else {
		showDivContent('cartSidebar');
	}
}
function CCDPZ1_zp(a_product_ids, zone, symbolic, target_id, category,
		rec_attributes, target_attributes, target_header_txt) {
	var html = zone + "_zp: No recommendations returned";
	if (symbolic != '_NR_') {
		var topDiv = '\n<b class=\"bstop\">\n<b class=\"xbs1\">\n</b>\n<b class=\"xbs2\">\n</b>\n<b class=\"xbs3\">\n</b>\n<b class=\"xbs4\">\n</b>\n</b>\n<!--  Endeca merchandising rules -->\n';
		var bottomDiv = '<b class=\"bsbottom\">\n<b class=\"zbs4\">\n</b>\n<b class=\"zbs3\">\n</b>\n<b class=\"zbs2\">\n</b>\n<b class=\"zbs1\">\n</b>\n</b>\n';
		var div_title = '<h2>' + target_header_txt + '<\/h2>\n';
		var lines = new Array();
		var n_recs = a_product_ids.length;
		var image_url = '//s7.orientaltrading.com/is/image/OrientalTrading/';
		for ( var ii = 0; ii < n_recs && ii < 8; ii++) {
			var rec_prod_id = a_product_ids[ii];
			var short_desc = rec_attributes[ii][0];
			var smsrp_price = rec_attributes[ii][1];
			var ssale_price = rec_attributes[ii][2];
			var rating = rec_attributes[ii][3];
			var image_name = rec_attributes[ii][4];
			var uom = rec_attributes[ii][5];
			var msrp_price = 0.00;
			var sale_price = 0.00;
			var flag = 'true';
			try {
				msrp_price = parseFloat(smsrp_price);
			} catch (e) {
				msrp_price = 0.00;
			}
			if (ssale_price != 'NA') {
				try {
					sale_price = parseFloat(ssale_price);
				} catch (e) {
					sale_price = 0.00;
				}
			}
			if (ii == 0 || ii == 4) {
				lines.push('<div class=\"bsBoxContent\">');
			}
			lines.push('<div class=\"item\">');
			lines
					.push('<a href=\"/ui/browse/processRequest.do?demandPrefix=15&amp;sku='
							+ rec_prod_id
							+ '&amp;mode=Browsing&amp;erec='
							+ ii
							+ '&amp;sp=false&amp;Ntk=all&amp;Ntx=mode%2bmatchallpartial&amp;N='
							+ category
							+ '&amp;requestURI=processProductsCatalog&amp;in_merch='
							+ ii + '&amp;sd=' + escape(short_desc) + '\">');
			lines.push('<img alt=\"' + short_desc
					+ '\" onerror=\"this.src=noThumb.src\" src=\"' + image_url
					+ image_name
					+ '?$DISP_MERC_RULE_TAG_SIZE$\" class=\"bsBorder\"></a>');
			lines
					.push('<a href=\"/ui/browse/processRequest.do?demandPrefix=15&amp;sku='
							+ rec_prod_id
							+ '&amp;mode=Browsing&amp;erec='
							+ ii
							+ '&amp;sp=false&amp;Ntk=all&amp;Ntx=mode%2bmatchallpartial&amp;N='
							+ category
							+ '&amp;requestURI=processProductsCatalog&amp;in_merch='
							+ ii + '&amp;sd=' + escape(short_desc) + '\">');
			lines.push('<p> IN-' + rec_prod_id + '</p></a>');
			lines.push('<p>' + short_desc + '</p>');
			lines.push('<p>' + uom + '</p>');
			if (sale_price == 0.00 || msrp_price <= sale_price)
				lines
						.push('<p><span class=\"regularPrice\">$' + msrp_price + '</span></p>');
			else if (!isNaN(msrp_price) && msrp_price > 0.00) {
				lines
						.push('<p><span class=\"strike\">$' + msrp_price + '</span></p>');
				lines
						.push('<p><span class=\"red\">$' + sale_price + '</span></p>');
			} else {
				flag = 'false';
				break;
			}
			lines.push('</div>');
			if (ii == 3 || ii == 7) {
				lines.push('<div class=\"clear\"> </div>');
				lines.push('</div>');
			}
		}
		if (flag == 'true') {
			html = topDiv + div_title + lines.join("\n") + bottomDiv;
		//	document.getElementById('bestSellers').innerHTML = html;
		}
		showDivContent('bestSellers');
	}
}

function HPZ1_zp(a_product_ids, zone, symbolic, target_id, category,
		rec_attributes, target_attributes, target_header_txt) {
	var html = zone + "_zp: No recommendations returned";
	if (symbolic != '_NR_') {
		var topDiv = '\n<div class=\"navi\">\n<a class=\"active\"></a><a class=\"\"></a>\n</div><a class=\"prevPage disabled\"></a><div class=\"scrollable\"><div id=\"thumbs\">';
		var bottomDiv = '</div><!-- END thumbs -->\n</div><!-- END scrollable -->\n<a class=\"nextPage\"></a>\n<br class=\"clear\">\n';
		var lines = new Array();
		var n_recs = a_product_ids.length;
		var image_url = '//s7d5.scene7.com/is/image/OrientalTrading/150_Image/';
		for ( var ii = 0; ii < n_recs && ii < 10; ii++) {
			var rec_prod_id = a_product_ids[ii];
			var short_desc = rec_attributes[ii][0];
			var smsrp_price = rec_attributes[ii][1];
			var ssale_price = rec_attributes[ii][2];
			var rating = rec_attributes[ii][3];
			var image_name = rec_attributes[ii][4];
			var uom = rec_attributes[ii][5];
			var msrp_price = 0.00;
			var sale_price = 0.00;
			var flag = 'true';
			try {
				msrp_price = parseFloat(smsrp_price);
			} catch (e) {
				msrp_price = 0.00;
			}
			if (ssale_price != 'NA') {
				try {
					sale_price = parseFloat(ssale_price);
				} catch (e) {
					sale_price = 0.00;
				}
			}
			lines.push('<div class=\"resultsItem\">');
			lines.push('<a manual_cm_sp=\"carousel-_-product1-_-product1\" href=\"/ui/browse/processRequest.do?demandPrefix=15&amp;cm_sp=recommendation-_-homepage-_-homepage&amp;sku='
							+ rec_prod_id
							+ '&amp;mode=Browsing&amp;requestURI=processProductsCatalog&amp;sd='
							+ escape(short_desc) + '\">');
			lines.push('<img alt=\"' + short_desc
					+ '\" onerror=\"this.src=noThumb.src\" src=\"' + image_url
					+ image_name + '.jpg\"/></a>');
			lines.push('<p>');
			lines.push('<a manual_cm_sp=\"carousel-_-product1-_-product1\" href=\"/ui/browse/processRequest.do?demandPrefix=15&amp;cm_sp=recommendation-_-homepage-_-homepage&amp;sku='+ rec_prod_id+ '&amp;mode=Browsing&amp;requestURI=processProductsCatalog&amp;sd='+ escape(short_desc) + '\">');
			lines.push('IN-' + rec_prod_id + '</a></p>');
			lines.push('<p>' + short_desc + '</p>');
			lines.push('<p>' + uom);
			if (sale_price == 0.00 || msrp_price <= sale_price)
			lines.push('<span class=\"regularPrice\">$' + msrp_price + '</span></p>');
			else if (!isNaN(msrp_price) && msrp_price > 0.00) {
				lines.push('<span class=\"strike\">$' + msrp_price + '</span>');
				lines.push('<span class=\"red\">$' + sale_price + '</span>\n</p>');
			} else {
				flag = 'false';
				break;
			}
			lines.push('</div>');
		}
	}
	if (flag == 'true') {
		html = topDiv +  lines.join("\n") + bottomDiv;
		//document.getElementById('IOcarousel').innerHTML= html;
	}
	showDivContent('IOcarousel');
}

//this function will show the content within the <div> tag
function showDivContent(divName) {
	var thisDiv = document.getElementById(divName);
	if (thisDiv) {
		thisDiv.style.display = "block";
	} else {
		//    alert("Error: Could not locate div with id: " + divName);
	}
}

//this function will hide the content within the <div> tag
function hideDivContent(divName) {
	var thisDiv = document.getElementById(divName);
	if (thisDiv) {
		thisDiv.style.display = "none";
	} else {
		//   alert("Error: Could not locate div with id: " + divName);
	}
}

function getElementValuebyId(idName, defaultValue) {
	var thisDiv = document.getElementById(idName);
	if (thisDiv && thisDiv != null)
		thisDiv = thisDiv.value;
	else
		thisDiv = defaultValue; //  Default Value
	return thisDiv;
}