function to_num(x) {
	if(isNaN(x)) {
		if(isString(x)) {
			x = x.substr(0, x.length-2);
		}
	}
	return parseInt(x);
}
function pause(ms) {
	var date = new Date();
	var curDate = null;
	do {
		curDate = new Date();
	}
	while(curDate-date < ms);
}
this.isString = function(obj) {
     return (isNative(obj) && (obj.constructor == String));
}
this.isUndefined = function(obj) {
     return (typeof(obj) == "undefined");
};
this.isDefined = function(obj) {
     return (typeof(obj) != "undefined");
};
this.isNull = function(obj) {
     return ((typeof(obj) == "object") && (obj === null));
};
this.isNative = function(obj) { // returns true for every ECMA-object that is this global functions argument;
	return (!isUndefined(obj) && !isNull(obj) && (typeof(obj.constructor) == "function"));
};
this.isBoolean = function(obj) {
     return (isNative(obj) && (obj.constructor == Boolean));
};
this.isAlien = function(obj) {
  return (isObject(obj) && (typeof(obj.constructor) != "function"));
};
this.isNode = function(obj) {
  return (((isAlien(obj) && isUndefined(obj.prototype) && isUndefined(obj.constructor)) || (isNative(obj) && isUndefined(obj.prototype) && (obj.constructor == Object))) ? ((obj.nodeType&&obj.cloneNode) ? (true) : (false)) : (false));
};
this.isNumber = function(obj) {
  return (isNative(obj) && (obj.constructor == Number) && isFinite(obj));
};
this.isPrimitive = function(obj) {
  return (isString(obj) || isNumber(obj) || isBoolean(obj));
};
this.isObject = function(obj) {
  return (!isUndefined(obj) && !isNull(obj) && !isPrimitive(obj));
};
this.isDate = function(obj) {
  return (isNative(obj) && (obj.constructor == Date));
};
this.isError = function(obj) {
  return (isNative(obj) && (obj.constructor == Error));
};
this.isRegExp = function(obj) {
  return (isNative(obj) && (obj.constructor == RegExp));
};
this.isFunction = function(obj) {
  return (isNative(obj) && (obj.constructor == Function));
};
this.isArray = function(obj) {
  return (isNative(obj) && (obj.constructor == Array));
};