function DtValid(objSource, objArgs) 
   {
      return objArgs.IsValid = validateDate(objArgs.Value);
 }

function validateDate(strValue) {
/************************************************
DESCRIPTION: Validates that a string contains only 
    valid dates with 2 digit month, 2 digit day, 
    4 digit year. Date separator can be ., -, or /.
    Uses combination of regular expressions and 
    string parsing to validate date.
    Ex. dd/mm/yyyy or dd-mm-yyyy or dd.mm.yyyy
    
PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.
   
REMARKS:
   Avoids some of the limitations of the Date.parse()
   method such as the date separator character.
*************************************************/
 
 var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/
 //var strValue = document.txtStartDate.value;
  //check to see if in correct format
  //alert(strValue)
  if(!objRegExp.test(strValue))
    return false; //doesn't match pattern, bad date
  else{
    var arrayDate = strValue.split(RegExp.$1); //split date into month, day, year
	var intDay = parseInt(arrayDate[0],10); 
	var intYear = parseInt(arrayDate[2],10);
    var intMonth = parseInt(arrayDate[1],10);
	
	//check for valid month
	if(intMonth > 12 || intMonth < 1) {
	   return false;
	 }
	
    //create a lookup for months not equal to Feb.
    var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,
                        '08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}
        
    //check if month value and day value agree
    if(arrayLookup[arrayDate[1]] != null) {
       if(intDay <= arrayLookup[arrayDate[1]] && intDay != 0)
         return true; //found in lookup table, good date
        
    }
		
    //check for February
	var booLeapYear = (intYear % 4 == 0 && (intYear % 100 != 0 || intYear % 400 == 0));
    if( ((booLeapYear && intDay <= 29) || (!booLeapYear && intDay <=28)) && intDay !=0)
      return true; //Feb. had valid number of days
  }
  return false; //any other values, bad date
}

//function currencyFormat(fld, milSep, decSep, e) {
function currencyFormat(fld, milSep, decSep) {
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789.';
var num = tempNum = '';
len = fld.value.length;
//for(i = 0; i < len; i++)
//if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;

for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) num += fld.value.charAt(i);

///----- Get the decimal number
dec = num.indexOf(decSep);
cents=''
if (dec > -1)
{
   cents = num.substring(dec,num.length)
   num = num.substring(0,dec)
}
///-----------------------

/// ---- put the milSep ------
len = num.length;
if (len == 0) fld.value = '';
if (len > 0)
{
	tempNum = '';
	for (j = 0, i = len-1; i >= 0; i--)
	{
		if (j == 3) 
		{
			tempNum += milSep;
			j = 0;
		}
		tempNum += num.charAt(i);
		j++;
	}
	fld.value = '';
	len2 = tempNum.length;
	for (i = len2 - 1; i >= 0; i--)
	  fld.value += tempNum.charAt(i);
}
///------------------------------
fld.value += cents

return false;
}

function showhideDiv(showDiv,hideDiv)
 { 
    if(hideDiv !='')
    {
     var objHide= "document.all." + hideDiv + ".style.display = 'none'";
     eval(objHide);
    }
   if(showDiv !='')
    {
   var objShow = "document.all." + showDiv + ".style.display = ''";
   eval(objShow);
   }
 }