_getParameterByName = function(name) {
        var regex = new RegExp("[\\?&]" + name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]') + '=([^&#]*)');
        var results = regex.exec(location.search);

        if (results === null) {
            return '';
        }

        return decodeURIComponent(results[1].replace(/\+/g, " "));
    }
Generic function for parsing URL params.
Via http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript

@method _getParameterByName
@param {String} name The name of the paramter to get from the URL.