﻿    var sorter;
   var pager;

   function pagin() {
    try {
        sorter = new TINY.table.sorter('sorter', 'table', {
            headclass: 'head',
            paginate: true,
            size:8,
            sortcolumn:0,
            sortdir: -1,
            init: true
        });

    }
    catch (e) {
        //  alert(e);
    }
}
function pagin1() {
  pager= new Pager('table', 8); 
    try {
        pager.init();
       // pager.showPageNav('pager', 'pageNavPosition');
        pager.showPage(1);
    }
    catch (e) {
        //alert(e);
    }
}
function getdata() {

    var a = document.getElementById("txtGetQuote").value;
   // alert(a);
    AjaxRequest.get(
  {
      'url': 'GetWatchList.aspx'
    , 'onSuccess': function(req) { document.getElementById("watchtable").style.display = "block"; document.getElementById("loading").style.display = "none"; document.getElementById("w_market").innerHTML = ""; document.getElementById("w_market").innerHTML = req.responseText;/*pagin();*/ }
    , 'onError': function(req) { alert('Error!:\n' + req.statusText /*+ '\nContents=' + req.responseText*/); }
    , 'onLoading': function() { document.getElementById("watchtable").style.display = "none";document.getElementById("loading").style.display = "block";
    }

  }
);

}
function getdata1() {
    var a = document.getElementById("txtGetQuote").value;
    AjaxRequest.get(
  {
      'url': 'StockBeingViewed.aspx'
    , 'onSuccess': function(req) { document.getElementById("watchtable1").style.display = "block"; document.getElementById("loading1").style.display = "none"; document.getElementById("stock").innerHTML = ""; document.getElementById("stock").innerHTML = req.responseText;/*pagin(); */}
    , 'onError': function(req) { alert('Error!:\n' + req.statusText /*+ '\nContents=' + req.responseText*/); }
    , 'onLoading': function() { document.getElementById("watchtable1").style.display = "none";document.getElementById("loading1").style.display = "block";
    }

  }
);

}

function callback() {
  //  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

    //function EndRequestHandler(sender, args) {
      //getdata();
        //pagin();
    //}
    //document.getElementById("loading").style.display = "none"; 
    try{
   // getdata();
  
 //  getdata1();
   }catch(e)
   {
   }
    //pagin();
}


function caller() {
    try {
       callback();
      // getdata();
      //pagin();
    }
    catch (e) {
    }
   // pagin();
}



callback();
