/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function getProductData(id)
{
    var sProdId = id.toString().substr(5)
    var parameter = "product_id=" + sProdId;
    $("#detail_product_id").val(sProdId);
    $("#product_details").html("");
    $("#show_productdetails").dialog('open');
    $.ajax({
        type: "get",
        url: "utils/product_test.php",
        data: parameter,
        success: function(html_value)
        {
            //alert(html_value);
            $("#product_details").html(html_value);
        }
    });
}

function fwdToTestPage(name)
{
    //alert("index.php?menu_hierarchy=order_vs.php&pre_choose=" + name.substr("VS-YYYY-".length));
    window.location = "index.php?menu_hierarchy=order_vs.php&pre_choose=" + escape(name);
}

function bindProductActions()
{
    $('input.product_details').click(function(event)
    {
        event.preventDefault();
        getProductData($(this).attr("id").toString());
    });

    $('input.product_test').click(function(event)
    {
        event.preventDefault();
        fwdToTestPage($(this).attr("id").toString());
    });
}
