var ajax = new sack();

function SelectPriceList(id1)
{ 
    //alert(id1);
    if (id1 == -1)
    {
        document.getElementById('View').innerHTML = '';
         document.getElementById('select2').innerHTML = '';
    }
    else
    {
    
        ajax.resetData();
        ajax.setVar("parser_type", "SelectPriceList");
       ajax.setVar("Select1_ID", id1);
        ajax.requestFile = "index.php";     
        ajax.method = "POST";
        ajax.onCompletion = OnStepDoneSelect;
        ajax.runAJAX();
    }
}

function ViewPriceList(id2)
{ 
    ajax.resetData();
    ajax.setVar("parser_type", "ViewPriceList");
   ajax.setVar("Select2", id2);
    ajax.requestFile = "index.php";     
    ajax.method = "POST";
    ajax.onCompletion = OnStepDoneView;
    ajax.runAJAX();
}


function OnStepDoneSelect()
 {
    
    var response = ajax.response;
    //alert(response);
    if (document.getElementById('select2'))
    {
        document.getElementById('select2').innerHTML = response;
    }

}

function OnStepDoneView()
 {
    var response = ajax.response;
    //alert(response);
    document.getElementById('View').innerHTML = response;

}

