natDays = [
      [1, 1, 2011], [1, 1, 2012], [1, 1, 2013], [1, 1, 2014], [1, 1, 2015], [1, 1, 2016], [1, 1, 2017], [1, 1, 2018], // Neujahr
      [6, 1, 2011], [6, 1, 2012], [6, 1, 2013], [6, 1, 2014], [6, 1, 2015], [6, 1, 2016], [6, 1, 2017], [6, 1, 2018], // Dreikönig
      [22, 4, 2011], [6, 4, 2012], [29, 3, 2013], [18, 4, 2014], [3, 4, 2015], [25, 3, 2016], [14, 4, 2017], [30, 3, 2018], // Karfreitag (Variabel)
      [25, 4, 2011], [9, 4, 2012], [1, 4, 2013], [21, 4, 2014], [6, 4, 2015], [28, 3, 2016], [17, 4, 2017], [2, 4, 2018], // Ostermonat (Variabel)
      [1, 5, 2011], [1, 5, 2012], [1, 5, 2013], [1, 5, 2014], [1, 5, 2015], [1, 5, 2016], [1, 5, 2017], [1, 5, 2018], // Tag der Arbeit
      [2, 6, 2011], [17, 6, 2012], [9, 5, 2013], [29, 5, 2014], [14, 5, 2015], [5, 5, 2016], [25, 5, 2017], [10, 5, 2018], // Christi Himmerlfahrt (Variabel)
      [13, 6, 2011], [28, 6, 2012], [20, 5, 2013], [9, 6, 2014], [25, 5, 2015], [16, 5, 2016], [5, 6, 2017], [21, 5, 2018], // Pfingstmontag (Variabel)
      [23, 6, 2011], [7, 6, 2012], [30, 5, 2013], [19, 6, 2014], [4, 6, 2015], [26, 5, 2016], [15, 6, 2017], [31, 5, 2018], // Fronleichnam (Variabel)
      [3, 10, 2011], [3, 10, 2012], [3, 10, 2013], [3, 10, 2014], [3, 10, 2015], [3, 10, 2016], [3, 10, 2017], [3, 10, 2018], // Tag der Deutschen Einheit
      [1, 11, 2011], [1, 11, 2012], [1, 11, 2013], [1, 11, 2014], [1, 11, 2015], [1, 11, 2016], [1, 11, 2017], [1, 11, 2018], // Allerheiligen
      [24, 12, 2011], [24, 12, 2012], [24, 12, 2013], [24, 12, 2014], [24, 12, 2015], [24, 12, 2016], [24, 12, 2017], [24, 12, 2018], // Heiliger Abend
      [25, 12, 2011], [25, 12, 2012], [25, 12, 2013], [25, 12, 2014], [25, 12, 2015], [25, 12, 2016], [25, 12, 2017], [25, 12, 2018], // Erster Weihnachtsfeiertag
      [26, 12, 2011], [26, 12, 2012], [26, 12, 2013], [26, 12, 2014], [26, 12, 2015], [26, 12, 2016], [26, 12, 2017], [26, 12, 2018], // Zweiter Weihnachtsfeiertag
      [31, 12, 2011], [31, 12, 2012], [31, 12, 2013], [31, 12, 2014], [31, 12, 2015], [31, 12, 2016], [31, 12, 2017], [31, 12, 2018] // Silvester
          ];

function noWeekends(date)
{
		var day = date.getDay();

                if (day == 0 || day == 6)
		{
                        return [false, 'daydis'];
                }
                else
                {
                        return [true, 'dayena'];
                }
}
function noSundays(date)
{
		var day = date.getDay();

                if (day == 0)
		{
                        return [false, 'daydis'];
                }
                else
                {
                        return [true, 'dayena'];
                }
}

function nationalDays(date)
{
    for (i = 0; i < natDays.length; i++) 
    {
      if (date.getMonth() == natDays[i][1] - 1
          && date.getDate() == natDays[i][0]
          && date.getFullYear() == natDays[i][2])
      {
                return [false, 'daydis'];
      }
    }
  return [true, 'dayena'];
}


function noWeekendsOrHolidays(date) 
{
    var noWeekend = noWeekends(date);
    if (noWeekend[0]) {
        return nationalDays(date);
    } else {
        return noWeekend;
    }
}
function noSundayOrHolidays(date)
{
    var noSunday= noSundays(date);
    if (noSunday[0]) {
        return nationalDays(date);
    } else {
        return noSundays(date);
    }
}
