﻿// JScript File

function StartTimer(timer_box)
{
    if (document.getElementById(timer_box).value == '')
    {
        d = new Date()
        document.getElementById(timer_box).value = d
    }
}
function StopTimer(timer_box)
{
    d = new Date()
    document.getElementById(timer_box).value = d
}


function DisableEnter()
{

    if (window.event.keyCode == 13) 
    {
        event.returnValue=false; 
        event.cancel = true;
    }
}

function noPostBack(sNewFormAction,sTarget,method)
{
    if (sTarget != 'undefined')
    {
        document.forms[0].target = sTarget;
    }
    
    document.forms[0].action = sNewFormAction;
    document.forms[0].method = method
    document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
}


function sstchur_SmartScroller_GetCoords()
  {
    var scrollX, scrollY;
    if (document.all)
    {
      if (!document.documentElement.scrollLeft)
        scrollX = document.body.scrollLeft;
      else
        scrollX = document.documentElement.scrollLeft;

      if (!document.documentElement.scrollTop)
        scrollY = document.body.scrollTop;
      else
        scrollY = document.documentElement.scrollTop;
    }
    else
    {
      scrollX = window.pageXOffset;
      scrollY = window.pageYOffset;
    }
    document.forms[0].ctl00_scrollLeft.value = scrollX;
    document.forms[0].ctl00_scrollTop.value = scrollY;
  }


  function sstchur_SmartScroller_Scroll()
  {
  
    var x = document.forms[0].ctl00_scrollLeft.value;
    var y = document.forms[0].ctl00_scrollTop.value;
    window.scrollTo(x, y);
  }

  
  window.onload = sstchur_SmartScroller_Scroll;
  window.onscroll = sstchur_SmartScroller_GetCoords;
  window.onclick = sstchur_SmartScroller_GetCoords;
  window.onkeypress = sstchur_SmartScroller_GetCoords;