
/** feature begin:write size chart, editor:cher, date:04.SEP.2007, 
DECR: reads the pvendor code and add the correct size chart image on the product page
1) if vendor code not empty or undefined and 2)vendor code in vendorArray in product.asp 
left column ( Text/HTML in TOP Page area) ***/

function write_sizeCharts() {
    //var sRemove = "\s"; // removed space
  //  var sInsert = "_";  // replace with underscore
    if ((pvendor_code !=  "")  &&  (pvendor_code != undefined))
    {   
        var x = 0;               // index for loop
        var bShowChart = false; //boolean show size chart t/f
        var vendorTot = vendorArray.length; // number of vendors with chars
        
        var sChartName = pvendor_code;  //vendor code        
            //changes spaces in vendor code to underscores
             

        // loop through array check if vendor in array
        for(x=0;x< vendorTot; x++) {    
//alert("uu testing do not be alarmed" + vendorArray[x] +"== "+sChartName);        
           if(vendorArray[x] == sChartName) { 
              bShowChart = true;
            } // end if
        } // end looping through vendor array\
        
        if(bShowChart) {  // show chart
            sChartName = sChartName.replace(/\s/g,"_"); 
            var sChart ="<img src=\"assets/images/sizeCharts/"+sChartName+ ".gif\" alt='SizeChart'><br><br>"; 
            document.write(sChart);
        }
    } // end if pvendor code not empty

}// end write size chart