if(window.attachEvent)
  window.attachEvent("onload",setListeners);



function setListeners()
{
  inputList = document.getElementsByTagName("INPUT");

  for (i=0; i<inputList.length; i++)
  {
    inputList[i].attachEvent("onpropertychange",restoreStyles);
    inputList[i].style.backgroundColor = "";
  }

  selectList = document.getElementsByTagName("SELECT");

  for (i=0;i<selectList.length;i++)
  {
    selectList[i].attachEvent("onpropertychange",restoreStyles);
    selectList[i].style.backgroundColor = "";
  }
}



function restoreStyles()
{
  if (event.srcElement.style.backgroundColor != "")
    event.srcElement.style.backgroundColor = "";
}



function wopen(url, name, w, h)
{
  // Add to the width and height to make up for the space used for the browser frame.
  w += 32;
  h += 96;

  var win = window.open(url,  name, 'width=' + w + ', height=' + h + ', ' +  'location=no, menubar=no, ' +  'status=no, toolbar=no, scrollbars=yes, resizable=yes');
  win.resizeTo(w, h);
  win.focus();
}



function submit_registration(in_submit_method)
{
  if(document.getElementById('submit_method'))
  {
    var old_submit_method = document.getElementById('submit_method');
    old_submit_method.parentNode.removeChild(old_submit_method);
  }

  var submit_method = document.createElement('input');
  submit_method.type = 'hidden';
  submit_method.id = 'submit_method';
  submit_method.name = 'submit_method';
  submit_method.value = in_submit_method;
  document.forms[0].appendChild(submit_method);

  document.forms[0].submit();
}