<!--
function GetDaysInMonth(intMonth, intYear)
{
   var arrDaysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) 

   if (intMonth == 2 && (intYear % 4 == 0)) { return arrDaysInMonth[intMonth - 1] + 1 } else { return arrDaysInMonth[intMonth - 1] } 
}

function GetDate(datDate, strResult)
{
   datDate = new Date(datDate)
   var strHours = new String(datDate.getHours())
   var strMinutes = new String(datDate.getMinutes())
   var strDays = new String(datDate.getDate())
   var strMonths = new String(datDate.getMonth() + 1)   

   if (isNaN(datDate)) { return new String() }

   if (strHours.length == 1)   { strHours    = "0" + strHours }
   if (strMinutes.length == 1) { strMinutes  = "0" + strMinutes }
   if (strDays.length == 1)    { strDays     = "0" + strDays }
   if (strMonths.length == 1)  { strMonths   = "0" + strMonths }

   strResult = strResult.replace(/\[daynr\]/gi, datDate.getDate())
   strResult = strResult.replace(/\[daynrdd\]/gi, strDays)
   strResult = strResult.replace(/\[day\]/gi, arrDays[datDate.getDay()])
   strResult = strResult.replace(/\[monthnr\]/gi, datDate.getMonth() + 1)
   strResult = strResult.replace(/\[monthnrdd\]/gi, strMonths)
   strResult = strResult.replace(/\[month\]/gi, arrMonths[datDate.getMonth()])
   strResult = strResult.replace(/\[year\]/gi, datDate.getFullYear())
   strResult = strResult.replace(/\[time\]/gi, strHours + ":" + strMinutes)

   return strResult  
}

function DateDiff(datStartDate, datEndDate, strReturnType) 
{
   if (strReturnType =='days') 
   {  
      return Math.ceil((datEndDate.getTime() - datStartDate.getTime()) / (24*60*60*1000));  
   } 
   else if (strReturnType == 'hours') 
   { 
      return Math.ceil((datEndDate.getTime() - datStartDate.getTime()) / (60*60*1000));  
   }
   else if (strReturnType == 'minutes') 
   { 
      return Math.ceil((datEndDate.getTime() - datStartDate.getTime()) / (60 * 1000));  
   } 
   else if(strReturnType == 'seconds') 
   {  
      return Math.ceil((datEndDate.getTime() - datStartDate.getTime()) / 1000);  
   } 
   else
   { 
      return Math.ceil(datEndDate.getTime() - datStartDate.getTime());  
   } 
}
//-->