convert max-viewport code to jquery plugin