// borrowed subclass from http://www.golimojo.com/etc/js-subclass.html
function subclass(constructor, superConstructor)
{
	function surrogateConstructor()
	{
	}

	surrogateConstructor.prototype = superConstructor.prototype;

	var prototypeObject = new surrogateConstructor();
	prototypeObject.constructor = constructor;

	constructor.prototype = prototypeObject;
}

String.prototype.escapeHTML = function () {                                       
        return(                                                                 
            this.replace(/&/g,'&amp;').                                         
                replace(/>/g,'&gt;').                                           
                replace(/</g,'&lt;').                                           
                replace(/"/g,'&quot;')                                         
        );                                                                     
    };
            var NS4 = (document.layers) ? true : false;
            function checkEnter(event, doFunction)
            {     
                var code = 0;
                
                if (NS4)
                    code = event.which;
                else
                    code = event.keyCode;
                if (code==13)
                {
                    clearAlert();
                    doFunction();
                }
            }
