// Resets Subscribe Form items to preset text

function resetFields(whichform) {
  for (var i=0; i<whichform.elements.length; i++) {
    var element = whichform.elements[i];
    if (element.type == "submit") continue;
    if (element.type == "img") continue;
    if (element.type == "radio") continue;
    if (element.type == "hidden") continue;
    if (!element.defaultValue) continue;
    if (element.className.match("inputitem")) {
      element.onfocus = function() {
        if (this.value == this.defaultValue) {
          this.value = "";
        }
      }
      element.onblur = function() {
        if (this.value == "") {
          this.value = this.defaultValue;
        }
      }
    } else if (element.className.match("inputitem")) {
      element.onfocus = function() {
        if (this.value == this.defaultValue) {
          this.select();
        }
      }
      element.onblur = function() {
        if (this.value == "") {
          this.value = this.defaultValue;
        }
      }
    }
  }
}

function prepareSubscribeForm() {
  for (var i=0; i<document.forms.length; i++) {
    var thisform = document.forms[i];
    resetFields(thisform);
  }
}


addWebblerLoadEvent(prepareSubscribeForm);
