
	var calendarSchedules= [{"date":"01/22/2010","description":"SEC","image":"SEC-small.jpg"},{"date":"01/29/2010","description":"Election Fraud","image":"ElectionFraud-small.jpg"},{"date":"02/05/2010","description":"MCLE Program Day 1","image":"2010MCLEProgram-small.jpg"},{"date":"02/06/2010","description":"MCLE Program Day 2","image":"2010MCLEProgram-small.jpg"},{"date":"02/12/2010","description":"MCLE Program Day 3","image":"2010MCLEProgram-small.jpg"},{"date":"02/13/2010","description":"MCLE Program Day 4","image":"2010MCLEProgram-small.jpg"},{"date":"02/18/2010","description":"TRR2 Day 1","image":"TRR-small.jpg"},{"date":"02/19/2010","description":"TRR2 Day 2","image":"TRR-small.jpg"},{"date":"02/26/2010","description":"Incoterms3","image":"Incoterms3-small.jpg"},{"date":"03/03/2010","description":"Healthcare Day 1","image":"Healthcare-small.jpg"},{"date":"03/04/2010","description":"Healthcare Day 2","image":"Healthcare-small.jpg"},{"date":"03/12/2010","description":"Credit and Collection","image":"CreditCollection-small.jpg"},{"date":"03/19/2010","description":"CorpGov2","image":"CorpGov-small.jpg"},{"date":"04/16/2010","description":"Family Business Governance Day 1","image":"FBG-small.jpg"},{"date":"04/17/2010","description":"Family Business Governance Day 2","image":"FBG-small.jpg"},{"date":"04/20/2010","description":"Supply Chain Management","image":"SCM-small.jpg"},{"date":"04/24/2010","description":"Lawschool Day 1","image":"Lawschool-small.jpg"},{"date":"04/25/2010","description":"Lawschool Day 2","image":"Lawschool-small.jpg"},{"date":"04/29/2010","description":"EducationLaw3 Day 1","image":"EducationLaw3-small.jpg"},{"date":"04/30/2010","description":"EducationLaw3 Day 2","image":"EducationLaw3-small.jpg"},{"date":"05/06/2010","description":"FPC7","image":"FPC7-small.jpg"},{"date":"05/13/2010","description":"HR Policies and Contracts Day 1","image":"HRP-small.jpg"},{"date":"05/14/2010","description":"HR Policies and Contracts Day 2","image":"HRP-small.jpg"},{"date":"05/28/2010","description":"Microfinance2","image":"Microfinance2-small.jpg"},{"date":"05/02/2010","description":"BRC4 Day 1","image":"BRC-small.jpg"},{"date":"05/16/2010","description":"BRC4 Day 2","image":"BRC-small.jpg"},{"date":"05/23/2010","description":"BRC4 Day 3","image":"BRC-small.jpg"},{"date":"05/30/2010","description":"BRC4 Day 4","image":"BRC-small.jpg"},{"date":"06/03/2010","description":"BPFC Day 1","image":"BPFC-small.jpg"},{"date":"06/04/2010","description":"BPFC Day 2","image":"BPFC-small.jpg"},{"date":"06/06/2010","description":"BRC4 Day 5","image":"BRC-small.jpg"},{"date":"06/13/2010","description":"BRC4 Day 6","image":"BRC-small.jpg"},{"date":"06/20/2010","description":"BRC4 Day 7","image":"BRC-small.jpg"},{"date":"06/27/2010","description":"BRC4 Day 8","image":"BRC-small.jpg"},{"date":"06/18/2010","description":"Protecting Lenders in Credit Transactions","image":"BPP3-small.jpg"},{"date":"06/23/2010","description":"CH2 Day 1","image":"CH-small.jpg"},{"date":"06/24/2010","description":"CH2 Day 2","image":"CH-small.jpg"},{"date":"07/01/2010","description":"AuditCom Day 1","image":"AuditCom-small.jpg"},{"date":"07/02/2010","description":"AuditCom Day 2","image":"AuditCom-small.jpg"},{"date":"07/08/2010","description":"LC3 Day 1","image":"LC-small.jpg"},{"date":"07/09/2010","description":"LC3 Day 2","image":"LC-small.jpg"},{"date":"07/15/2010","description":"SHRP Day 1","image":"SHRP-small.jpg"},{"date":"07/16/2010","description":"SHRP Day 2","image":"SHRP-small.jpg"},{"date":"07/23/2010","description":"Credit and Collection","image":"CreditCollection-small.jpg"},{"date":"08/05/2010","description":"CLICC5","image":"CLICC5-small.jpg"},{"date":"08/06/2010","description":"CLICC5","image":"CLICC5-small.jpg"},{"date":"08/14/2010","description":"BestComPrac","image":"BestComPrac-small.jpg"},{"date":"08/19/2010","description":"TP","image":"TP-small.jpg"},{"date":"08/26/2010","description":"CoopLawIRR Day 1","image":"CoopLawIRR-small.jpg"},{"date":"08/27/2010","description":"CoopLawIRR Day 2","image":"CoopLawIRR-small.jpg"},{"date":"09/10/2010","description":"NAR","image":"NAR-small.jpg"},{"date":"09/17/2010","description":"Protocol5","image":"Protocol-small.jpg"},{"date":"09/23/2010","description":"UCP2 Day 1","image":"UCP-small.jpg"},{"date":"09/24/2010","description":"UCP2 Day 2","image":"UCP-small.jpg"},{"date":"10/15/2010","description":"Ejectment-Cebu","image":"Ejectment-Cebu-small.jpg"},{"date":"10/23/2010","description":"Lawschool Day 1","image":"Lawschool-small.jpg"},{"date":"10/24/2010","description":"Lawschool Day 2","image":"Lawschool-small.jpg"},{"date":"12/15/2010","description":"YET3 Day 1","image":"YET-small.jpg"},{"date":"12/16/2010","description":"YET3 Day 2","image":"YET-small.jpg"},{"date":"01/13/2011","description":"HRP2 Day 1","image":"HRP-small.jpg"},{"date":"01/14/2011","description":"HRP2 Day 2","image":"HRP-small.jpg"},{"date":"01/15/2011","description":"","image":""}]	
	YAHOO.namespace("cgbp.calendar");
	YAHOO.cgbp.calendar.init = function() {
		var eLog = YAHOO.util.Dom.get("evtentries");
		var eCount = 1;
 
		function dateToLocaleString(dt, cal) {
                	var wStr = cal.cfg.getProperty("WEEKDAYS_LONG")[dt.getDay()];
                	var dStr = dt.getDate();
                	var mStr = cal.cfg.getProperty("MONTHS_LONG")[dt.getMonth()];
               	 	var yStr = dt.getFullYear();
                	return (wStr + ", " + dStr + " " + mStr + " " + yStr);
		}
 
		function mySelectHandler(type,args,obj) {
			var selected = args[0];
			var selDate = this.toDate(selected[0]);
			var strMonth = (selDate.getMonth()+1)<10 ? "0"+(selDate.getMonth()+1) : (selDate.getMonth()+1);
			var strDay = (selDate.getDate())<10 ? "0"+(selDate.getDate()) : (selDate.getDate());
			var strDate=strMonth+"/"+strDay+"/"+selDate.getFullYear();
			showPanel(strDate,getDescription(strDate));
		};
 
		function myDeselectHandler(type, args, obj) {
			var deselected = args[0];
			var deselDate = this.toDate(deselected[0]);
		};
 
		function getDescription(strDate) {
			for (var i=0;i<calendarSchedules.length;i++) {
				if (calendarSchedules[i]["date"]==strDate) {
					return calendarSchedules[i];
				}
			}
			return "{ no activity}";
		}
		
		YAHOO.cgbp.calendar.cal1 = new YAHOO.widget.Calendar("cal1","cal1Container");


 
		YAHOO.cgbp.calendar.cal1.selectEvent.subscribe(mySelectHandler, YAHOO.cgbp.calendar.cal1, true);
		YAHOO.cgbp.calendar.cal1.deselectEvent.subscribe(myDeselectHandler, YAHOO.cgbp.calendar.cal1, true);
 
		//get Calendar Schedule from CGBP db
		for (var i=0;i<calendarSchedules.length-1;i++) {
			YAHOO.cgbp.calendar.cal1.addRenderer(calendarSchedules[i]["date"], YAHOO.cgbp.calendar.cal1.renderCellStyleHighlight1);
		}
		//end get Calendar Schedule from CGBP db		
		
		YAHOO.cgbp.calendar.cal1.render();
	}
 
	YAHOO.util.Event.onDOMReady(YAHOO.cgbp.calendar.init);
	
	YAHOO.namespace("cgbp.container");
	function showPanel(dateCalendar,oActivity) {
			// Instantiate a Panel from markup
			YAHOO.cgbp.container.panel1 = new YAHOO.widget.Panel("panel1", { width:"330px", visible:false, constraintoviewport:true } );
 
			YAHOO.cgbp.container.panel1.setHeader("Date: "+dateCalendar);
			YAHOO.cgbp.container.panel1.setBody("<table border=0 cellpadding=3 cellspacing=5><tr><td><img src='images/banners-index/"+oActivity["image"]+"'"+"</td></tr></table>");



			YAHOO.cgbp.container.panel1.setFooter("");
 
			YAHOO.cgbp.container.panel1.render();
			YAHOO.cgbp.container.panel1.show();
	}
