var AdminBoard = Class.create();
Object.extend(Object.extend(AdminBoard.prototype, Board.prototype), {
	initialize : function(option) {
		this._initialize(option);
		this.buildButtons();
		this.pages = this.buildElement(this.contentHeader, null, {display : "block"});
		this.attachListeners();
		this.currentPage = 1;
		this.rowsPerPage = 20;
		this.processMap = {
			list : {
				NotSelected : this.targetView + "_Select",
				subject : this.targetView + "_SelectBySubject",
				content : this.targetView + "_SelectByContent"
			}
		};
		this.behavior = new Behavior(option);
		this.behavior.insert = function(){
			var member = taskManager.find("Member");
			if(!member) return;
			member.onRequest = function() {
				if(member.userInformation.logged && "ADMIN" == member.userInformation.id) {
					this.behavior.doInsert.bind(this)();
				} else {
					alert("관리자 로그인하기 바랍니다.");
				}				
			}.bind(this);
			member.request();
		}.bind(this);
		this.behavior.reply = function() {
			var member = taskManager.find("Member");
			if(!member) return;
			member.onRequest = function() {
				if(member.userInformation.logged && "ADMIN" == member.userInformation.id) {
					this.behavior.doReply.bind(this)();
				} else {
					alert("관리자 로그인하기 바랍니다.");
				}				
			}.bind(this);
			member.request();
		}.bind(this);
		this.view.list.bind(this)();
	},
	buildButtons : function() {
		this.buttons = this.buildElement(this.contentHeader);
		this.insertButton = this.buildElement(this.buttons,
		{elementName : "img", src: "style/img/write.png"}, {width: "30px", height: "30px", cursor: "pointer"});
		this.searchTypeSelect = this.buildElement(this.buttons,
		{elementName : "select"});
		var optEempty = this.buildElement(this.searchTypeSelect,
		{elementName : "option", value: "NotSelected"});
		optEempty.innerHTML = "Not Selected";
		var optSubject = this.buildElement(this.searchTypeSelect,
		{elementName : "option", value: "subject"});
		optSubject.innerHTML = "제목";
		var optContent = this.buildElement(this.searchTypeSelect,
		{elementName : "option", value: "content"});
		optContent.innerHTML = "내용";
		this.searchKeyInputText = this.buildElement(this.buttons,
		{elementName : "input", type: "text", name : "key"});
		this.listButton = this.buildElement(this.buttons,
		{elementName : "img", src: "style/img/search.png"}, {width: "30px", height: "30px", cursor: "pointer"});
	}
});