
HJ.SummerCamps = Class.create();

HJ.SummerCamps.prototype = {


	initialize: function() {
    this.targetContainerId = "content";     
		this.url = basePageURL + "summerCamp.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() { 		
         this.load = new Af.TemplateLoader(this.url, this.targetContainerId, "dashboardCamp");
         this.load.listener = this;
         this.load.loadTemplate();
	},
	templateLoaded: function () {
	 	    	 	     
       this.teamRosters = document.getElementById("teamRosters");
       this.teamRosters.onclick = this.loadCalendarTemplate.bindAsEventListener(this);
       
       this.scheduleSharing = document.getElementById("scheduleSharing");
       this.scheduleSharing.onclick = this.loadCalendarTemplate.bindAsEventListener(this);

       this.quickVolunteer = document.getElementById("quickVolunteer");
       this.quickVolunteer.onclick = this.loadCalendarTemplate.bindAsEventListener(this);
       
       this.featuredCamps = document.getElementById("featuredCamps");      
       this.featuredCamps.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);
       this.language = document.getElementById("language");      
       this.language.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);       
   	   this.otherCamps = document.getElementById("otherCamps");
       this.otherCamps.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);       
       this.academics = document.getElementById("academics");
       this.academics.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);
       this.theater = document.getElementById("theater");      
       this.theater.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);   	   
  	   this.comingSoon = document.getElementById("comingSoon");
       this.comingSoon.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);       
       this.art = document.getElementById("art");
       this.art.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);
 	   this.science = document.getElementById("science");
       this.science.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);  
       this.greatOutdoors = document.getElementById("greatOutdoors");
       this.greatOutdoors.onclick = this.loadCommCalendarTemplate.bindAsEventListener(this);        	   
       this.sports = document.getElementById("sports");
       this.sports.onclick = this.loadCommCalendarTemplate.bindAsEventListener(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");

		this.tellAFriend	= document.getElementById("tellAFriend");	
		this.tellAFriend.onclick = this.doTellAFriend.bind(this);

  },

	loadCalendarTemplate: function() {    
	  
	    app.schedule.monthlyCalendarSelected();
	    app.schedule.viewSelected(this);	 
		this.calenderTop.style.display = "block";
		this.leftNavPlanningDiv.style.display="block";
    	this.leftNavAd.style.display = "none";
    
		this.planningDiv.style.display="inline";
	    this.pageBottom.style.display="none";				
		
		return false;
  	},
	

	loadCommCalendarTemplate: function(e) {
		var eventTarget = e.target ? e.target : e.srcElement;
		app.communityCalendar.selectedCatName = eventTarget.name;
	    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;

	},

	doTellAFriend: function() {
	  // window.location = basePageURL + "tellafriend_general.html";
         var tellAFriendPage = new HJ.TellAFriendPage();
         tellAFriendPage.init(this.targetContainerId);
	}

}

