// JavaScript Document
  var SPECIAL_DAYS = {
    0 : [ 1, 15, 16, 17, 26 ],		// special days in January
	1 : [ 16 ], 
    3 : [ 4, 14, 16, 22 ],	// special days in april
    4 : [ 1 ],
    7 : [ 15, 21, 31 ],
    8 : [ 1 ],
    9 : [ 2, 5, 6, 26 ],		// 
    10: [ 7 ],
    11: [ 6, 25 ]
  };
  
  

  function dateIsSpecial(year, month, day) {
    var m = SPECIAL_DAYS[month];
    if (!m) return false;
    for (var i in m) if ((m[i] == day) && year == "2011") 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
      // redirect...
      
      var months = new Array(13);
        months[0]  = "January";
        months[1]  = "February";
        months[2]  = "March";
        months[3]  = "April";
        months[4]  = "May";
        months[5]  = "June";
        months[6]  = "July";
        months[7]  = "August";
        months[8]  = "September";
        months[9]  = "October";
        months[10] = "November";
        months[11] = "December";

     
      var temp = months[m];
      var temp1 = temp + d + y;
            
      switch(temp1) {
      
       case 'January12012' : {alert ("New Year Day"); break; }
       case 'January152012' : {alert ("Pongal"); break; }
       case 'January162012' : {alert ("Thiruvalluvar Day"); break;}
       case 'January172012' : {alert ("Uzhavar Thirunal"); break;}
       case 'January262012' : {alert ("Republic Day"); break; }
       case 'February52012'   : {alert ("Meelad-un-Nabi"); break; }
       case 'March232012'    : {alert ("Telugu New Years Day"); break; }
	   case 'April52012'    : {alert ("Mahaveer Jayanthi"); break; }
       case 'April62012'   : {alert ("Good Friday"); break; }
       case 'April132012'   : {alert ("Tamil New Years Day"); break; }	   
       case 'April142012'   : {alert ("Dr. B.R. Ambedhkar Birthday"); break; }
       case 'May12012'      : {alert ("May Day"); break; }
	   case 'August152012'  : {alert ("Independence Day"); break; }
	   case 'August202012'  : {alert ("Ramzan"); break; }	   
	   case 'September82012'  : {alert ("Sri Krishna Jayanthi"); break; }	   
       case 'September192012' : {alert ("Vinayaka Chathurthi"); break; }
	   case 'October22012'  : {alert ("Gandhi Jayanthi"); break; }       
	   case 'October232012' : {alert ("Ayudha Pooja"); break; }      
       case 'October242012' : {alert ("Vijaya Dasami"); break; }  
       case 'October272012': {alert ("Bakrid"); break; }   	             
       case 'November132012'  : {alert ("Deepavali"); break; }
	   case 'November252012' : {alert ("Muharram"); }     
       case 'December252012' : {alert ("Christmas"); break;} 
         
      }
      
            
      //window.location = "/" + y + "/" + m + "/" + d + "/index.php";
    }
  };

  function ourDateStatusFunc(date, y, m, d) {
    if (dateIsSpecial(y, m, d))
      return "special";
    else
      return false; // other dates are enabled
      // return true if you want to disable other dates
  };

  Calendar.setup(
    {
      flat         : "calendar-container", // ID of the parent element
      flatCallback : dateChanged,          // our callback function
      dateStatusFunc : ourDateStatusFunc
    }
  );
