
HJ.holiday = Class.create();

HJ.holiday.prototype = {


	initialize: function() {
    this.targetContainerId = "content";     
		this.url = basePageURL + "holiday.htm";
		this.dlist = null;
		this.resultList = null;
		this.defaultSearchValue = "";
	},
	
	cleanup: function() {
	},
	
	 viewSelected: function(invoker) {	      
		 this.doLoadTemplate();
	    document.getElementById(this.targetContainerId).style.backgroundColor = "white"; 
     },	
	
	doLoadTemplate: function() { 		
//		if (this.load == null) {
         this.load = new Af.TemplateLoader(this.url, this.targetContainerId, "holidayDiv");
         this.load.listener = this;
         this.load.loadTemplate();
		/*} else {
		   this.load.reAttachElement();	
           this.doLoadCalCategoryInfo(); // refresh ...          		 

		   if(this.resultTitle != null){
			   this.resultTitle.style.display = "none";
		   }		   
		   if(this.searchResultsArea != null){
			   this.searchResultsArea.innerHTML = "";
		   }
		} */
	},
	templateLoaded: function () {
	 	    
       this.holidayCal = document.getElementById("holidayCal");
       this.holidayCal.onclick = this.loadCommCalendarTemplate.bind(this);
   	   this.holidaySources = document.getElementById("holidaySources");
       this.holidaySources.onclick = this.loadCommunityResourcesTemplate.bind(this);
  	   this.holidayMHM = document.getElementById("holidayMHM");
       this.holidayMHM.onclick = this.loadMHMTemplate.bind(this);
       
       this.calenderTop = document.getElementById("calenderTop");
       calenderTop = this.calenderTop;
       
       this.planningDiv = document.getElementById("planningDiv");
       this.pageBottom = document.getElementById("pageBottom");	   
       this.leftNavPlanningDiv = document.getElementById("leftNavPlanningDiv")
       this.leftNavAd = document.getElementById("leftNavAd");
   
  },
	loadCommCalendarTemplate: function() {
	    app.communityCalendar.viewSelected(this);	  
    this.calenderTop.style.display = "none";
		this.leftNavPlanningDiv.style.display="block";
		this.leftNavAd.style.display = "none";
    this.planningDiv.style.display="inline";
		this.pageBottom.style.display="none";		
		
		return false;
	},  
	loadCommunityResourcesTemplate: function() {	
    //app.myResources.viewSelected(this);
    this.planningDiv.style.display="none";
		this.leftNavPlanningDiv.style.display="none";
    this.leftNavAd.style.display = "block";
    this.pageBottom.style.display="inline";	  
		app.resource.loadCommunityResourcesTemplate();
		return false;
	},

loadMHMTemplate: function() {
		
		this.planningDiv.style.display="none";
		this.leftNavPlanningDiv.style.display="none";
	  this.leftNavAd.style.display = "block";
    this.pageBottom.style.display="inline";
		app.question.loadQATemplate();
		return false;

	}


	
}

