//this code is the same as the swapper_template.js, except that it reverts back to the main image when not mousing over a thumbnail
function draw_image_2(){
	 if (product_image[1].scr=="PRODUCT" && product_image[1].image!="" ) { 
		if (product_image[1].image_show=="TARGET REG" || product_image[1].image_show=="TARGET" ){
			if (product_image[1].image_show=="TARGET REG"){
				if (user_guid==""){
					document.write("<A HREF=\"shopper_lookup.asp?target=" + product_image[1].target + "&\" onClick=return(visitargs('shopper_lookup.asp',\"target=" + product_image[1].target + "&\")); target=\"_top\" >");
				}else {
					document.write("<A HREF=\"" + product_image[1].target + "\" onClick=return(visitargs('" + product_image[1].target + "')); target=\"_top\" >");
				}
			}else {
				document.write("<a HREF=\"" + product_image[1].target + "\" target=\"_top\">");
			}
			document.write("<img name=\"mainimg\" id=\"mainimg\" ALIGN =" + product_image[1].align + " "); 
			if (product_image[1].width!=""){document.write("WIDTH =" + product_image[1].width + " ");}
			document.write(" BORDER=0  VSPACE=5  HSPACE=5 ALT=\"" + product_image[1].alt_text + "\" ");         
			document.write(" SRC=\"assets/product_images/" + product_image[1].image +"\"></a>");
		}else{
			document.write("<img name=\"mainimg\" id=\"mainimg\" ALIGN =\"" + product_image[1].align + "\" "); 
			if (product_image[1].width!=""){document.write("WIDTH =" + product_image[1].width + " ");}
			document.write(" BORDER=0  VSPACE=5  HSPACE=5 ALT=\"" + product_image[1].alt_text + "\" ");         
			document.write(" SRC=\"assets/product_images/" + product_image[1].image +"\">");
		}  		
	}
	else{
		document.write("<img src=\"assets/product_images/product.gif\" id=\"mainimg\">");
	}
}

function imgOnSwatch(imgName) {
        document.getElementById("mainimg").src="assets/images/swatches/" + pf_id + "_" + imgName + "_lg.jpg";
}

function display_thumbnails()
{
	var array_largeimage;
	if (typeof info_attributes!="undefined" && info_attributes != "" && info_attributes != "default" && info_attributes.indexOf(':') > -1)
	{
		var thumbnails_array = info_attributes.split(",");
		var image_array;
		if (thumbnails_array.length >= 1)
		{
			//the number below changes the number of columns for the swatches
			var columns=4;
			var atn;
			atn=0;
			var myImage;
			var counter=1;
			//document.write("<br>Available In:");
			document.write("<br><table border=0 width='280' cellspacing='0' cellpadding='2'><tr><td><div align=center width=100%><table border=0><tr>");
			
			for (atn=0; atn<thumbnails_array.length; atn++){	
				image_array = thumbnails_array[atn].split(":");
				document.write("<td align=center><table border=0 cellspacing='0' cellpadding='0'><tr><td align=center><A HREF=\"#\" onClick=\"return false;\" onmouseover=\"imgOnSwatch('"+image_array[1]+"')\" onmouseout=\"document.getElementById('mainimg').src='assets/product_images/"+product_image[1].image+"'\";><img NAME=\""+image_array[1]+"\" id=\""+image_array[1]+"\" src=\"assets/images/swatches/" + pf_id + "_" + image_array[1] + "_sm.jpg\" border=0></A>");
				document.write("<br><span class='swatchcolor'>"+image_array[0]+"</span></td></tr></table></td>");
				if (counter==columns){document.write("</tr><tr>");counter=0}
				counter++;
			}
			
	
			document.write("</tr></table></div></td></tr></table>");
		}
	}
} //end display_thumbnails