  //////////////////////////////////////////////////////////////////////
  function dateIsObligation(date) {
    if (date.getDay()==0) return true;

    var inf = SPECIAL_DAYS[date.print("%m%d")];
    if (inf && ((inf.indexOf('Obligation') >-1) || (inf.indexOf('Solemnity') >-1))) {
      return true;
    }
    getEaster(date.print("%Y"));
    var foundIt = false;
    for( var i = 0; i<EdateInfo.length; i++ ) {
        if (EdateInfo[i]==date.print("%m%d")) {
          foundIt = true;
        }
        i++;
    }
    if (foundIt) return true;
    return false;
  };

  function dateIsSpecial(date) {
    if (dateIsObligation(date)) return true;

	if (self.dateInfo) {
		var inf = dateInfo[date.print("%Y%m%d")];
		if (inf) {
		  return true;
		}
	}

    return false;
  };

  function ourDateStatusFunc(date, y, m, d) {
    if (dateIsSpecial(date))
      return "special";
    else
      return false;
  };

    function onUpdateTextStripped(date) {
        getEaster(date.print("%Y"));
        var textStr = ""
        for( var i = 0; i<EdateInfo.length; i++ ) {
            if (EdateInfo[i]==date.print("%m%d")) {
              textStr = textStr+'<br><br><font size="2"><b>'+EdateInfo[i+1]+'</b></font>';
              i = EdateInfo.length;
            }
            i++;
        }

		if (self.dateInfo) {
			inf = dateInfo[date.print("%Y%m%d")];
			if (inf) {
				textStr = textStr+'<br><br><i><font color="#D7A373" size="2"><b>'+inf+'</b></font></i>';
			}
		}

        inf = SPECIAL_DAYS[date.print("%m%d")];
        if (inf) {
            textStr = textStr+'<br><br><font color="#F4AB6D">'+inf+'</font></b>';
        }
        if (dateIsObligation(date)) {
            textStr = textStr+'<br><br>Find <a href="http://www.masstimes.org">time and location</a> for Mass anywhere in US<br>Please note that often, feast days are moved to Sundays.  See <a href="http://www.usccb.org/liturgy/q&a/general/obligation.shtml">USCCB Website</a>';
        }

        return textStr
    };
    
    function onUpdateText(date, obj) {
        var textStr = onUpdateTextStripped(date, obj);
        if (textStr.length==0) {
            textStr = textStr+'<br><br>No Events found';
        }
        obj.innerHTML = textStr;
    };
    function onUpdateUpcomingEvents(curdate, obj) {
        var textStr = '<br><font size="2"><b><a id="xnextweek" href="javascript:Toggle(\'nextweek\');"><img src="/images/textfolder.gif"/></a><a href="javascript:Toggle(\'nextweek\');">Upcoming Events...</a></b></font><font size="1"><br><div id="nextweek">';
        var brkStr = ""
        var date = new Date();
        for( var incr = 1; incr < 8; incr++) {
            var tempStr = "";
            date.setMonth(curdate.getMonth());
            date.setDate(curdate.getDate() +incr);

            for( var i = 0; i<EdateInfo.length; i++ ) {
                if (EdateInfo[i]==date.print("%m%d")) {
                  tempStr = tempStr+'<font size="2"><b>'+EdateInfo[i+1]+'</b></font>';
                  i = EdateInfo.length;
                  brkStr = "<br>";
                }
                i++;
            }

			if (self.dateInfo) {
				inf = dateInfo[date.print("%Y%m%d")];
				if (inf) {
					tempStr = tempStr+brkStr+'<i><font color="#D7A373" size="2"><b>'+inf+'</b></font></i>';
					brkStr = "<br>";
				}
			}

            inf = SPECIAL_DAYS[date.print("%m%d")];
            if (inf) {
                tempStr = tempStr+brkStr+'<font color="#F4AB6D">'+inf+'</font></b>';
                brkStr = "<br>";
            }
            if (tempStr.length==0) {
                tempStr = 'No Events found';
            }
            tempStr = date.print("%A, %B %e")+' '+tempStr+'<br>';
            brkStr = ""
            textStr = textStr + tempStr;
        }
        textStr = textStr + '</font></div>';
        obj.innerHTML = textStr;
    };

    function onUpdateLocal(cal) {
        obj=document.getElementById('caltext');
            onUpdateText(cal.date, obj)
    };

  function flatCallback(cal) {
    if (cal.dateClicked) {
      if (dateIsSpecial(cal.date)) {
        onUpdateLocal(cal);
      }
    }
  };


//change the text below to reflect your own,

function countdown(){
    var yr=2007;
    var m=01;
    var d=01;
	var current=""
	var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	var today=new Date()
	var before=""
	var futurestring=""
	var difference=0
//-------------------------------------------------        
    yr=2008;
    m=04;
    d=12;
	before="Women's CRHP Weekend"
	current=before+" is Here!<br><br>"
	futurestring=montharray[m-1]+" "+d+", "+yr
	difference=(Math.ceil((Date.parse(futurestring)-today)/(24*60*60*1000))*1)
	if (difference==0)
		document.write(current)
	else if (difference>0 && difference<150)
		document.write("Only "+difference+" days until "+before+"!<br><br>")
                
    yr=2008;
    m=04;
    d=19;
    futurestring=montharray[m-1]+" "+d+", "+yr
	before="Men's CRHP Weekend"
	current=before+" is Here!"
	difference=(Math.ceil((Date.parse(futurestring)-today)/(24*60*60*1000))*1)
	if (difference==0)
		document.write(current)
	else if (difference>0 && difference<150)
		document.write("Only "+difference+" days until "+before+"!")
}
