Added TREAT_IPAD_AS_MOBILE parameter and functionality