//
//  Spa Light XML data and Table
//
var xmlFile="partlists/partlist.xml";
var xmlProduct="LIGHT";

function select_light()
{
    var x;
    var xx;

    loadXMLDoc(xmlFile);
    document.write( "<table class='ptable' align='center' width='90%' 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 align='center'>Part Number</th>" );
    document.write( "<th align='center'>Product Series</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>" );
    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='15%' align='center'>" );
        y = x[i].getElementsByTagName( 'PIC' ) [0].childNodes[0].nodeValue;
        image = "partlists/" + y + ".jpg";
        messages[i] = new Array(image,"","#0033ff");
        z = x[i].getElementsByTagName( "NUM" ) [0].childNodes[0].nodeValue;
        document.write( "<img name='img" + i + "' src=" + image + " width='100px' border='0' /></a>" );
        document.write( "</td>" );
        document.write( "<td width='10%' style='lineheight: 20px'>" );
        xx = x[i].getElementsByTagName("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='10%' style='lineheight: 20px'>" );
        document.write( x[i].getElementsByTagName( "TYPE" ) [0].childNodes[0].nodeValue );
        document.write( "</td>" );
        document.write( "<td width='40%' style='lineheight: 20px'>" );
        xx = x[i].getElementsByTagName("DESC") [0].childNodes[0].nodeValue;
        document.write( xx );
        document.write( "<input type='hidden' name='NAME' value='" + xx + "' />" );
        document.write( "</td>" );
        document.write( "<td width='15%' align='center' style='lineheight: 20px'>" );
        xx = x[i].getElementsByTagName( "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>" );
}


