function calclstWkdy (wkdy,lstofmody) {	//returns the date for the first dy in the month
	d = 8-(lstofmody<=wkdy?lstofmody+(7-wkdy):lstofmody-(7-(7-wkdy)));
	return d;
}
function calcEndWkdy (wkdy,endofmody,dysinmo) {	//returns the date for the last dy in the month
	d = (endofmody>=wkdy?dysinmo-(endofmody-wkdy):dysinmo-(7-(wkdy-endofmody)));
	return d;
}

/****************************************************
 * Hebrew Calculator                                *
 * http://www.geocities.com/DafAWeek                *
 ****************************************************/

  // This function returns how many months there has been from the
  // first Molad until the beginning of the year nYearH
  function MonSinceFirstMolad(nYearH) {
    var nMonSinceFirstMolad

    // A shortcut to this function can simply be the following formula
    //   return Math.floor(((235 * nYearH) - 234) / 19)
    // This formula is found in Remy Landau's website and he
    // attributes it to Wolfgang Alexander Shochen. I will use a less
    // optimized function which I believe shows the underlying logic
    // better.

    // count how many months there has been in all years up to last
    // year. The months of this year hasn't happened yet.
    nYearH --

    // In the 19 year cycle, there will always be 235 months. That
    // would be 19 years times 12 months plus 7 extra month for the
    // leap years. (19 * 12) + 7 = 235.

    // Get how many 19 year cycles there has been and multiply it by
    // 235
    nMonSinceFirstMolad = Math.floor(nYearH / 19) * 235
    // Get the remaining years after the last complete 19 year cycle
    nYearH = nYearH % 19
    // Add 12 months for each of those years
    nMonSinceFirstMolad += 12 * nYearH
    // Add the extra months to account for the leap years
    if (nYearH >= 17) {
      nMonSinceFirstMolad += 6
    } else if  (nYearH >= 14) {
      nMonSinceFirstMolad += 5
    } else if  (nYearH >= 11) {
      nMonSinceFirstMolad += 4
    } else if  (nYearH >= 8) {
      nMonSinceFirstMolad += 3
    } else if  (nYearH >= 6) {
      nMonSinceFirstMolad += 2
    } else if  (nYearH >= 3) {
      nMonSinceFirstMolad += 1
    }
    return nMonSinceFirstMolad
  }

  // This function returns if a given year is a leap year.
  function IsLeapYear(nYearH) {
     var nYearInCycle

    // Find out which year we are within the cycle.  The 19th year of
    // the cycle will return 0
    nYearInCycle = nYearH % 19
    return ( nYearInCycle ==  3 ||
             nYearInCycle ==  6 ||
             nYearInCycle ==  8 ||
             nYearInCycle == 11 ||
             nYearInCycle == 14 ||
             nYearInCycle == 17 ||
             nYearInCycle == 0)
  }

  // This function figures out the Gregorian Date that corresponds to
  // the first day of Tishrei, the first month of the Hebrew
  // calendar, for a given Hebrew year.
  function Tishrei1(nYearH) {
    var nMonthsSinceFirstMolad
    var nChalakim
    var nHours
    var nDays
    var nDayOfWeek
    var dTishrei1

    // We want to calculate how many days, hours and chalakim it has
    // been from the time of 0 days, 0 hours and 0 chalakim to the
    // molad at the beginning of year nYearH.
    //
    // The period between one new moon to the next is 29 days, 12
    // hours and 793 chalakim. We must multiply that by the amount
    // of months that transpired since the first molad. Then we add
    // the time of the first molad (Monday, 5 hours and 204 chalakim)
    nMonthsSinceFirstMolad = MonSinceFirstMolad(nYearH)
    nChalakim = 793 * nMonthsSinceFirstMolad
    nChalakim += 204
    // carry the excess Chalakim over to the hours
    nHours = Math.floor(nChalakim / 1080)
    nChalakim = nChalakim % 1080

    nHours += nMonthsSinceFirstMolad * 12
    nHours += 5

    // carry the excess hours over to the days
    nDays = Math.floor(nHours / 24)
    nHours = nHours % 24

    nDays += 29 * nMonthsSinceFirstMolad
    nDays += 2

    // figure out which day of the week the molad occurs.
    // Sunday = 1, Moday = 2 ..., Shabbos = 0
    nDayOfWeek = nDays % 7

    // In a perfect world, Rosh Hashanah would be on the day of the
    // molad. The Hebrew calendar makes four exceptions where we
    // push off Rosh Hashanah one or two days. This is done to
    // prevent three situation. Without explaining why, the three
    // situations are:
    //   1) We don't want Rosh Hashanah to come out on Sunday,
    //      Wednesday or Friday
    //   2) We don't want Rosh Hashanah to be on the day of the
    //      molad if the molad occurs after the beginning of 18th
    //      hour.
    //   3) We want to limit years to specific lengths.  For non-leap
    //      years, we limit it to either 353, 354 or 355 days.  For
    //      leap years, we limit it to either 383, 384 or 385 days.
    //      If setting Rosh Hashanah to the day of the molad will
    //      cause this year, or the previous year to fall outside
    //      these lengths, we push off Rosh Hashanah to get the year
    //      back to a valid length.
    // This code handles these exceptions.
    if (!IsLeapYear(nYearH) &&
        nDayOfWeek == 3 &&
        (nHours * 1080) + nChalakim >= (9 * 1080) + 204) {
      // This prevents the year from being 356 days. We have to push
      // Rosh Hashanah off two days because if we pushed it off only
      // one day, Rosh Hashanah would comes out on a Wednesday. Check
      // the Hebrew year 5745 for an example.
      nDayOfWeek = 5
      nDays += 2
    }
    else if ( IsLeapYear(nYearH - 1) &&
              nDayOfWeek == 2 &&
              (nHours * 1080) + nChalakim >= (15 * 1080) + 589 ) {
      // This prevents the previous year from being 382 days. Check
      // the Hebrew Year 5766 for an example. If Rosh Hashanah was not
      // pushed off a day then 5765 would be 382 days
      nDayOfWeek = 3
      nDays += 1
    }
    else {
      // see rule 2 above. Check the Hebrew year 5765 for an example
      if (nHours >= 18) {
        nDayOfWeek += 1
        nDayOfWeek = nDayOfWeek % 7
        nDays += 1
      }
      // see rule 1 above. Check the Hebrew year 5765 for an example
      if (nDayOfWeek == 1 ||
          nDayOfWeek == 4 ||
          nDayOfWeek == 6) {
        nDayOfWeek += 1
        nDayOfWeek = nDayOfWeek % 7
        nDays += 1
      }
    }

    // Here we want to add nDays to creation
    //    dTishrie1 = creation + nDays
    // Unfortunately, Many languages do not handle negative years very
    // well. I therefore picked a Random date (1/1/1900) and figured out
    // how many days it is after the creation (2067025). Then I
    // subtracted 2067025 from nDays.
    nDays -= 2067025
    dTishrei1 = new Date(1900, 0, 1) // 2067025 days after creation
    dTishrei1.setDate(dTishrei1.getDate() + nDays)

    return dTishrei1
   }


  // This function gets the length of a Hebrew year.
  function LengthOfYear(nYearH) {
    var dThisTishrei1
    var dNextTishrei1
    var diff

    // subtract the date of this year from the date of next year
    dThisTishrei1 = Tishrei1(nYearH)
    dNextTishrei1 = Tishrei1(nYearH + 1)
    // Java's dates are stored in milliseconds. To convert it into days
    // we have to divide it by 1000 * 60 * 60 * 24
    diff = (dNextTishrei1 - dThisTishrei1) / ( 1000 * 60 * 60 * 24)
    return Math.round(diff)
  }

  // This function converts a Hebrew date into the Gregorian date
  // nYearH - is the Hebrew year
  // nMonth - Tishrei=1
  //          Cheshvan=2
  //          Kislev=3
  //          Teves=4
  //          Shevat=5
  //          Adar A=6 (only valid on leap years)
  //          Adar=7   (Adar B for leap years)
  //          Nisan=8
  //          Iyar=9
  //          Sivan=10
  //          Tamuz=11
  //          Av=12
  //          Elul=13
  function HebToGreg(nYearH, nMonthH, nDateH) {
    var nLengthOfYear
    var bLeap
    var dGreg
    var nMonth
    var nMonthLen
    var bHaser
    var bShalem

    bLeap = IsLeapYear(nYearH)
    nLengthOfYear = LengthOfYear(nYearH)

    // The regular length of a non-leap year is 354 days.
    // The regular length of a leap year is 384 days.
    // On regular years, the length of the months are as follows
    //   Tishrei (1)   30
    //   Cheshvan(2)   29
    //   Kislev  (3)   30
    //   Teves   (4)   29
    //   Shevat  (5)   30
    //   Adar A  (6)   30     (only valid on leap years)
    //   Adar    (7)   29     (Adar B for leap years)
    //   Nisan   (8)   30
    //   Iyar    (9)   29
    //   Sivan   (10)  30
    //   Tamuz   (11)  29
    //   Av      (12)  30
    //   Elul    (13)  29
    // If the year is shorter by one less day, it is called a haser
    // year. Kislev on a haser year has 29 days. If the year is longer
    // by one day, it is called a shalem year. Cheshvan on a shalem
    // year is 30 days.

    bHaser = (nLengthOfYear == 353 || nLengthOfYear == 383)
    bShalem = (nLengthOfYear == 355 || nLengthOfYear == 385)

    // get the date for Tishrei 1
    dGreg = Tishrei1(nYearH)

    // Now count up days within the year
    for (nMonth = 1; nMonth <= nMonthH - 1; nMonth ++) {
      if (nMonth == 1 ||
          nMonth == 5 ||
          nMonth == 8 ||
          nMonth == 10 ||
          nMonth == 12 ) {
        nMonthLen = 30
      } else if (nMonth == 4 ||
                 nMonth == 7 ||
                 nMonth == 9 ||
                 nMonth == 11 ||
                 nMonth == 13 ) {
          nMonthLen = 29
      } else if (nMonth == 6) {
          nMonthLen = (bLeap ? 30 : 0)
      } else if (nMonth == 2) {
          nMonthLen = (bShalem ? 30 : 29)
      } else if (nMonth == 3) {
          nMonthLen = (bHaser ? 29 : 30 )
      }
      dGreg.setDate(dGreg.getDate() + nMonthLen)
    }
    dGreg.setDate(dGreg.getDate() + nDateH - 1)
    return dGreg
  }

/****************************************************
 * Easter Calculator                                *
 * Unobtrusive JavaScripts                          *
 * copyright Stephen Chapman http://www.felgall.com *
 * March 2007                                       *
 *                                                  *
 * You may use this script provided that you        *
 * include this copyright notice with the code.     *
 ****************************************************/

var easterM = ['3','4'];
function easter(y) {
var year = y;
var a = year % 19;
var b = Math.floor(year/100);
var c = year % 100;
var d = Math.floor(b/4);
var e = b % 4;
var f = Math.floor((b+8) / 25);
var g = Math.floor((b-f+1) / 3);
var h = (19*a + b - d - g + 15) % 30;
var i = Math.floor(c/4);
var j = c % 4;
var k = (32 + 2*e + 2*i - h - j) % 7;
var m = Math.floor((a + 11*h + 22*k) / 451);
var month = Math.floor((h + k - 7*m + 114) / 31);
var day = ((h + k - 7*m +114) % 31) + 1;
return easterM[month-3] + '-' + day;
}

/****************************************************
 * Islamic Calculator                               *
 * http://www.oriold.uzh.ch/static/hegira.html      *
 * site copyright J. Thomann 1996                   *
 ****************************************************/
function intPart(floatNum){
if (floatNum< -0.0000001){
	 return Math.ceil(floatNum-0.0000001)
	}
return Math.floor(floatNum+0.0000001)	
}
function chrToIsl(d,m,y) {
	if ((y>1582)||((y==1582)&&(m>10))||((y==1582)&&(m==10)&&(d>14))) 
		{
		jd=intPart((1461*(y+4800+intPart((m-14)/12)))/4)+intPart((367*(m-2-12*(intPart((m-14)/12))))/12)-intPart( (3* (intPart(  (y+4900+    intPart( (m-14)/12)     )/100)    )   ) /4)+d-32075
		}
	else
		{
		jd = 367*y-intPart((7*(y+5001+intPart((m-9)/7)))/4)+intPart((275*m)/9)+d+1729777
		}
	l=jd-1948440+10632
	n=intPart((l-1)/10631)
	l=l-10631*n+354
	j=(intPart((10985-l)/5316))*(intPart((50*l)/17719))+(intPart(l/5670))*(intPart((43*l)/15238))
	l=l-(intPart((30-j)/15))*(intPart((17719*j)/50))-(intPart(j/16))*(intPart((15238*j)/43))+29
	m=intPart((24*l)/709)
	d=l-intPart((709*m)/24)
	y=30*n+j-30

	arr_d = new Array(d,m,y);
	return arr_d;

}
function islToChr(d,m,y) {
	jd=intPart((11*y+3)/30)+354*y+30*m-intPart((m-1)/2)+d+1948440-385
	if (jd> 2299160 )
		{
		l=jd+68569
		n=intPart((4*l)/146097)
		l=l-intPart((146097*n+3)/4)
		i=intPart((4000*(l+1))/1461001)
		l=l-intPart((1461*i)/4)+31
		j=intPart((80*l)/2447)
		d=l-intPart((2447*j)/80)
		l=intPart(j/11)
		m=j+2-12*l
		y=100*(n-49)+i+l
		}	
	else	
		{
		j=jd+1402
		k=intPart((j-1)/1461)
		l=j-1461*k
		n=intPart((l-1)/365)-intPart(l/1461)
		i=l-365*n+30
		j=intPart((80*i)/2447)
		d=i-intPart((2447*j)/80)
		i=intPart(j/11)
		m=j+2-12*i
		y=4*k+n+i-4716
		}
	id = new Date(y,m-1,d);
	return id;
}


/****************************************************
 * Get Holidays                                     *
 * copyright Garth Engwall 2009                     *
 *                                                  *
 *                                                  *
 *                                                  *
 *                                                  *
 *                                                  *
 ****************************************************/

function getHolidays(y,m,w) {

dd = new Date(y,m-1,1);
dy = dd.getDay();
dd.setMonth(m);
dd.setDate(0);
ld = dd.getDate();
ldy = dd.getDay();
lpyr = (Math.floor(y/4)==(y/4));

hol_str = '';

//floating dates

//Christian
arr_easter = easter(y).split('-');
ed = new Date(y,arr_easter[0]-1,arr_easter[1]);
aw = new Date(ed.getYear(), ed.getMonth(), ed.getDate()-0-46);
arr_ashwed = new Array(aw.getMonth()+1,aw.getDate());

//Jewish
jw = HebToGreg(y-1900-1+5661, 8, 15);
arr_passover = new Array(jw.getMonth()+1,jw.getDate());
jw = Tishrei1(y-1900+5661);
arr_rosh = new Array(jw.getMonth()+1,jw.getDate());
jw = new Date(jw.getYear(), jw.getMonth(), jw.getDate()-0+9);
arr_kippur = new Array(jw.getMonth()+1,jw.getDate());
jw = HebToGreg(y-1900+5661, 3, 25);
arr_han = new Array(jw.getMonth()+1,jw.getDate());

//Islamic
//first get the Islamic year for the month. Will use 1st of month
//so that the correct Islamic year is represented
isl_yr = chrToIsl(1,m*1,y*1)[2];
isl = islToChr(1,9,isl_yr);
arr_ram = new Array(isl.getMonth()+1,isl.getDate())
isl = islToChr(1,10,isl_yr);
isl = new Date(isl.getYear(), isl.getMonth(), isl.getDate()-0-1);
arr_fitr = new Array(isl.getMonth()+1,isl.getDate())
isl = islToChr(9,12,isl_yr)
arr_adha = new Array(isl.getMonth()+1,isl.getDate())

//January
if ( m==1 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	hol_str = hol_str + '1!New Years Day' + '|';				//Jan 1st
	d = calclstWkdy(1,dy)+14;						//calc for Mon hol
	hol_str = hol_str + d + '!Martin Luther King Day' + '|';		//3rd Mon in Jan
	if ((y/4)-Math.floor(y/4)==.25) {					//calc prior lp yr
		chkdy = new Date(y,m,20).getDay();
		d = (chkdy==0?21:20);
		hol_str = hol_str + d + '!Inauguration Day' + '|';		//Jan 20th after election (21st if 20th is Sun)
	}
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {

}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {

}
//Islamic Holidays - holiday id = 'RLI'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//February
if ( m==2 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	d = calclstWkdy(1,dy)+14;						//calc for Mon hol
	hol_str = hol_str + d + '!Washington\'s Birthday' + '|';		//3rd Mon in Feb
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	hol_str = hol_str + '2!Groundhog Day' + '|';				//Feb 2nd
	hol_str = hol_str + '14!Valentine\'s Day' + '|';			//Feb 14th
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {
	if (arr_ashwed[0]==2) {
		hol_str = hol_str + arr_ashwed[1] + '!Ash Wednesday' + '|';	//46 days prior to Easter
	}
}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {

}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//March
if ( m==3 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {

}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	hol_str = hol_str + '17!St. Patrick\'s Day' + '|';			//Mar 17th
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {
	if (arr_ashwed[0]==3) {
		hol_str = hol_str + arr_ashwed[1] + '!Ash Wednesday' + '|';	//46 days prior to Easter
	}
	if (arr_easter[0]==3 || (arr_easter[0]==4 && arr_easter[1]<=7)) {
		hol_str = hol_str + (arr_easter[0]==3?(arr_easter[1].valueOf()-7):(24+(arr_easter[1].valueOf()*1))) + '!Palm Sunday' + '|';
										//Sun prior to Easter
	}
	if (arr_easter[0]==3 || (arr_easter[0]==4 && arr_easter[1]<=2)) {
		hol_str = hol_str + (arr_easter[0]==3?(arr_easter[1].valueOf()-2):(29+(arr_easter[1].valueOf()*1))) + '!Good Friday' + '|';
										//Fri prior to Easter
	}
	if (arr_easter[0]==m) {
		hol_str = hol_str + arr_easter[1] + '!Easter' + '|';		//1st Sun after the 1st eccles full moon after the vernal equinox		
	}
}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_passover[0]==3) {
		hol_str = hol_str + arr_passover[1] + '!Passover' + '|';	//15 Nisan
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//April
if ( m==4 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {

}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	hol_str = hol_str + '1!April Fools\' Day' + '|';			//Apr 1st
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {
	if (arr_easter[0]==4 && arr_easter[1]>2) {
		hol_str = hol_str + (arr_easter[1].valueOf()-7) + '!Palm Sunday' + '|';
										//Sun prior to Easter
	}
	if (arr_easter[0]==4 && arr_easter[1]>2) {
		hol_str = hol_str + (arr_easter[1].valueOf()-2) + '!Good Friday' + '|';
										//Fri prior to Easter
	}
	if (arr_easter[0]==m) {
		hol_str = hol_str + arr_easter[1] + '!Easter' + '|';		//1st Sun after the 1st eccles full moon after the vernal equinox		
	}
}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_passover[0]==4) {
		hol_str = hol_str + arr_passover[1] + '!Passover' + '|';	//15 Nisan
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//May
if ( m==5 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	d = calcEndWkdy(1,ldy,ld);						//calc for Mon hol
	hol_str = hol_str + d + '!Memorial Day' + '|';				//Last Monday in May
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	hol_str = hol_str + '5!Cinco De Mayo' + '|';				//May 5th
	d = calclstWkdy(0,dy)+7;						//calc for Sun hol
	hol_str = hol_str + d + '!Mother\'s Day' + '|';				//2nd Sun in May
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_passover[0]==5) {
		hol_str = hol_str + arr_passover[1] + '!Passover' + '|';	//15 Nisan
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//June
if ( m==6 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {

}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	d = calclstWkdy(0,dy)+14;						//calc for Sun hol
	hol_str = hol_str + d + '!Father\'s Day' + '|';				//2rd Sun in Jun
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {

}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//July
if ( m==7 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	hol_str = hol_str + '4!Independence Day' + '|';				//July 4th
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {

}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {

}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//August
if ( m==8 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {

}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {

}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {

}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//September
if ( m==9 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	d = calclstWkdy(1,dy);							//calc for Mon hol
	hol_str = hol_str + d + '!Labor Day' + '|';				//1st Mon in Sep
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	//hol_str = hol_str + '9!Test Holiday' + '|';				//test
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_rosh[0]==9) {
		hol_str = hol_str + arr_rosh[1] + '!Rosh Hashanah' + '|';	//1 Tishrei
	}
	if (arr_kippur[0]==9) {
		hol_str = hol_str + arr_kippur[1] + '!Yom Kippur' + '|';	//10 Tishrei
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//October
if ( m==10 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	d = calclstWkdy(1,dy)+7;						//calc for Mon hol
	hol_str = hol_str + d + '!Columbus Day' + '|';				//2nd Mon in Oct
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	hol_str = hol_str + '31!Halloween' + '|';				//Oct 31st
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_rosh[0]==10) {
		hol_str = hol_str + arr_rosh[1] + '!Rosh Hashanah' + '|';	//1 Tishrei
	}
	if (arr_kippur[0]==10) {
		hol_str = hol_str + arr_kippur[1] + '!Yom Kippur' + '|';	//10 Tishrei
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//November
if ( m==11 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	hol_str = hol_str + '11!Veterans Day' + '|';				//Nov 11th
	d = calclstWkdy(4,dy)+21;						//calc for Thu hol
	hol_str = hol_str + d + '!Thanksgiving Day' + '|';			//4th Thu in Nov
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	if ( lpyr ) {
		d = calclstWkdy(1,dy)+1;					//calc for Mon hol
		hol_str = hol_str + d + '!Election Day' + '|';			//1st Tue following 1st Mon in Nov
	}
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {

}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_han[0]==11) {
		hol_str = hol_str + arr_han[1] + '!Hanukkah' + '|';		//25 Kislev
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}
//December
if ( m==12 ) {
//Official US Holidays - holiday id = 'OUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('OUS',0)>=0 ) {
	if ( w.indexOf('RLC',0)==-1 ) {
		hol_str = hol_str + '25!Christmas Day' + '|';			//Dec 25th
	}
}
//Secular Traditional US Holidays - holiday id = 'SUS'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('SUS',0)>=0 ) {
	hol_str = hol_str + '7!Pearl Harbor Day' + '|';				//Dec 7th
	hol_str = hol_str + '24!Christmas Eve' + '|';				//Dec 24th
	hol_str = hol_str + '26!Start of Kwanzaa' + '|';			//Dec 26th
	hol_str = hol_str + '31!New Year\'s Eve' + '|';				//Dec 31st
}
//Christian Holidays - holiday id = 'RLC'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLC',0)>=0 ) {
	if ( w.indexOf('ALL',0)==-1 ) {
		hol_str = hol_str + '25!Christmas Day' + '|';			//Dec 25th
	}
}
//Jewish Holidays - holiday id = 'RLJ'
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLJ',0)>=0 ) {
	if (arr_han[0]==12) {
		hol_str = hol_str + arr_han[1] + '!Hanukkah' + '|';		//25 Kislev
	}
}
if ( w.indexOf('ALL',0)>=0 || w.indexOf('RLI',0)>=0 ) {
	if (arr_ram[0]==m) {
		hol_str = hol_str + arr_ram[1] + '!Start of Ramadan' + '|';	//1 Ramadan
	}
	if (arr_fitr[0]==m) {
		hol_str = hol_str + arr_fitr[1] + '!Eid-al-Fitr (apx)' + '|';	//End of Ramadan
	}
	if (arr_adha[0]==m) {
		hol_str = hol_str + arr_adha[1] + '!Eid-al-Adha (apx)' + '|';	//10th of Dhul Hijja
	}
}
}

hol_str = (hol_str.length>=1?hol_str.substr(0,hol_str.length-1):'');
return hol_str;

}

