function imgErr(){
    document.getElementById("mainimg").src="assets/images/ImageSoonWeb.jpg";
    }

function imgErrTN(ImgID){
    document.getElementById(ImgID).src="assets/images/ImageSoonWeb-TN.jpg";
    }

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 +"\" onerror=\"imgErr()\";></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 +"\" onerror=\"imgErr()\";>");
       }             }
   else{
       document.write("<img src=\"assets/images/ImageSoonWeb.jpg\">");
   }
}

function imgOn(imgName) {
       document.getElementById("mainimg").src="assets/images/swatches/" + pf_id + "_" + imgName + "_lg.jpg";
       }

function display_thumbnails2()
{
   var array_largeimage;
   if (typeof info_attributes!="undefined" && info_attributes != "")
   {
       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=5;
           var atn;
           atn=0;
           var myImage;
           var counter=1;
           //document.write("<br>Available In:");
           document.write("<br><table><tr><td>Available In: (Use mouse to see larger images)<br><table border=0><tr><td><div align=center width=100%><table border=0><tr>");
                      for (atn=0; atn<thumbnails_array.length; atn++)
           {
               if (thumbnails_array[atn]!="")
               {
                   image_array = thumbnails_array[atn].split(":");
                   document.write("<td align=center valign=top><table border=0><tr><td align=center><A HREF=\"#\" onClick=\"return false\" onmouseover=\"imgOn('"+image_array[1]+"')\";><img height=70 NAME=\""+image_array[1]+"\" id=\""+image_array[1]+"\" src=\"assets/images/swatches/" + pf_id + "_" + image_array[1] + "_sm.jpg\" onerror=\"imgErrTN('"+image_array[1]+"')\";></A>");
                   document.write("<br>"+image_array[0]+"</td></tr></table></td>");
                   if (counter==columns){document.write("</tr><tr>");counter=0}
               }
           counter = counter+1;
           }
          document.write("</tr></table></div></td></tr></table></td></tr></table>");
       }
   }
} //end display_thumbnails 