﻿// © Copyright Strategy Builders Inc. 2000-2009. All rights reserved.
//   
// The entire contents of this file is protected by International and
// U.S.Copyright Laws. Unauthorized reproduction, distribution, 
// redistribution and reverse engineering of any or all portion of the code 
// contained in this file is strictly prohibited and may
// result in severe civil and criminal penalties and will be
// prosecuted to the maximum extent possible under the law.
//  
// RESTRICTIONS 
//  
// THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES  
// ARE CONFIDENTIAL AND PROPRIETARY TRADE  
// SECRETS OF Strategy Builders Inc. 
//  
// THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED
// FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE  
// COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE 
// AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT  
// AND PERMISSION FROM Strategy Builders Inc. 
//  
// CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON 
// ADDITIONAL RESTRICTIONS.
//  

function CreateProductListControl(id, data) {

    var productListControl = new XLGridControl(id, data);
    productListControl.setTemplate('productListTemplate');
    // \
//        Total Products Returned %%RowCount%%<br/> \
//                    <table width="100%" cellspacing="0" cellpadding="0">\
//                        <tr>\
//                            <td align="right">\
//        [%GridHeader%] \
//        [%Rows%] \
//        [%GridFooter%] \
//                                </td>\
//                        </tr>\
//                    </table>\
//        ');

    productListControl.setHeaderTemplate('productListHeaderTemplate'); 
    // \
//        <table id="dvPagesBottom" border="0" cellspacing="0" cellpadding="0">\
//            <tr>\
//                <td>\
//        <input type="button" value="|<" %% event onclick=FirstPage%% /> \
//        <input type="button" value="<" %% event onclick=PreviousPage%% /> \
//        <input type="button" value=">" %% event onclick=NextPage%% /> \
//        <input type="button" value=">|" %% event onclick=LastPage%% /> \
//</td>\
//            </tr>\
//        </table>\
//        <table id="tblProductListFilterTop" width="100%" cellspacing="0" cellpadding="0">\
//            <tr>\
//                <td>\
//                    Product Filter</td>\
//            </tr>\
//        </table>\
//        <table border="1" width="100%" cellspacing="0" cellpadding="0" style="font-size: small" >\
//        ');

    productListControl.setRowTemplate('productListRowTemplate');
    productListControl.setRowsLoadingTemplate('productListLoadingTemplate');
    // \
//        <tr bgcolor="white"> \
//                                        <tr>\
//                                            <td width="25">\
//                                                <input id="chkbcCompare" type="checkbox" /></td>\
//                                            <td width="150">\
//                                                <table id="tblProductImage" width="100%"  cellspacing="0" cellpadding="0" >\
//                                                    <tr>\
//                                                        <td>\
//                                                            <a href="Product.aspx?StoreBusinessId=%%row.CatalogBusinessId%%&ProductId=%%row.ProductId%%&BusinessId=%%row.BusinessId%%&LanguageId=1"><img alt="%%row.Name%%" src="http://%%row.ImageUrl%%" border="0"/></a></td>\
//                                                    </tr>\
//                                                    <!--<tr>\
//                                                        <td>\
//                                                            More Images ...</td>\
//                                                    </tr>-->\
//                                                    <tr>\
//                                                        <td>%%row.Manufacturer%%</td>\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                           <table id="tblReviewRank" align="center" width="100%">\
//                                                                <tr>\
//                                                                    <td align="center">\
//                                                                        <img alt="" src="images/review_rank.gif" style="width: 12px; height: 14px" /></td>\
//                                                                    <td align="center">\
//                                                                        <img alt="" src="images/review_rank.gif" style="width: 12px; height: 14px" /></td>\
//                                                                    <td>\
//                                                                        <img alt="" src="images/review_rank.gif" style="width: 12px; height: 14px" /></td>\
//                                                                    <td>\
//                                                                        <img alt="" src="images/review_rank.gif" style="width: 12px; height: 14px" /></td>\
//                                                                    <td>\
//                                                                        <img alt="" src="images/review_rank.gif" style="width: 12px; height: 14px" /></td>\
//                                                                        <td>\
//                                                            &nbsp;</td>\
//                                                                </tr>\
//                                                            </table>\
//                                                        </td>\
//                                                    </tr>\
//                                                    <!--<tr>\
//                                                        <td>Send to Friend...</td>\
//                                                    </tr>-->\
//                                                </table>\
//                                            </td>\
//                                            <td>\
//                                                <a href="Product.aspx?StoreBusinessId=%%row.CatalogBusinessId%%&ProductId=%%row.ProductId%%&BusinessId=%%row.BusinessId%%&LanguageId=1">%%row.Name%%</a>\
//                                                <br/>\
//                                                %%row.Description%%\
//                                                <br/>\
//                                                Retail: %%formatCurrency(row.MSRP)%%\
//                                            </td>\
//                                            <td valign="top" width="150">\
//                                                <table id="tblBuyNow" width="100%">\
//                                                    <tr>\
//                                                        <td>\
//                                                            Your Price: %%formatCurrency(row.Price)%%</td>\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                            </td>\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                        %% switch row.Discount %%\
//                                                        %% case 0 %%\
//                                                        %% default %%\
//                                                            Discount: %%formatCurrency(row.Discount)%%</td>\
//                                                        %% end switch %%\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                            <!--You Save: %%formatCurrency(row.MSRP-row.Price)%%--></td>\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                            In Stock: %%row.AvailableQuantity%%</td>\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <!--<td>\
//                                                            Qty: Slider</td>-->\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                            <input type="button" value="Add To cart" onclick="javascript:jsAddToCart(%%row.CatalogBusinessId%%,%%row.BusinessId%%, %%row.ProductId%%, 1);" /></td>\
//                                                    </tr>\
//                                                    <tr>\
//                                                        <td>\
//                                                            %%row.Condition%%</td>\
//                                                    </tr>\
//                                                </table>\
//                                            </td>\
//                                        </tr>\
//        ');

    productListControl.setFooterTemplate('productListFooterTemplate');
    // \
//        </table>\
//        <table id="tblProductListFilterBottom" width="100%">\
//            <tr>\
//                <td>\
//                    Product Filter</td>\
//            </tr>\
//        </table>\
//        <table id="dvPagesBottom">\
//            <tr>\
//                <td>\
//        <input type="button" value="|<" %% event onclick=FirstPage%% /> \
//        <input type="button" value="<" %% event onclick=PreviousPage%% /> \
//        <input type="button" value=">" %% event onclick=NextPage%% /> \
//        <input type="button" value=">|" %% event onclick=LastPage%% /> \
//</td>\
//            </tr>\
//        </table>\
//        ');

    return productListControl;

}


