function getUrlParams (paramName) { var reg = new RegExp("[\?&]" + paramName + "=([^&]*)[&]?", "i"); var paramVal = window.location.search.match(reg); return paramVal == null ? "" : decodeURIComponent(paramVal[1]);}