<?php
/* $Id: holidays.us.inc.php,v 1.3 2003/10/02 16:56:05 k-fish Exp $ */

if (date("dm", $date) == "0101") $holiday = Lang::getLanguageString("newyear");	
elseif (date("dm", $date) == "0407") $holiday = Lang::getLanguageString("independenceday");	
elseif (date("dm", $date) == "1210") $holiday = Lang::getLanguageString("columbusday");	
elseif (date("dm", $date) == "1111") $holiday = Lang::getLanguageString("veteransday");	
elseif (date("dm", $date) == "2412") $holiday = Lang::getLanguageString("holychristmas");
elseif (date("dm", $date) == "2512") $holiday = Lang::getLanguageString("firstchristmas");
elseif (date("dm", $date) == "2612") $holiday = Lang::getLanguageString("secondchristmas");
else {
    // thanksgiving
    $tmp = getdate($date);
    $fnov = date("w", mktime( 0, 0, 0, 11, 1, $tmp["year"]));
    if ($fnov > 4) $thgiv = mktime( 0, 0, 0, 11, 1, $tmp["year"]) + ( 22 + $fnov) * 3600 * 24;
    else $thgiv = mktime( 0, 0, 0, 11, 1, $tmp["year"]) + ( 25 - $fnov) * 3600 * 24;

    // martin luther king day (3th Monday in January)
    $fjan = date("w", mktime( 0, 0, 0, 1, 1, $tmp["year"]));
    if ($fjan > 1) $mlkd = mktime( 0, 0, 0, 1, 1, $tmp["year"]) + ( 22 - $fjan) * 3600 * 24;
    elseif ($fjan == 0) $mlkd = mktime( 0, 0, 0, 1, 1, $tmp["year"]) +  15 * 3600 * 24;
    else $mlkd = mktime( 0, 0, 0, 1, 1, $tmp["year"]) +  14 * 3600 * 24;

    // presidents day (3th Monday in february)
    $ffeb = date("w", mktime( 0, 0, 0, 2, 1, $tmp["year"]));
    if ($ffeb > 1) $pred = mktime( 0, 0, 0, 2, 1, $tmp["year"]) + ( 22 - $ffeb) * 3600 * 24;
    elseif ($ffeb == 0) $pred = mktime( 0, 0, 0, 2, 1, $tmp["year"]) +  15 * 3600 * 24;
    else $pred = mktime( 0, 0, 0, 2, 1, $tmp["year"]) +  14 * 3600 * 24;

    // memorial day (last Monday in May)
    $fmay = date("w", mktime( 0, 0, 0, 5, 31, $tmp["year"]));
    if ($fmay == 0) $fmay = 7;
    $memd = mktime( 0, 0, 0, 5, 31, $tmp["year"]) - ($fmay - 1) * 3600 * 24;

    // labour day (first Monday in September)
    $fsep = date("w", mktime( 0, 0, 0, 9, 1, $tmp["year"]));
    if ($fsep > 1) $labd = mktime( 0, 0, 0, 9, 1, $tmp["year"]) + (8 - $fsep) * 3600 * 24;
    elseif ($fsep == 0) $labd = mktime( 0, 0, 0, 9, 1, $tmp["year"]) +  3600 * 24;
    else $labd = mktime( 0, 0, 0, 9, 1, $tmp["year"]);

    if (date("dmY", $date) == date("dmY", $easter-3600*24*2 )) 	$holiday = Lang::getLanguageString("easterfriday");
    elseif (date("dmY", $date) == date("dmY", $easter)) 	        $holiday = Lang::getLanguageString("eastersunday");
    elseif (date("dmY", $date) == date("dmY", $easter+3600*24   )) $holiday = Lang::getLanguageString("eastermonday"); 
    elseif (date("dmY", $date) == date("dmY", $thgiv)) 		$holiday = Lang::getLanguageString("thanksgiving"); 
    elseif (date("dmY", $date) == date("dmY", $mlkd)) 		$holiday = Lang::getLanguageString("mlkingday"); 
    elseif (date("dmY", $date) == date("dmY", $pred)) 		$holiday = Lang::getLanguageString("presidentsday"); 
    elseif (date("dmY", $date) == date("dmY", $labd)) 		$holiday = Lang::getLanguageString("labourday"); 
    elseif (date("dmY", $date) == date("dmY", $memd)) 		$holiday = Lang::getLanguageString("memorialday"); 
    else $holiday = "";
}	
?>