//
//
//
var xmlFile = "partlists/products.xml";
var xmlProduct = "AIRBLEEDER";


function select_airbleeder()
{
    var x;
    var xx;

    loadXMLDoc(xmlFile);
    document.write( "<table class='ptable' align='center' width='80%' border='2'>" );
    document.write( "<thead>" );
    document.write( "<tr>" );
    document.write( "<th><input type='button' value='Copy' class='btn-sml' onClick='Copy2Clipboard(false)' ></th>" );
    document.write( "<th>Part Number:</th>" );
    document.write( "<th>Description:</th>" );
    document.write( "<th>List Price:</th>" );
    document.write( "<th>Quantity:</th>" );
    document.write( "</tr>" );
    document.write( "</thead>" );
    document.write( "<tbody>" );
    x = xmlhttp.responseXML.documentElement.getElementsByTagName(xmlProduct);

    for (i = 0; i < x.length; i++)
    {
        document.write( "<tr>" );
        document.write( "<form name='product" + i + "'>" );
        document.write( "<td width='5%' align='center'><input type='checkbox' name='clipcopy'></td>" );
        document.write( "<td width='20%'>" );
        xx = x[i].getElementsByTagName("PART_NUM") [0].childNodes[0].nodeValue;
        document.write( xx );
        document.write( "<input type='hidden' name='ID_NUM' value='" + xx + "' />" );
        document.write( "</td>" );
        document.write( "<td width='55%'>" );
        xx = x[i].getElementsByTagName("PART_DESC") [0].childNodes[0].nodeValue;
        document.write( xx );
        document.write( "<input type='hidden' name='NAME' value='" + xx + "' />" );
        document.write( "</td>" );
        document.write( "<td align='center'>" );
        xx = x[i].getElementsByTagName( "PART_PRICE" ) [0].childNodes[0].nodeValue;
        document.write( xx );
        xx.length == 1 ? xx = 0 : xx = xx.slice( 1, xx.length );
        document.write( "<input type='hidden' name='PRICE' value='" + xx + "' />" );
        document.write( "</td>" );
        document.write( "<td width='10%' align='center'>" );
        if ( xx == 0 )
        {
            document.write( "&nbsp;" );
        } else {
            document.write( "<input type='text' size=6 maxlength=4 name='QUANTITY' onchange='this.value=CKquantity(this.value)' value='1' /><br />" );
            document.write( "<input type='button' value='Add to Order' class='btn-sml' onClick='AddToCart(this.form)' /><br />" );
            document.write( "<input type='button' value='View Order' class='btn-sml' onclick='DisplayCartAsWindow()' />" );
        }
        document.write( "</td>" );
        document.write( "</form>" );
        document.write( "</tr>" );
    }
    document.write( "</tbody>" );
    document.write( "</table>" );
    document.write( "<form name='clip'><textarea name='clip_copy' style='display:none'></textarea></form>" );
}

