Mys.hrdItem = function(data, config)
{	
	Mys.hrdItem.superclass.constructor.call(this, data, config);
};

Ext.extend(Mys.hrdItem, Mys.KMAItem, {
	useImage : false,
	hasApply : true,
	titleSize : 490,
	
	className : "mys-item-hrd",
	template : (new Ext.Template([		
		'<table width="650" class="{className}" id="{className}-{item_id}" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">',		
			'<tr>',				
				'<td width="310" style="word-break:break-all;text-align:left; padding:11px 0px 9px 0px; font-weight:bold; text-indent:12px; color:#669933; text-overflow:ellipsis-word; display:block; white-space:nowrap; overflow:hidden;"><a href="{viewURL}" style="font-weight:bold;word-break:keep-all;color:#669933; font-size:9pt;" title="{titleAll}" {target}>{title}</a> {isAddition} {isGJ}</td>',
				'<td width="135" align="center">{dateRange2}</td>',
				'<td width="135" align="center"><font color="#2751cb">{dateRange}</font></td>',
				'<td width="70" align="center"><a href="{applyViewURL}" style="text-align:center">{isApply}</a></td>',
			'</tr>',		
		'</table>',
		
	])).compile(),
	
	prepareData : function(data)
	{
		data = Mys.hrdItem.superclass.prepareData.call(this, data);
		
		var Today = new Date();
		var startDate = Date.parseDate(data.start_date, "Y-m-d H:i:s");
		var endDate = Date.parseDate(data.end_date, "Y-m-d H:i:s");

		dt = new Date(startDate);
		startDate2 = dt.add(Date.DAY, -1);

		
		if(startDate && endDate)
		{
			//data.dateRange = startDate.format("n월 j일");
			data.dateRange = startDate.format("Y.m.d") + " ~ " + endDate.format("m.d");

			//data.dateRange2 = startDate.format("n월 j일");
			data.dateRange2 = Today.getFullYear() + ".01.01" + " ~ " + startDate2.format("Y.m.d");
			

			//this.date.add("mo", 1).add("d", -1).format("Y-m-d")
			/*
			if(startDate.format("ymd") == endDate.format("ymd"));
			else if(startDate.format("ym") == endDate.format("ym"))
				data.dateRange += " ~ " + endDate.format("j일");
			else if(startDate.format("y") == endDate.format("y"))
				data.dateRange += " ~ " + endDate.format("n월 j일");
			else
				data.dateRange += " ~ " + endDate.format("y년 n월 j일");
			*/
		}
		
		if(this.hasApply)
		{
			if(data.applyYN == 1 || data.applyYN == 2)
				data.isApply = '<img class="mys-hrd-apply" src="/images/hrd/btn_closings.gif" />';
			else
				data.isApply = '<img class="mys-hrd-apply" src="/images/common/btn_application.gif" />';
		}
		
		if(data.is_addition == 1)
			data.isAddition = '<img class="mys-hrd-addition" src="/images/hrd/add_new.gif" />';
//		if(data.is_gj == 1)
//			data.isGJ = '<img class="mys-hrd-gyeongju" src="/images/hrd/add_kyoungJu.gif" />';
		
		data.applyViewURL = data.applyYN == 1 || data.applyYN == 2 ? "javascript:;" : data.viewURL;
		
		return data;
	},
	
	setEvents : function(el)
	{
	}
});
