﻿// JScript File for Common Functions
function isIEObject(a) 
{
 return isObject(a) && typeof a.constructor != 'function';
}

function isArray(a) 
{
return isObject(a) && a.constructor == Array;
}

function isBoolean(a) 
{
  return typeof a == 'boolean';
}

function isEmpty(o) 
{
  if (isObject(o)) 
       for (var i in o) 
            return false;
  return true;
}

function isFunction(a) 
{
  return typeof a == 'function';
}

function isNull(a) 
{
  return typeof a == 'object' && !a;
}

function isNumber(a) 
{
   //return typeof a == 'number' && isFinite(a); //comment by san
   var RegExp = /^(-)?(\d*)(\.?)(\d*)$/; // Note: this WILL allow a number that ends in a decimal: -452. 
   var result = a.match(RegExp);
   return result;
}

function isObject(a) 
{
 return (typeof a == 'object' && !!a) || isFunction(a);
}

function isString(a) 
{
 return typeof a == 'string';
}

function isUndefined(a) 
{
 return typeof a == 'undefined';
} 

