/**
 * applyjss()
 **
 * currently only changes the behaviour of text entry fields in forms such that the first time they gain focus, they're cleared. This is
 * so that a field's value can be a descriptive text, but not be submitted every time somebody forgets to actually enter the real data in
 * the field.
 * fields with class "url" are initialised to 'http://' to help users not to mess stuff up.
 */
function applyjss() {
  $('input').one('focus',function(){this.value='';});
  $('input.url').one('focus',function(){this.value='http://';});
}


// This remains here just to illustrate how much jQuery simplifies code...
function oldapplyjss() {
  elements = document.getElementsByTagName('input');
  for(e in elements) {
    element = elements[e];
    if(element.type == 'text') {
      if(/url/.exec(element.attributes['class'].value)){
      	alert('match'+element.attributes['class'].value);
        element.onfocus = function () {
          this.value='http://';
          this.onfocus=function(){};
        };
      } else {
        alert('UNmatch'+element.attributes['class'].value);
        element.onfocus = function () {
          this.value='';
          this.onfocus=function(){};
        };
      }
    }
  }
}
