	// JavaScript Document
	$(document).ready(function() {
	// jquery datepicker plugin..
	$('#datepicker').datepicker({
	 dateFormat: 'dd-mm-yy',
	 onSelect: function(dateText, inst){
    switch(dateText)
	{
		case '02-08-2010' :
			var info="event information on 2nd";
			centerPopup();
        	loadPopup(info);
			break;
		case '10-08-2010' :
			var info="event information on 10th";
			centerPopup();
        	loadPopup(info);
			break;
		case '20-08-2010' :
			var info="event information on 20th";
			centerPopup();
        	loadPopup(info);
			break;
		default : "default";
	}
    },
	beforeShowDay: nationalDays,
	});
	 
    $("#popupClose").click(function () {
           disablePopup();
      });
    $("#backgroundPopup").click(function () {
           disablePopup();
      });
    $(document).keypress(function (e) {
           if (e.keyCode == 27 && popupStatus == 1) {
                 disablePopup();
			}
      });
	});
	
	
// disable the non event dates...
		function nationalDays(date) {
		 natDays = [
				[8, 1], [8, 3], [8, 4],
				[8, 5], [8, 6], [8, 7], [8, 8],
				[8, 9], [8, 11], [8, 12], [8, 13],
				[8, 14], [8, 15], [8, 16], [8, 17], 
				[8, 18], [8, 19], [8, 21], 
				[8, 22], [8, 23], [8, 24], [8, 25], 
				[8, 26], [8, 27], [8, 28], [8, 29],
				[8, 30], [8, 31] 
		];
				for (i = 0; i < natDays.length; i++) {
						if (date.getMonth() == natDays[i][0] - 1
						&& date.getDate() == natDays[i][1]) {
								return [false, natDays[i][2] + '_day'];
						}
				}
				return [true, ''];
		}
	
// modal popup 
	var popupStatus = 0;
	
		//loading popup with jQuery!
		function loadPopup(info) {
			//loads popup only if it is disabled
			if (popupStatus == 0) {
				$("#backgroundPopup").css({
					"opacity": "0.7"
				});
				$("#backgroundPopup").fadeIn("slow");
				$("#popup p").text(info);
				$("#popup").fadeIn("slow");
				popupStatus = 1;
			}
		}
	
		//disabling popup with jQuery!
		function disablePopup() {
			//disables popup only if it is enabled
			if (popupStatus == 1) {
				$("#backgroundPopup").fadeOut("slow");
				$("#popup").fadeOut("normal");
				popupStatus = 0;
			}
		}
	
		//centering popup
		function centerPopup() {
			//request data for centering
			var windowWidth = document.documentElement.clientWidth;
			var windowHeight = document.documentElement.clientHeight;
			var popupHeight = $("#popup").height();
			var popupWidth = $("#popup").width();
			//centering
			$("#popup").css({
				"position": "absolute",
				"top": windowHeight / 0.8 - popupHeight / 0.8,
				"left": windowWidth / 2 - popupWidth / 2
			});
			//only need force for IE6
	
			$("#backgroundPopup").css({
				"height": windowHeight
			});
		}
	
	   
			  
