var dto_pageCondition = {
	get : function()
	{
		var dto = {
			current : '',
			first : '',
			end : '',
			next : '',
			prev : '',
			ipp : '',
			totalItem : ''
		};
		return dto;
	}
}


var doit_com_paging = Class.create();
doit_com_paging = {
	// 페이징
	paging : function(dto_pageCondition) {
		var result = "";
		
		if(dto_pageCondition != null && dto_pageCondition.first != 0) {

			if(dto_pageCondition.prev != dto_pageCondition.first) {
				result += "<a href=\"javascript:changePage(" + Number(dto_pageCondition.first) + ");\"><img src='/images/user/common/btn/btn_first.gif' alt='처음페이지' border='0'/></a>&nbsp;";
				result += "<a href=\"javascript:changePage(" + Number(dto_pageCondition.prev - 1) + ");\"><img src='/images/user/common/btn/btn_prev.gif' alt='이전페이지' border='0'/></a>";
			}
            
			for(var i = dto_pageCondition.prev; i <= dto_pageCondition.next; i++) {
				if((this.next - this.prev) > 0){
					if(i == this.prev){
						classStr = "class=\"first\"";
					} else if (i == this.next){
						classStr = "class=\"last\"";
					}
				} else {
					classStr = "class=\"first\"";
				}
				
				if(i == dto_pageCondition.current) {
					result += "<span" +  classStr + "><strong style='color:#ff8a2d;'>" + i + "</strong></span>";
				} else {
					result += "<span" +  classStr + "><a href='javascript:changePage(" + i + ");'>" + i + "</a></span>";
				}
				
				if( i != dto_pageCondition.next && dto_pageCondition.prev != dto_pageCondition.next ) {
					result += " ";
				}
			}

			if(dto_pageCondition.next != dto_pageCondition.end ) {
				result += "<a href=\"javascript:changePage(" + Number(dto_pageCondition.next + 1) + ");\"><img src='/images/user/common/btn/btn_next.gif' alt='다음페이지' border='0'/></a>&nbsp;";
				result += "<a href=\"javascript:changePage(" + Number(dto_pageCondition.end) + ");\"><img src='/images/user/common/btn/btn_last.gif' alt='마지막페이지' border='0'/></a>";
			}
		}
		
		return result;
	},
	
	//추가[2008-09-10]-김지훈 한페이지에서 두개의 페이징이 이루어질때
	paging2 : function(dto_pageCondition) {
		var result = '';
		
		if(dto_pageCondition != null && dto_pageCondition.first != 0) {

			if(dto_pageCondition.prev != dto_pageCondition.first) {
				result += "<a href=\"javascript:changePage2(" + Number(dto_pageCondition.first) + ");\"><img src='/images/student/btn_b2.gif' align='absmiddle' style='margin:2px 0 0 0' border='0'></a>&nbsp;";
				result += "<a href=\"javascript:changePage2(" + Number(dto_pageCondition.prev - 1) + ");\"><img src='/images/student/btn_b1.gif' align='absmiddle' style='margin:2px 10px 0 0' border='0'></a>";
			}
            
			for(var i = dto_pageCondition.prev; i <= dto_pageCondition.next; i++) {
				if(i == dto_pageCondition.current) {
					result += "<b>[" + i + "]</b>";
				} else {
					result += "<a href='javascript:changePage2(" + i + ");'>" + i + "</a>";
				}
				
				if( i != dto_pageCondition.next && dto_pageCondition.prev != dto_pageCondition.next ) {
					result += " ";
				}
			}

			if(dto_pageCondition.next != dto_pageCondition.end ) {
				result += "<a href=\"javascript:changePage2(" + Number(dto_pageCondition.next + 1) + ");\"><img src='/images/student/btn_n2.gif' align='absmiddle' style='margin:2px 0 0 10px' border='0'></a>&nbsp;";
				result += "<a href=\"javascript:changePage2(" + Number(dto_pageCondition.end) + ");\"><img src='/images/student/btn_n1.gif' align='absmiddle' style='margin:2px 0 0 0' border='0'></a>";
			}
		}
		return result;
	},

	//추가[2008-09-10]-김지훈 한페이지에서 세개의 페이징이 이루어질때
	paging3 : function(dto_pageCondition) {
		var result = '';
		
		if(dto_pageCondition != null && dto_pageCondition.first != 0) {

			if(dto_pageCondition.prev != dto_pageCondition.first) {
				result += "<a href=\"javascript:changePage3(" + Number(dto_pageCondition.first) + ");\"><img src='/images/student/btn_b2.gif' align='absmiddle' style='margin:2px 0 0 0' border='0'></a>&nbsp;";
				result += "<a href=\"javascript:changePage3(" + Number(dto_pageCondition.prev - 1) + ");\"><img src='/images/student/btn_b1.gif' align='absmiddle' style='margin:2px 10px 0 0' border='0'></a>";
			}
            
			for(var i = dto_pageCondition.prev; i <= dto_pageCondition.next; i++) {
				if(i == dto_pageCondition.current) {
					result += "<b>[" + i + "]</b>";
				} else {
					result += "<a href='javascript:changePage3(" + i + ");'>" + i + "</a>";
				}
				
				if( i != dto_pageCondition.next && dto_pageCondition.prev != dto_pageCondition.next ) {
					result += " ";
				}
			}

			if(dto_pageCondition.next != dto_pageCondition.end ) {
				result += "<a href=\"javascript:changePage3(" + Number(dto_pageCondition.next + 1) + ");\"><img src='/images/student/btn_n2.gif' align='absmiddle' style='margin:2px 0 0 10px' border='0'></a>&nbsp;";
				result += "<a href=\"javascript:changePage3(" + Number(dto_pageCondition.end) + ");\"><img src='/images/student/btn_n1.gif' align='absmiddle' style='margin:2px 0 0 0' border='0'></a>";
			}
		}
		return result;
	}
}

