
// www.sean.co.uk (credit to this millisecond pause function)

function pausecomp(millis)
{
  var date = new Date();
  var curDate = null;

  do { curDate = new Date(); }
  while(curDate-date < millis);
}

window.onload = function()
{
  //adding the event listerner for Mozilla
  if(window.addEventListener) document.addEventListener('DOMMouseScroll', moveObject, false);
  //for IE/OPERA etc
  document.onmousewheel = moveObject;
}

function moveObject(event)
{
  var delta = 0;
  if (!event) event = window.event;
  // normalize the delta
  if (event.wheelDelta && event.ctrlKey)
  {
    // IE & Opera
    pausecomp(1500); //pauses for half a second so mouse scroll zoom responds more accurately
    window.location.reload();
  }
  else if (event.detail && event.ctrlKey) // W3C
  {
    pausecomp(1500); //pauses for half a second so mouse scroll zoom responds more accurately
    window.location.reload();
  }
}

document.onkeydown = keydown;
function keydown(evt)
{
  if (!evt)
  evt = event;
  if (evt.ctrlKey && evt.keyCode == 107)
  {
    // CTRL +
    window.location.reload();
  }
  else if (evt.ctrlKey && evt.keyCode == 109)
  {
    // CTRL -
    window.location.reload();
  }
  else if (evt.ctrlKey && evt.keyCode == 48)
  {
    // CTRL 0
    window.location.reload();
  }
  else if (evt.ctrlKey && evt.keyCode == 96)
  {
    // CTRL 0 (num pad 0)
    window.location.reload();
  }
} // function keydown(evt)

