
var SPECIAL_DAYS = { 
    0 : [ 1 ],// new years 
	4 : [ 26 ], //memorial day
    6 : [ 4 ], // july 4
    8 : [ 1 ], // labor day 
	10 : [ 27 ], //thanksgiving
    11 : [ 25 ], // christmas
}; 

var ddate;

function dateIsSpecial(date, year, month, day) { 
    var m = SPECIAL_DAYS[month]; 
    if(date.toString().match("Sun")||date.toString().match("Sat")) return true;
    if (!m) return false; 
    for (var i in m) if (m[i] == day) return true; 
    return false; 
}; 
function dateChanged(calendar) { 
    // Beware that this function is called even if the end-user only 
    // changed the month/year. In order to determine if a date was 
    // clicked you can use the dateClicked property of the calendar: 
    if (calendar.dateClicked) { 
    // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php 
    var y = calendar.date.getFullYear(); 
    var m = calendar.date.getMonth(); // integer, 0..11 
    var d = calendar.date.getDate(); // integer, 1..31 
    
    } 
}; 
function ourDateStatusFunc(date, y, m, d) { 
    if (dateIsSpecial(date, y, m, d)) 
    return true; 
    else 
    return false; // other dates are enabled 
    // return true if you want to disable other dates 
}; 


/*
var calendars = getElementsByClassName(document, "input", "calendar_select");
for (i in calendars) {
    Calendar.setup(
    {
      inputField: calendars[i],  ifFormat: "%m-%d-%Y",  button: calendars[i].id+"_btn", eventName:"click" , flatCallback : dateChanged, dateStatusFunc : ourDateStatusFunc 
    });
}
*/
  Calendar.setup(
    {
      inputField  : "ordExtra1",         // ID of the input field
      ifFormat    : "%m %d, %Y",    // the date format
      button      : "ordExtra1_btn"       // ID of the button
    }
  );
