function getURLParam(name)
// get named param from URL
{
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return unescape(results[1]);
}

function CheckUpgradeReqFields(os0ref,os1ref,custref)
{
  if ((os0ref.value.length==0)||(os1ref.value.length==0))
  {
    alert("Please fill all required fields (marked with *). If you do not have your KEY available, enter NA in the Key field and be sure to fill out the Additional User Information at the bottom of the PayPal form so that we can locate your customer record.");
    return false;
  }
  else {
    // set value of custom field as backup for paypal not emailing os0 and os1
    custref.value = os0ref.value + ";" + os1ref.value;
    return true;
  }
}

function CheckNewReqFields(os0ref,custref)
{
  if ((os0ref.value.length==0))
  {
    alert("Please fill all required fields (marked with *)");
    return false;
  }
  else {
    // set value of custom field as backup for paypal not emailing os0
    custref.value = os0ref.value + ";none";
    return true;
  }
}
