function CancelEvent(event)
{
  e = event;
  if (typeof e.preventDefault  == 'function') 
        e.preventDefault();
  if (typeof e.stopPropagation == 'function')
        e.stopPropagation();
  if (window.event) {
     window.event.cancelBubble = true; // for IE
     window.event.returnValue = false; // for IE
  }
}