function GetQueryString()
// Parse querystring, store the name/value pairs in properties of an object, return that object.
{
  var argname, argvalue, pos, ix;
  var args = new Object();
  var query = location.search.substring(1); 
  var pairs = query.split("&");
  var str = "";
  for (ix = 0; ix < pairs.length; ix++)
  {
    pos = pairs[ix].indexOf('=');
    if (pos < 0)
    {
      continue;
    }
    argname = pairs[ix].substring(0,pos);
    argvalue = (pairs[ix].substring(pos+1)).replace(/\+/g, " ");
    args[argname] = unescape(argvalue);
    str = str + " " + argname + "=" + argvalue;
  }
  return args;
}

function IsBlank(elem)
{
  var str = elem.value;
  var ix, ch;
  for (ix = 0; ix < str.length; ix++)
  {
    ch = str.charAt(ix);
    if ((ch > ' ') && (ch < '~'))
    {
      return false;
    }
  }
  return true;
}

function PositionMessages(leftadj, topadj)
{
  var ExecuteButtonObj = document.getElementById("ExecuteButton");
  var obj;
  var adjleft = 0, adjtop = 0;
  if (arguments.length > 0)
  {
    adjleft = leftadj;
    if (arguments.length > 1)
    {
      adjtop = topadj;
    }
  }
  if (ExecuteButtonObj)
  {
    ButtonLeft = ExecuteButtonObj.offsetLeft
    obj = ExecuteButtonObj;
    while (obj = obj.offsetParent) ButtonLeft += obj.offsetLeft;

    ButtonTop = ExecuteButtonObj.offsetTop;
    obj = ExecuteButtonObj;
    while (obj = obj.offsetParent) ButtonTop += obj.offsetTop;

//alert(ButtonTop + " " + ButtonLeft + " " + adjleft + " " + adjtop);    
    ErrorMessageObj = document.getElementById("ErrorMessage");
    if (ErrorMessageObj)
    {
      ErrorMessageObj.style.left = ButtonLeft + adjleft;
      ErrorMessageObj.style.top = ButtonTop + adjtop;
    }
    ConfirmMessageObj = document.getElementById("ConfirmMessage");
    if (ConfirmMessageObj)
    {
      ConfirmMessageObj.style.left = ButtonLeft + adjleft;
      ConfirmMessageObj.style.top = ButtonTop + adjtop;
    }
  }
}

function HighlightBox(elem, sw, thiscolor)
{
  var color = '';
  if (sw) color = '#FDFFD8';
  if (arguments.length > 2) 
  {
    if (thiscolor.length > 0) color = thiscolor;
  }
  elem.style.backgroundColor = color;
}

function HighlightIds(id, sw, thiscolor) 
{
  var color = '';
  if (sw) color = '#FDFFD8';
  if (arguments.length > 2) 
  {
    if (thiscolor.length > 0) color = thiscolor;
  }
  var ids = id.split('-');
  var thisid = ids[0];
  var obj = document.getElementById(thisid);
  if (!obj) return;
  obj.style.backgroundColor = color;
  var ix;
  for (ix = 1; ix < 100; ix++)
  {
    obj = document.getElementById(thisid+'-'+ix);
//alert(thisid+'-'+ix+" "+obj);    
    if (!obj) return;
    obj.style.backgroundColor = color;
  }
}

