
   // taegliches Datum als Inlude Datei, die vom CMS einmal pro Tag erzeugt wird...
   // heute ist der 10.02.2012 ....
   // morgen... 11.02.2012

   function ProgTippDailyStr(D,j,n,Y) {

      var returnStr =j+'.'+n+'.'; //normales Datum

      if (D!="") {
         returnStr  =D+', '+j+'.'+n+'.'; //normales Datum
      }

      if (wasInPast(j,n,Y) || Y != 2012) {
        return j+'.'+n+'.'+Y;
      }

      if (isToday(j,n,Y)) {
         returnStr = 'Heute';
      }


      if ((11 == j) && (2 == n) && (2012 == Y)) {
         returnStr = 'Morgen';
      }

      return returnStr;
   }

   function extendedProgTippDailyStr(D,j,n,Y,sh,sm,eh,em) {

      if (wasInPast(j,n,Y)) {
        return j+'.'+n+'.'+Y;
      }
   
      if (isToday(j,n,Y)) {
         if (isBetweenStartAndEndTime(sh,sm,eh,em)) {
            return 'Jetzt';
         }
      }
   
      return ProgTippDailyStr(D,j,n,Y);
   }

   function wasInPast(j,n,Y) {
      if (Y < 2012) {
         return true;
      }
      if (Y > 2012) {
         return false;
      }
      if (n < 2) {
         return true;
      }
      if (n > 2) {
         return false;
      }
      return 10 > j;
   }

   function isToday(j,n,Y) {
      return (10 == j) && (2 == n) && (2012 == Y);
   }

   function isBetweenStartAndEndTime(sh,sm,eh,em) {
      
         
         
            var date = new Date();
         
      
      var start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), sh, sm, 0);
      var end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), eh, em, 0);
      if (sh > eh) {
         end = end.setDay(end.getDay() + 1);
      }
      return start<=date && date<=end;
   }

