﻿// JScript File


function LoadGridPage(PageID) {
  window.Grid1.Page(PageID);
  window.Grid1.Render;
}

function LoadGridPage2(NP) {
var PageIndex = window.Grid1.CurrentPageIndex;
var TotalPages = window.Grid1.PageCount;

if (NP == 'N') {
   if (PageIndex + 1 > TotalPages - 1) {
 
   }
   else {
       window.Grid1.Page(PageIndex + 1);
       window.Grid1.Render;
       location.href="#top";
   }
}
   
if (NP == "P") {
      if (PageIndex - 1 < 0) {
      }
      else {
       window.Grid1.Page(PageIndex + 1);
       window.Grid1.Render;
       location.href="#top";
   }
}
}

function GoTop() {
  location.href="#top";
}
function ReQueryGrid() {
  window.Grid1.Postback();
  window.Grid1.Render;
}

 //  Initilize Grid so it could be dynamicly resized
  function InitlizeGrid()
  {
    var oTableDom = document.getElementById("lookupgrid_dom");
    //  If Grid not build yet then return and try again later
    if (oTableDom == null)
    {
      window.setTimeout("InitlizeGrid();",500);
      return;
    }

    //  Set height to 100% so it will be automaticly resized
    var oTableDom = document.getElementById("lookupgrid_dom");
    oTableDom.style.height = "100%";  
  }
