﻿// General functions.

// Open a new window to a specified URL.
//
function openWindow(url) {
  window.open(url, '_blank', 'toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1')
}

// Get the value of an Url parameter.
//
function getUrlParameterValue(name) {
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexString = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexString, "i");
  var results = regex.exec(window.location.href);

  if (results == null) {
    return "";
  } else {
    return results[1];
  }
}
