Mys.kStorageList = function(config)
{
	Mys.KMAList.superclass.constructor.call(this, config);
	
	this.on("move", function(start, maxRow){
		this.onMove();
		var boardID = typeof this.boardID == "string" ? this.boardID.split(",") : this.boardID;
		
		if(boardID && boardID.length == 1)
			boardID = boardID[0];
		
		Global.modelItem.getList(boardID, this.boardType, this.order, this.dir, this.basis, this.timePoint, this.range, this.startDate, this.endDate, null, start, maxRow, this.keyword, this.scriptFlag, this.defaultFlag, this.cate, function(data){
			if(data && data.response.code == 100)
				this.update(data.response.item, data.response.total);
			else
				this.empty();
		}, this)
	}, this);
};

Ext.extend(Mys.kStorageList, Mys.KMAList, {
	boardType : 3,
	dir : "desc",
	order : "insert_date",
	pager : new Mys.KMAPager,
	orderValue : "insert_date",
	timePoint : "past",
	basis : "insert_date",
	sortText : "등록",
	tagLength : 80,
	
	headerTemplate : (new Ext.Template([
		'<table width="100%" border="0" cellspacing="0" cellpadding="0">',
			'<tr>',
				'<td class="top-menu-box" height="50" >',
					'<table align="center" border="0" cellspacing="0" cellpadding="0">',
						'<tr id="top-menu-list">',
							'<td width="115" align="center" class="sort" style="border:solid 1px #cecece" onmouseover="MM_showHideLayers(\'option2\',\'\',\'show\')" onmouseout="MM_showHideLayers(\'option2\',\'\',\'hide\')"><a href="#" value="range">{sortText}일순</a><img src="../images/blank.gif"/></td>',
							'<td width="10"></td>',
							'<td width="115" align="center" class="sort" style="border:solid 1px #cecece"><a href="#state=list&order=agree_count&dir=desc" value="agree_count">추천순</a><img src="../images/blank.gif"/></td>',
							'<td width="10"></td>',
							'<td width="115" align="center" class="sort" style="border:solid 1px #cecece"><a href="#state=list&order=reply_count&dir=desc" value="reply_count">댓글순</a><img src="../images/blank.gif"/></td>',
							'<td width="10"></td>',
							'<td width="115" align="center" class="sort" style="border:solid 1px #cecece"><a href="#state=list&order=read_count&dir=desc" value="read_count">조회순</a><img src="../images/blank.gif"/></td>',
						'</tr>',
					'</table>',
					'<div id="option2" class="sort-select vitamin-sort-select" onmouseover="MM_showHideLayers(\'option2\',\'\',\'show\')" onmouseout="MM_showHideLayers(\'option2\',\'\',\'hide\')" >',
						'<nobr onmouseover="this.style.backgroundColor=\'#86C4EA\'" onmouseout="this.style.backgroundColor=\'#DEE9FB\'"><img src="/images/k_storage/dot_sort.gif"/><a href="#state=list&range=all&time_point={timePoint}&basis={basis}&order={order}&dir={dir}" class="option" value="all">전체</a></nobr>',
						'<nobr onmouseover="this.style.backgroundColor=\'#86C4EA\'" onmouseout="this.style.backgroundColor=\'#DEE9FB\'"><img src="/images/k_storage/dot_sort.gif"/><a href="#state=list&range=today&time_point={timePoint}&basis={basis}&order={order}&dir={dir}" class="option" value="today">오늘</a></nobr>',
						'<nobr onmouseover="this.style.backgroundColor=\'#86C4EA\'" onmouseout="this.style.backgroundColor=\'#DEE9FB\'"><img src="/images/k_storage/dot_sort.gif"/><a href="#state=list&range=week&time_point={timePoint}&basis={basis}&order={order}&dir={dir}" class="option" value="week">일주일 이내</a></nobr>',
						'<nobr onmouseover="this.style.backgroundColor=\'#86C4EA\'" onmouseout="this.style.backgroundColor=\'#DEE9FB\'"><img src="/images/k_storage/dot_sort.gif"/><a href="#state=list&range=month&time_point={timePoint}&basis={basis}&order={order}&dir={dir}" class="option" value="month">한달 이내</a></nobr>',
						'<nobr onmouseover="this.style.backgroundColor=\'#86C4EA\'" onmouseout="this.style.backgroundColor=\'#DEE9FB\'"><img src="/images/k_storage/dot_sort.gif"/><a href="#state=list&range=year&time_point={timePoint}&basis={basis}&order={order}&dir={dir}" class="option" value="year">일년 이내</a></nobr>',
//						'<nobr onmouseover="this.style.backgroundColor=\'#86C4EA\'" onmouseout="this.style.backgroundColor=\'#DEE9FB\'"><img src="/images/k_storage/dot_sort.gif"/><a href="#state=list&range=all&time_point={timePoint}&basis={basis}&order={order}&dir={dir}" class="option" value="past">지난 등록</a></nobr>',
					'</div>',
				'</td>',
			'</tr>',
		'</table>'
	])).compile()
});
