﻿
function findElementById(a) {
    return document.all + "" != "undefined" ? document.all[a] : document.getElementById(a);
}

function resetField(a, b) {
    if (a.value.length == 0) {
        a.value = b;
        return;
    }
    if (a.value == b) {
        a.value = "";
    }
}

/*
function txtKeyPress(myfield, e, loginButtonId) {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return true;

    if (keycode == 13) {
        var LoginButton = document.getElementById(loginButtonId);
        if (LoginButton == undefined)
            return true;
        else {
            LoginButton.click();
            return false;
        }
    } else return true;
} 
*/

/*
// Note: I recommend you use a more comprehensive event management script for
// production (aka "live") pages.
// Dean Edwards' event manipulation functions is a good example. You can find
// them here: http://dean.edwards.name/weblog/2005/10/add-event2/
var LoadHandler = {
  handlers:[],
  add:function(fn){
    if(window.onload!=LoadHandler.theHandler) LoadHandler._push(window.onload);
    LoadHandler._push(fn);
    window.onload=LoadHandler.theHandler;
  },
  _push:function(fn){
    if(typeof(fn)!='function') return;
    LoadHandler.handlers[LoadHandler.handlers.length]=fn;
  },
  theHandler:function(){
    var handlers=LoadHandler.handlers,i=-1,fn;
    while(fn=handlers[++i]) fn();
  }
}
*/