code: function addResizeEvent(func, dur) {
  		    var oldResize = window.onresize,
  				resizeTimer,
  				dur = typeof dur === "undefined" ? 100 : parseInt(dur, 10);
  
  			window.onresize = function () {
  				clearTimeout(resizeTimer);
  
  		        if (typeof oldResize === 'function') {
  		            oldResize();
  		        }
  
  				resizeTimer = setTimeout(function() {
  					func();
  				}, dur);
  			}
  		}
docs: http://stackoverflow.com/questions/3339825/what-is-the-best-practise-to-not-to-override-other-bound-functions-to-window-onr