String.prototype.trim = function() {
 return this.replace(/^\s+|\s+$/, '');
}

function isNum( value)
{
 var str = new String( value);
 return( str.isNum());
}
function isFloat( value)
{
 var str = new String( value);
 return( str.isFloat());
}

String.prototype.isNum = function() {
 if (this=="") return(false);
 var regex = /[^0-9\-]/;
 return !regex.test( this);
};

String.prototype.isFloat = function()
{
 if (this=="") return(false);
 var regex = /[^0-9\.\-]/;
 return !regex.test( this);
}

function cancelEvent(e)
{
 if ( !e) e = window.event;
 if ( e.stopPropagation) e.stopPropagation();
 e.cancelBubble = true;
}
