/*************************************************************
*  Copyright © iWeBB, 2001-2002                              *
*  Carter BloodCare All rights reserved                      *
**************************************************************/
//Yash ....formating Date and Validation
function formatDate(cur)
{
  var xx = cur.value;
  var monx;
  var dayx;
  var yearx;
  var nullx;
  var labelx;

  if (arguments[1] == null)
	nullx = "TRUE";
 else
        nullx = arguments[1];


 if (arguments[2] == null)
	labelx = "Undefined field";
  else
        labelx = arguments[2];


  if (xx.length >= 6)
  {
    monx  = xx.substring(0,3);   
    dayx  = xx.substring(3,5);
    yearx = xx.substring(5,10);
alert("Value mon.."+monx+"..Day.."+dayx+"..yearx.."+yearx);

    if (!isYear(yearx)) return warnInvalid (yearField, iYear);
    if (!isMonth(monx)) return warnInvalid (monthField, iMonth);
    if ( (nullx == true) && isEmpty(dayx) ) return true;
    else if (!isDay(dayx)) 
       return warnInvalid (dayx, iDay);
    if (isDate (yearx, monx, dayx))
       return true;
    alert (iDatePrefix + labelx + iDateSuffix)
    return false


    checkDate(yearx, monx, dayx, labelx,, nullx);
  }
}
