package com.guru.project.brother.main
{
	import com.guru.call.FunctionCall;
	import com.guru.display.button.LabelButton;
	import com.guru.facebookApplicationBase.gameBase.GameSectionBase;
	import com.guru.facebookApplicationBase.tracking.Tracking;
	import com.guru.panel.Panel;
	import com.guru.section.Section;
	import flash.display.MovieClip;
	/**
	 * ...
	 * @author Eddy Lee
	 */
	public class MainSection extends GameSectionBase
	{
		private var mRecordBtn:LabelButton;
		private var mGameBtn:LabelButton;
		private var mCollectionBtn:LabelButton;
		private var mInboxBtn:LabelButton;
		private var mRankingBtn:LabelButton;
		private var mGiftBtn:LabelButton;
		
		public function MainSection(pTimeline_mc:MovieClip)
		{
			super(pTimeline_mc);
			
			Tracking.getInstance().track("MainSection");
			
			mRecordBtn = new LabelButton(mTimeline_mc.recordBtn_mc);
			mGameBtn = new LabelButton(mTimeline_mc.gameBtn_mc);
			mCollectionBtn = new LabelButton(mTimeline_mc.collectionBtn_mc);
			mInboxBtn = new LabelButton(mTimeline_mc.inboxBtn_mc);
			mRankingBtn = new LabelButton(mTimeline_mc.rankingBtn_mc);
			mGiftBtn = new LabelButton(mTimeline_mc.giftBtn_mc);
			
			mRecordBtn.setPressCall(new FunctionCall(this, onSectionBtnPress, "record"));
			mGameBtn.setPressCall(new FunctionCall(this, onSectionBtnPress, "game"));
			mCollectionBtn.setPressCall(new FunctionCall(this, onSectionBtnPress, "collection"));
			mInboxBtn.setPressCall(new FunctionCall(this, onSectionBtnPress, "inbox"));
			mRankingBtn.setPressCall(new FunctionCall(this, onSectionBtnPress, "ranking"));
			mGiftBtn.setPressCall(new FunctionCall(this, onGiftBtnPress));
		}
		
		override public function dispose():void 
		{
			mRecordBtn.dispose();
			mGameBtn.dispose();
			mCollectionBtn.dispose();
			mInboxBtn.dispose();
			mRankingBtn.dispose();
			
			super.dispose();
		}
		
		private function onSectionBtnPress(pSection_str:String):void
		{
			Section.changeSection(pSection_str);
		}
		
		private function onGiftBtnPress():void
		{
			Panel.showPanel("prize", new FunctionCall(mGiftBtn, mGiftBtn.reset));
		}
	}

}