      function resetFields(form) {
        for (var i = form.elements.length - 1; i >= 0; i--){
          var element = form.elements[i];
          if (element.type == "submit") continue;
          if (!element.defaultValue) continue;
          element.onfocus = function(){
            if (this.value == this.defaultValue) this.value = "";
          }
          element.onblur = function() {
            if (this.value == "") this.value = this.defaultValue;
          }
        };
      };
      
      function prepareForms(){
        for (var i = document.forms.length - 1; i >= 0; i--){
          resetFields(document.forms[i]);
        };
      }

      function selectImage(images, width, height, alt, path) {
        var max = images.length;
        var num = Math.floor((Math.random() * max));
        document.writeln(path);
        document.writeln("<img src='" + path + "' alt='" + alt + "' name='rotating photo' width='" + width + "' height='" + height + "' />");
      }

      function $(elm){
        return document.getElementById(elm);
      };

    function addLoadEvent(func) {
      var oldonload = window.onload;
      if (typeof window.onload != 'function'){
        window.onload = func;
      } else {
        window.onload = function(){
          oldonload();
          func();
        }
      };
    };

