// JavaScript Document
function PPZ1_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 div_recs = '<div class="V5_io_example_recs"\>';
		var n_recs = a_product_ids.length;
		var div_title = '<div class="io_recs_title">' + target_header_txt + '<\/div>';
		var div_table = '<div class="io_recs_table">';
		var image_table = '<TABLE CELLSPACING="2" CELLPADDING="0" Align="center" style="border-color:white;"><TR>';
		var lines = [];
		var width = 100 / n_recs;
		
		//0 product description
		//1 category
		//2 price
		//3 not defined
		//4 not defined
		//Recommendations
		for (var ii=0; ii<n_recs; ii++)
		{
			var rec_prod_id = a_product_ids[ii];
			var selected_href = rec_attributes[ii][0]+'.php?ref=Cross_Sell_Product'; 
			var image_url = rec_attributes[ii][1]; 
			var image_description = rec_attributes[ii][2];
			
			/*lines.push('<TD valign="top" class="borderedRollover" width=' + width + '%><div class="bordered_Rollover"><TABLE ALIGN="center" WIDTH=' + width + '%>');
			lines.push('<TR><TD ALIGN="center"><A HREF="' + selected_href + '"><IMG SRC="' + image_url + '?wid=128"  ALT="' + alt_description + '" WIDTH=128 height=128 style="border: medium none; cursor: pointer; padding-bottom: 5px; padding-top: 5px;" /><\/TD><\/TR>');
			lines.push('<TR><TD ALIGN="center"><A STYLE="text-decoration:none" HREF="' + selected_href + '">' + image_description + '<\/A><\/TD><\/TR>');
			lines.push('<\/TABLE><\/div><\/TD>');*/
			
			if(image_url!='')
			{
				lines.push('<a href="' + selected_href + '">');
				lines.push('<img src="' + image_url + '" style="border: 0px solid lightgrey;" border="0" height="105" width="97">');
				lines.push('<div class="item_details_recommended_items_title" style="font-size:10px;">');
				lines.push('' + image_description + '');
				lines.push('</div></a><br/>');
			}
		}
		// make a text string
		// html = div_title + div_table + image_table + lines.join("\n") + '<\/TR>' + image_trailer + '<\/TABLE><\/div>';
		//html = div_recs + div_title + div_table + image_table + lines.join("\n") + '<\/TR\><\/TABLE\><\/div\><\/div\>';
		html = '<b>' + target_header_txt + '</b><br/>' + lines.join("\n");
	}
	
	document.getElementById('io_zone').innerHTML = html; 
	
	return;
}





function ZEROZ1_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 div_recs = '<div class="V5_io_example_recs"\>';
		var n_recs = a_product_ids.length;
		var div_title = '<div class="io_recs_title">' + target_header_txt + '<\/div>';
		var div_table = '<div class="io_recs_table">';
		var image_table = '<TABLE CELLSPACING="2" CELLPADDING="0" Align="center" style="border-color:white;"><TR>';
		var lines = [];
		var width = 100 / n_recs;
		
		//0 product description
		//1 category
		//2 price
		//3 not defined
		//4 not defined
		//Recommendations
		for (var ii=0; ii<n_recs; ii++)
		{
			var rec_prod_id = a_product_ids[ii];
			var selected_href = rec_attributes[ii][0]+'.php?ref=Cross_Sell_Search'; 
			var image_url = rec_attributes[ii][1]; 
			var image_description = rec_attributes[ii][2];
			
			/*lines.push('<TD valign="top" class="borderedRollover" width=' + width + '%><div class="bordered_Rollover"><TABLE ALIGN="center" WIDTH=' + width + '%>');
			lines.push('<TR><TD ALIGN="center"><A HREF="' + selected_href + '"><IMG SRC="' + image_url + '?wid=128"  ALT="' + alt_description + '" WIDTH=128 height=128 style="border: medium none; cursor: pointer; padding-bottom: 5px; padding-top: 5px;" /><\/TD><\/TR>');
			lines.push('<TR><TD ALIGN="center"><A STYLE="text-decoration:none" HREF="' + selected_href + '">' + image_description + '<\/A><\/TD><\/TR>');
			lines.push('<\/TABLE><\/div><\/TD>');*/
			
			if(image_url!='')
			{
				lines.push('<a href="' + selected_href + '">');
				lines.push('<img src="' + image_url + '" style="border: 0px solid lightgrey;" border="0" height="105" width="97">');
				lines.push('<div class="item_details_recommended_items_title" style="font-size:10px;">');
				lines.push('' + image_description + '');
				lines.push('</div></a><br/>');
			}
		}
		// make a text string
		// html = div_title + div_table + image_table + lines.join("\n") + '<\/TR>' + image_trailer + '<\/TABLE><\/div>';
		//html = div_recs + div_title + div_table + image_table + lines.join("\n") + '<\/TR\><\/TABLE\><\/div\><\/div\>';
		html = '<b>' + target_header_txt + '</b><br/>' + lines.join("\n");
	}
	
	document.getElementById('io_zone').innerHTML = html; 
	
	return;
}





function CARTZ1_zp(a_product_ids,zone,symbolic,target_id,category,rec_attributes,target_attributes,target_header_txt)
{
	var html = zone + "";
	
	if(symbolic !== '_NR_')
	{
		var div_recs = '<div class="V5_io_example_recs"\>';
		var n_recs = a_product_ids.length;
		var div_title = '<div class="io_recs_title">' + target_header_txt + '<\/div>';
		var div_table = '<div class="io_recs_table">';
		var image_table = '<TABLE CELLSPACING="2" CELLPADDING="0" Align="center" style="border-color:white;"><TR>';
		var lines = [];
		var width = 100 / n_recs;
		
		//0 product description
		//1 category
		//2 price
		//3 not defined
		//4 not defined
		//Recommendations
		for (var ii=0; ii<n_recs; ii++)
		{
			var rec_prod_id = a_product_ids[ii];
			var selected_href = rec_attributes[ii][0]+'.php?ref=Cross_Sell_Cart'; 
			var image_url = rec_attributes[ii][1]; 
			var image_description = rec_attributes[ii][2];
			
			//continue if there is a blank image url
			if(image_url == '') continue;
			
			/*lines.push('<TD valign="top" class="borderedRollover" width=' + width + '%><div class="bordered_Rollover"><TABLE ALIGN="center" WIDTH=' + width + '%>');
			lines.push('<TR><TD ALIGN="center"><A HREF="' + selected_href + '"><IMG SRC="' + image_url + '?wid=128"  ALT="' + alt_description + '" WIDTH=128 height=128 style="border: medium none; cursor: pointer; padding-bottom: 5px; padding-top: 5px;" /><\/TD><\/TR>');
			lines.push('<TR><TD ALIGN="center"><A STYLE="text-decoration:none" HREF="' + selected_href + '">' + image_description + '<\/A><\/TD><\/TR>');
			lines.push('<\/TABLE><\/div><\/TD>');*/
			
			if(image_url!='')
			{
				lines.push('<a href="' + selected_href + '">');
				lines.push('<img src="' + image_url + '" style="border: 0px solid lightgrey;" border="0" height="105" width="97">');
				lines.push('<div class="item_details_recommended_items_title" style="font-size:10px;">');
				lines.push('' + image_description + '');
				lines.push('</div></a><br/>');
			}
		}
		// make a text string
		// html = div_title + div_table + image_table + lines.join("\n") + '<\/TR>' + image_trailer + '<\/TABLE><\/div>';
		//html = div_recs + div_title + div_table + image_table + lines.join("\n") + '<\/TR\><\/TABLE\><\/div\><\/div\>';
		html = '<b>' + target_header_txt + '</b><br/>' + lines.join("\n");
	}
	
	document.getElementById('io_zone').innerHTML = html; 
	
	return;
}





function io_rec_zp(a_product_ids,zone,symbolic,target_id,category,rec_attributes,target_attributes,target_header_txt)
{
	alert('reached');
	var html = zone + "";
	
	if(symbolic !== '_NR_')
	{
		var div_recs = '<div class="V5_io_example_recs"\>';
		var n_recs = a_product_ids.length;
		var div_title = '<div class="io_recs_title">' + target_header_txt + '<\/div>';
		var div_table = '<div class="io_recs_table">';
		var image_table = '<TABLE CELLSPACING="2" CELLPADDING="0" Align="center" style="border-color:white;"><TR>';
		var lines = [];
		var width = 100 / n_recs;
		
		//0 product description
		//1 category
		//2 price
		//3 not defined
		//4 not defined
		//Recommendations
		for (var ii=0; ii<n_recs; ii++)
		{
			var rec_prod_id = a_product_ids[ii];
			var selected_href = rec_attributes[ii][0]; 
			var image_url = rec_attributes[ii][1]; 
			var image_description = rec_attributes[ii][2];
			
			//continue if there is a blank image url
			if(image_url == '') continue;
			
			/*lines.push('<TD valign="top" class="borderedRollover" width=' + width + '%><div class="bordered_Rollover"><TABLE ALIGN="center" WIDTH=' + width + '%>');
			lines.push('<TR><TD ALIGN="center"><A HREF="' + selected_href + '"><IMG SRC="' + image_url + '?wid=128"  ALT="' + alt_description + '" WIDTH=128 height=128 style="border: medium none; cursor: pointer; padding-bottom: 5px; padding-top: 5px;" /><\/TD><\/TR>');
			lines.push('<TR><TD ALIGN="center"><A STYLE="text-decoration:none" HREF="' + selected_href + '">' + image_description + '<\/A><\/TD><\/TR>');
			lines.push('<\/TABLE><\/div><\/TD>');*/
			
			if(image_url!='')
			{
				lines.push('<a href="' + selected_href + '.php">');
				lines.push('<img src="' + image_url + '" style="border: 0px solid lightgrey;" border="0" height="105" width="97">');
				lines.push('<div class="item_details_recommended_items_title" style="font-size:10px;">');
				lines.push('' + image_description + '');
				lines.push('</div></a><br/>');
			}
		}
		// make a text string
		// html = div_title + div_table + image_table + lines.join("\n") + '<\/TR>' + image_trailer + '<\/TABLE><\/div>';
		//html = div_recs + div_title + div_table + image_table + lines.join("\n") + '<\/TR\><\/TABLE\><\/div\><\/div\>';
		html = '<b>' + target_header_txt + '</b><br/>' + lines.join("\n");
	}
	
	document.getElementById('io_zone').innerHTML = html; 
	
	return;
}
