



/**
리뉴얼 후 사용 안함. 함승목.
	* author : 장희영
	* date	 : 2010-06-30
*
var CategoryControll = {
	'_category1st' : null,
	'_category1st_position' : null,
	'_category_current_seq' : -1, //상품리스트가 아닐경우 불안들어오도록 디폴트값 0 에서 -1로 수정. 2010.8.3 함승목.

	'init' : function (category1st, category_id) {
		// 대분류 값
		this._category1st = category1st;

		// 대분류 위치값
		this._category1st_position = $$("#category_1sts li");

		if (parseInt(category_id) > 0) {
			var seq = 0;

			this._category1st.each(function(c){
				if (c.id == category_id) {
					CategoryControll._category_current_seq = seq;
				}
				seq++;
			});
		}


		//전체보기 url형태는 /product/list(/) , 검색조건붙을시 /product/list/?~~ 로 진행되므로 이에 해당하면 전체보기index 인 0 설정.
		// 2010.8.3 함승목.
		if(this._category_current_seq < 0 && location.href.split('product/').length > 1 && (location.href.split('product/')[1].split('?')[0] == 'list' || location.href.split('product/')[1].split('?')[0] == 'list/' )) {
			this._category_current_seq = 0;
		}



		// _category_current_seq 값이 -1인 경우는 상품리스트 페이지가 아니므로 active 클래스 적용하지 않는다.
		// 2010.8.3 함승목.
		if(CategoryControll._category_current_seq >= 0) {
			// 현재 페이지의 category_id 가 있을 경우 current 메뉴로 설정

			this._category1st_position[this._category_current_seq].addClassName('active');
		}



		// 서버에서 꺼내온 대분류값들을 대분류 위치에 셋팅 
		var seq = 0;

		this._category1st.each(function(c) {
			// 대분류 카테고리 위치값 노드
			var category_item = CategoryControll._category1st_position[seq];

			// 대분류 카테고리명 업데이트
			category_item.update(c.category_title);

			// 카테고리 링크 설정
			if (parseInt(c.id) > 0) {
				CategoryControll.set_link(category_item, WEBROOT + '/product/list/category_id/' + c.id + '/');
			} else {
				// 전체
				CategoryControll.set_link(category_item, WEBROOT + '/product/list/');
			}

			// 카테고리 마우스 오버/아웃 설정
			category_item.observe('mouseover', function() {CategoryControll.category_mouse_over(category_item)});
			category_item.observe('mouseout', function() {CategoryControll.category_mouse_out(category_item)});
			seq++;
		});

	},

	// 카테고리 링크별 링크설정
	'set_link' : function (obj, link) {
		obj.observe('click', function() {window.location.href = link});
	},

	// 카테고리 마우스 오버/아웃 설정
    'category_mouse_over' : function (obj) {
        obj.addClassName('active');
    },

    'category_mouse_out' : function (obj) {
		obj.removeClassName('active');

		// _category_current_seq 값이 default값  -1인 경우 배열인덱스가 아니므로 패스.
		// 2010.8.3 함승목.
		if(CategoryControll._category_current_seq >= 0) {
			CategoryControll._category1st_position[CategoryControll._category_current_seq].addClassName('active');
		}

    }
};
*/

