/**
 * Processes an url in order to get a query argument
 *
 * @param name (string)
 *   - The name of the query argument e.g.
 *
 * @param href (string)
 *   - The url in which to search the query argument
 *      If omitted, window.location.href is used
 *
 * @return (string)
 *   - The value of the found argument
 */
function get_query_argument(name, href) {

  href = (href) || window.location.href;
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");

  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec(href);

  return (results == null ? "" : results[1]);
};


