// ----------------------------------------------------------------------------------------------------
function daysInFebruary(intYear) { // Returns Integer
  // February has 29 days in any year evenly divisible by four,
  // except for centurial years which are not also divisible by 400
  return (((intYear % 4 == 0) && ((!(intYear % 100 == 0)) || (intYear % 400 == 0))) ? 29 : 28 );
}
// ----------------------------------------------------------------------------------------------------
function isDate(intYear, intMonth, intDay) { // Returns Boolean
  var daysInMonth = new Array(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
  var intYear = parseInt(intYear);
  var intMonth = parseInt(intMonth);
  var intDay = parseInt(intDay);
  if (intDay > daysInMonth[intMonth])
    return false;
  if ((intMonth == 2) && (intDay > daysInFebruary(intYear)))
    return false;
  return true;
}
// ----------------------------------------------------------------------------------------------------
function isEmail(strInput) { // Returns Boolean
  var reEmail = /^.+\@.+\..+$/; // Regular expression related with isEmail()
  return reEmail.test(strInput);
}
// ----------------------------------------------------------------------------------------------------
function isEmpty(strInput) { // Returns Boolean
  strInput = trim(strInput);
  return ((strInput == null) || (strInput.length == 0));
}
// ----------------------------------------------------------------------------------------------------
function isNought(strInput) { // Returns Boolean
  return (strInput == 0);
}
// ----------------------------------------------------------------------------------------------------
function preloadImage(strSource) { // Returns Nothing
  if (document.images) {
    var objImage = new image();
    objImage.src = strSource;
  }
}
// ----------------------------------------------------------------------------------------------------
function popup(strURL, intWidth, intHeight) { // Returns Nothing
  window.open(strURL, "popup", "width=" + (intWidth + 20) + ", height=" + (intHeight + 30));
}
// ----------------------------------------------------------------------------------------------------
function trim(strInput) { // Returns String
  while (strInput.charAt(0) == " ")
    strInput = strInput.substring(1, strInput.length);
  while (strInput.charAt(strInput.length - 1) == " ")
    strInput = strInput.substring(0, strInput.length - 1);
  return strInput;
}
// ----------------------------------------------------------------------------------------------------
function isNumber(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}
// ----------------------------------------------------------------------------------------------------

function getTodayDate() //Returns String
{
		var d = new Date()
		dateToday = (d.getDate()) +"/"+(d.getMonth() + 1)+"/"+(d.getFullYear());
		alert("a"+dateToday);
		return dateToday;
}
