//
//
//
var xmlFile="partlists/products.xml";
var xmlProduct = "AQUASSAGE";
var xmlProduct1 = "AQUASSAGE_ADJUSTABLE";

function select_aquassage(adj)
{
   var x;
   var y = null;

    loadXMLDoc(xmlFile);
    document.write( "<table class='ptable' align='center' width='80%' border='2'>" );
    document.write( "<thead>" );
    document.write( "<tr>" );
    document.write( "<th align='center'><input type='button' value='Copy' class='btn-sml' onClick='Copy2Clipboard(false)' ></th>" );
    document.write( "<th align='center'>Part Number:</th>" );
    document.write( "<th align='center'>Description:</th>" );
    document.write( "<th align='center'>List Price:</th>" );
    document.write( "<th align='center'>Quantity:</th>" );
    document.write( "</tr>" );
    document.write( "</thead>");
    document.write( "<tbody>" );
    adj ? x = xmlhttp.responseXML.documentElement.getElementsByTagName( xmlProduct1 ) : x = xmlhttp.responseXML.documentElement.getElementsByTagName( xmlProduct );
    for (i = 0; i < x.length; i++)
    {
        document.write( "<tr>" );
        document.write( "<form name='part_list" + i + "'>" );
        document.write( "<td width='5%' align='center'><input type='checkbox' name='clipcopy'></td>" );
        document.write( "<td width='20%' align='left'>" );
        document.write( x[i].getElementsByTagName( "PART_NUM" ) [0].childNodes[0].nodeValue );
        document.write( "<input type='hidden' name='ID_NUM' value='" + 
                        x[i].getElementsByTagName( "PART_NUM" ) [0].childNodes[0].nodeValue + "' />");
        document.write( "</td>" );
        document.write( "<td width='55%' align='left'>" );
        document.write( x[i].getElementsByTagName( "PART_DESC" ) [0].childNodes[0].nodeValue );
        document.write( "<input type='hidden' name='NAME' value='" + 
                        x[i].getElementsByTagName( "PART_DESC" ) [0].childNodes[0].nodeValue + "' />");
        document.write( "</td>" );
        document.write( "<td align='center'>" );
        y = x[i].getElementsByTagName( "PART_PRICE" ) [0].childNodes[0].nodeValue;
        document.write( y );
        if ( y.match(/N\/A/) )
            y = 0;
        else
            y.length == 1 ? y = 0 : y = y.slice( 1, y.length );
        document.write( "<input type='hidden' name='PRICE' value='" + y + "' />");
        document.write( "</td>" );
        document.write( "<td width='10%' align='center'>" );
        if ( y == 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 Your 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>" );
}

