/**
 * ********************************** 공통 관련 Link
 * *************************************************
 */

//var donwload_url = "http://support-kr.canon-sims.cxrus.net/";
var donwload_url = "http://support-kr.canon-ci.co.kr/";

/**
 * GNB 링크
 *
 * made by mercurii. 2009.10.21
 */
 function fnGo(no, value) {
	switch(no) {
		case "login" : // 로그인
			showLogin(1);
			break;
		case "center" :	// 고객센터
			location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/customer/notice_list.jsp";
			break;
		case "logout" :
			location.href = "/actions/LoginUserAction?cmd=logout";	// 로그아웃
			break;
		case "member" :
			location.href = "/actions/MemberShipAction?cmd=introPage";// 회원가입
																		// 분기
			// location.href = "/actions/MemberShipAction?cmd=agreePage";// 회원가입
			// 분기
			break;
		case "member_general" :
			location.href = "/actions/MemberShipAction?cmd=agreePage&child_yn=N";// 회원가입
			break;
		case "member_child" :
			location.href = "/actions/MemberShipAction?cmd=agreePage&child_yn=Y";// 회원가입
			break;
		case "idsearch" :
			location.href = "/actions/MemberShipAction?cmd=idsearch";// 아이디찾기
			break;
		case "pwsearch" :
			location.href = "/actions/MemberShipAction?cmd=pwsearch";// 비밀번호찾기
			break;
		case "event" :
			location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/customer/event_list.jsp";// 이벤트
			break;
		case "list_open" :
			// document.all.Layer.style.visibility = "visible";
			// layer_view_open(); //전체 제품 이름 메뉴 열기
			break;
		case "list_close" :
			// layer_view_close(); //전체 제품 이름 메뉴 닫기
			break;
		case "home" :
			location.href = "/actions/CategorySiteMainView?cmd=view";// 메인으로가기
			break;
		case "mycanon" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/CategoryMyCanonMainView?cmd=view";// 마이캐논
			break;
		case "webzine" :
			location.href = "/actions/PlayCkciWebzineAction?cmd=view";// 웹진
			break;

		case "0//" :
			location.href = "/actions/CategoryProductMainView?cmd=view"; // 프로덕트
																			// 메인
			break;
		case "0/0" :
			location.href = "/actions/ProductMainEosList?cmd=list"; // EOS시리즈
			break;
		case "0/1" :
			location.href = "/actions/ProductMainIxusList?cmd=list"; // IXUS시리즈
			break;
		case "0/2" :
			location.href = "/actions/ProductMainPowershotList?cmd=list"; // 파워샷시리즈
			break;
		case "0/3" :
			location.href = "/actions/ProductMainLensList?cmd=list"; // EF 렌즈
			break;
		case "0/4" :
			location.href = "/actions/ProductMainPrinterList?cmd=list"; // 포토프린터
			break;
		case "0/5" :
			location.href = "/actions/ProductMainCamList?cmd=list"; // 캠코더
			break;
		case "0/6" :
			location.href = "/actions/ProductMainProjectorList?cmd=list"; // 프로젝터
			break;
		case "0/7" :
			location.href = "/actions/ProductMainAccList?cmd=list&menu_id=7001"; // 악세서리
			break;
		case "0/8" :
			location.href = "/actions/ProductMainCatalogList?cmd=list"; // 카탈로그
			break;
		case "0/9" :
			location.href = "/actions/ProductMainSterilizeDigitalList?cmd=list"; // 단종제품
			break;

	    case "1//" :
			location.href = "/actions/CategoryPlexMainView?cmd=view";// 클럽메인
			break;
	    case "1/0" :
			location.href = "/actions/CanonplexIntroAction?cmd=view";// 캐논플렉스
																		// //
																		// "/actions/GalleryCkciOpenList?cmd=list&is_first_load=Y";
																		// //"/actions/GalleryCkciBestAction?cmd=view";//베스트
																		// 갤러리
			break;
	    case "1/1" :
			location.href = "/actions/CategoryEstoreMainView?cmd=view";// 쇼핑 //
																		// "/actions/AcademyIntroduce?cmd=list";//아카데미
			break;
	    case "1/2" :
			location.href = "/actions/AcademyNewMainAction?cmd=view";// 아카데미
																		// //
																		// "/actions/ReviewCkciProList?cmd=list";//전문가
																		// 리뷰
			break;
	    case "1/3" :
			location.href =  "/actions/PlayCkciPeopleList?cmd=list";// 캐논피플
			break;
	    case "1/4" :
			location.href =  "/actions/ReviewCkciProList?cmd=list";// 제품리뷰
			break;
	    case "1/5" :
			location.href =  "/actions/PlayCkciWebzineAction?cmd=view";// 웹진
			break;
	    case "1/6" :
			location.href =  "/actions/PlayCkciPointMallList?cmd=list";// 포인트몰
			break;
		case "1/7" :
			pageTracker._trackPageview('/PritingService/GNB.html');
			jsMainFotoAction();// 인화샵
			break;
	    case "1/8" :
			location.href = "/actions/AcademyNewProlectureList?cmd=list";	// 전문가
																			// 노하우
			break;

		case "2//" :
			location.href =  "/actions/CategoryGalleryMainView?cmd=view";// 갤러리
			break;
		case "2/0" :
			location.href =  "/actions/GalleryCkciBestAction?cmd=view";// 베스트샷
			break;
		case "2/1" :
			location.href =  "/actions/GalleryCkciOpenList?cmd=list&is_first_load=Y";// 포토오픈갤러리
			break;
		case "2/2" :
			location.href =  "/actions/PlayCkciPartyJoinList?cmd=list";// 케논파티
			break;
		case "2/3" :
			location.href =  "/actions/PlayTripList?cmd=list";// 이벤트 & 출사
			break;
		case "2/4" :
			location.href =  "/actions/PlayCkciPhotospotList?cmd=list";// 추천촬영지
			break;

		case "3//" :
			location.href = "/actions/CategorySupportMainView?cmd=list";// support
																		// 메인
			break;
		case "3/0" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportRegistAction?cmd=rgst";// 정품등록
			break;
		case "3/1" :
			jsPickup();// 서비스신청
			break;
		case "3/2" :
			location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/support/servicecenter/centermap.jsp";// A/S안내
			break;
		case "3/3" :
			location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/support/canonshop/shop_plaza.jsp";// 캐논
																											// 전문매장
			break;
		case "3/4" :
			// location.href =
			// donwload_url;//"/actions/FrontPage?cmd=list&url=/ckcifront/support/download/firm_list.jsp";//
			// 다운로드
			window.open(donwload_url);
			break;
		case "3/5" :
			jsContact();
			break;
		case "3/6" :
			location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/support/cps/cps_guide.jsp";// CPS
			break;
		case "3/7" :
			location.href = "/actions/SupportAsPolicyAction?cmd=view";// CKCI
																										// A/S정책
			break;
		case "3/8" :
			location.href = "/actions/SupportPicStyleAction?cmd=view";// 픽쳐
																		// 스타일
			break;
		case "3/9" :
			location.href = "/actions/SupportAsPolicyAction?cmd=view";// 서비스
																		// 정책
			break;
		case "3/10" :
			location.href = "/actions/SupportSvcMapList?cmd=list";// 서비스접수/위치안내
			break;
		case "3/11" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportAsPickUpOrdAction?cmd=write";// 픽업
																			// 서비스
			break;
		case "3/12" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/QuickRepairIndexAction?cmd=view";// 퀵 리페어
																		// 서비스
			break;
		case "3/13" :
			location.href = "/actions/SupportAsParcelAction?cmd=view";// 일반 택배
																		// 서비스
			break;
		case "3/14" :
			location.href = "/actions/SupportAsRssAction?cmd=view";// 원격 서비스
			break;
		case "3/15" :
			location.href = "/actions/SupportSvcPlazaList?cmd=list&type=6";// 직영
			break;
		case "3/16" :
			location.href = "/actions/SupportSvcShopList?cmd=list&type=3";// 일반
			break;
		case "3/17" :
			location.href = "/actions/SupportSvcPlazaList?cmd=list&type=7";// 전문
			break;
		case "3/18" :
			location.href = "/actions/SupportSvcShopList?cmd=list&type=1";// 총판
			break;
		case "3/19" :
			location.href = "/actions/SupportCpsMemberAction?cmd=join";// CPS
																		// 안내
			break;
		case "3/20" :
			location.href = "/actions/SupportCpsJrMemberAction?cmd=join";// CPS
																			// JR
																			// //
																			// 안내
			break;
		case "3/21" :
			// location.href =
			// donwload_url;//"/actions/SupportSvcDownload?cmd=view";// 다운로드
			window.open(donwload_url);
			break;
		case "3/22" :
			location.href = "/actions/SupportCpsFavorAction?cmd=view";// CPS
																		// 혜택
			break;
		case "3/23" :
			location.href = "/actions/SupportCpsJrFavorAction?cmd=view";// CPS
																		// Jr 혜택
			break;
		case "3/24" :
			if(!fnChkLogin()) {
				return;
			}

			location.href = "/actions/SupportCpsMemberAction?cmd=join1";// CPS
																		// 가입
			break;
		case "3/25" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportCpsJrMemberAction?cmd=join1";// CPS
																			// Jr
																			// //
																			// 가입
			break;
		case "3/26" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportCpsMyAction?cmd=view";// MY CPS
			break;
		case "3/27" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportCpsJrMyAction?cmd=view";// MY
			break;
		case "3/28" :
			location.href = "/actions/SupportCpsRentAction?cmd=write";// 장비 신청
			break;
		case "3/29" :
			location.href = "/actions/SupportAsPolicyAction?cmd=view";// 서비스
																		// 정책
			break;
		case "3/30" :
			location.href = "/actions/SupportShopGuideAction?cmd=view";// 판매점
																		// 안내
			break;
		case "4//" :	// eStore 메인
			location.href = "/actions/CategoryEstoreMainView?cmd=view";
			break;
		case "4" :	// eStore 섹션
			location.href = "/actions/EstoreGoodsList?cmd=list&ctg_id="+value+"&level=L";
			break;

		case "favo" :	// 관심상품리스트
			fnGoWishList();
			break;

		case "5/1" :
			jsMylecture();// 나의신청현황
			break;
			// ////////////////////////////////////////////마이캐논
		case "6/1" :	// 1:1문의 리스트
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonOneAndOneList?cmd=list";
			break;
		case "6/2" :	// 마이 정품 등록 현황
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonSerialMgrList?cmd=list";
			break;
		case "6/3" :	// 마이포인트
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonServicePointList?cmd=list";
			break;
		case "6/4" :	// 1:1문의 쓰기
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonOneAndOneWriteAction?cmd=write";
			break;
		case "6/5" :	 // 픽업서비스현황
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonPickupList?cmd=list";
			break;
		case "6/6" :	// 퀵리페어서비스현황
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonQuickRepairList?cmd=list";
			break;
		case "6/7" :	// CD/메뉴얼구매현황
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonManualList?cmd=list";
			break;
		case "6/8" :	// 마이갤러리
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonPhotoGalleryList?cmd=list";
			break;
		case "6/9" :	// 주문/배송조회
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonFrontSettleList?cmd=list";
			break;
		case "6/10" :	// 취소/반품신청
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonFrontRefundList?cmd=list&search_refund_type=01";
			break;
		case "6/11" :	// /교환신청
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonFrontRefundList?cmd=list&search_refund_type=02";
			break;
		case "6/12" :	// 쿠폰 리스트
			fnGoMyCoupon();	// 쿠폰현황
			break;
		case "6/13" :	// 마이아카데미
			if(!fnChkLogin()) {
				return;
			}
			if(value == "_self") {
				location.href = "/actions/MyCanonLectureList?cmd=list";
			} else {
				window.open("/actions/MyCanonLectureList?cmd=list");
			}

			break;
		case "6/14" :	// 마이 이벤트 리스트
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonMyEventList?cmd=list";//
			break;
		case "6/15" :	 // 개인정보 수정
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonMemberInfoAction?cmd=write";
			break;
		case "6/16" :	// 비밀번호 수정
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonMemberInfoAction?cmd=memberpwmodify";
			break;
		case "6/17" :	// 마이 서비스
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonPickupList?cmd=list";
			break;
		case "6/18" :	// 관심상품
			fnGoWishList();
			break;
		case "6/19" :	// 마이쇼핑 정보
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonFrontSettleList?cmd=list";
			break;
		case "6/20" :	// 쿠폰등록하기
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/MyCanonCouponAction?cmd=couponreginfo";
			break;
	}
}

// CD-Manual 구매
function fnGoOrderCD() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/support/service/CDManual.jsp";
}

	// 공지사항 링크
	function goNoticeView(seq,gubun){
		// location.href =
		// "/actions/FrontPage?cmd=list&url=/ckcifront/customer/notice_view.jsp?seq="+seq+"&cpage=1&search_type=&search_str=&gubun="+gubun;
		location.href = "/actions/SupportNoticeViewAction?cmd=view&seq="+seq+"&cpage=1&search_type=&search_str=&gubun="+gubun;
	}
	// 프로덕트공지사항 링크
	function goPrtView(seq) {
		// 2011.05.31 수정 ssick2000
		// location.href =
		// "/actions/FrontPage?cmd=list&url=/ckcifront/customer/notice_view.jsp?seq="+seq+"&cpage=1&search_type=&search_str=&gubun=PT";
		location.href = "/actions/SupportNoticeViewAction?cmd=view&seq="+seq+"&cpage=1&search_type=&search_str=&gubun=PT";
	}
	// 이벤트 링
	function goEvent(seq) {
		location.href= "/actions/FrontPage?cmd=list&url=/ckcifront/customer/event_view.jsp?seq="+seq+"&cpage=1";
	}


/**
 * ********************************** 장바구니 관련 Link
 * *************************************************
 */

/**
 * 장바구니 가기
 *
 * @author 김현정
 * @since 2009.09.29
 */
function fnGoStoreCart() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}

	location.href = "/actions/EsettleStoreCartList?cmd=list";
}

/**
 * 장바구니 담기
 *
 * @param cart_yn:
 *            장바구니화면여부(장바구니화면-'Y', 그이외의회면-'N')
 * @param fi_goods_code:
 *            상품코드 (ex f.goods_code)
 * @param fi_quantity:
 *            수량 (ex f.quantity)
 *
 * @author 김현정
 * @since 2009.09.29
 */
function fnInsertBasket(cart_yn, fi_goods_code, fi_quantity, fi_stock_quantity,ctg_id, slct_gift){

	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}


	if ( typeof(document.tempForm) == "undefined" ) {
// alert("로딩중입니다.");
		return;
	}

	with( document.tempForm ){

		var obj = document.getElementById("divTemp");
		obj.innerText = "";

		if( isArray(fi_goods_code) <= 0 ){			// 0건

			alert("선택된 상품이 없습니다.[SC01]");
			return;
		}else if( isArray(fi_goods_code) == 1 ){	// 1건



			if( fi_goods_code.value == ""){

				alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC02]");
				return;
			}

			if(typeof(fi_stock_quantity)!="undefined" && fi_stock_quantity.value<1) {
				alert("품절된 상품이 존재합니다. 다시 시도해주세요.");
				return;
			}

			// 악세사리 일 경우
			if('100006' == ctg_id){
				alert("본 제품은 개봉하시면 절대 반품이 불가하오니,\n고객님이 갖고 계신 제품과 호환되는지\n구입전에 반드시 대응기종을 확인하시기 바랍니다.");
			}

			putDomInput(obj, "cart_yn", cart_yn);	// 장바구니 화면여부

			putDomInput(obj, "goods_code", fi_goods_code.value);

			if( isArray(fi_quantity) < 1 || fi_quantity.value == "" ) {
				putDomInput(obj, "quantity", 1);
			}else {
				putDomInput(obj, "quantity", fi_quantity.value);
			}


			// 선택 사은품 체크
			if(slct_gift != "" && typeof(slct_gift) != "undefined") {
				if(slct_gift.value == "") {
					alert("사은품을 선택해 주세요");
					slct_gift.focus();
					return;
				}

				putDomInput(obj, "gift_seq", slct_gift.value);
			}

		}else{									// 배열



			putDomInput(obj, "cart_yn", cart_yn);	// 장바구니 화면여부
			var selTf = false;








			for( var idx = 0; idx < isArray(fi_goods_code); idx++ ){

				if( fi_goods_code[idx].value == ""){

					alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC03]");
					return;
				}

				if( fi_goods_code[idx].checked == true ) {	// 선택된 상품처리

					if(fi_goods_code[idx].plan_goods_yn != "0")
					{
						alert("["+fi_goods_code[idx].goods_name+"]\n\n 상품은 바로구매만 가능한 상품인 관계로 장바구니에 담을 수 없습니다.");
						fi_goods_code[idx].checked = false;
						return;
					}// end if

					if(typeof(fi_stock_quantity)!="undefined" && fi_stock_quantity[idx].value<1)
					{
						alert(fi_goods_code[idx].goods_name+" 상품은  품절상품입니다. \n확인후 다시시도해 주십시오.");
						fi_goods_code[idx].checked = false;
						return;
					}// end if

					selTf = true;
					putDomInput(obj, "goods_code", fi_goods_code[idx].value);

					if( isArray(fi_quantity) <= 1 || fi_quantity[idx].value == "" ) {
						putDomInput(obj, "quantity", 1);
					} else {
						putDomInput(obj, "quantity", fi_quantity[idx].value);
					}
				}
			}

			// 악세사리 일 경우
			if(selTf) {
				if('100006' == ctg_id){
					alert("본 제품은 개봉하시면 절대 반품이 불가하오니,\n고객님이 갖고 계신 제품과 호환되는지\n구입전에 반드시 대응기종을 확인하시기 바랍니다.");
				}
			}

			if(!selTf) {
				alert("선택된 상품이 없습니다.");
				return;
			}

		}

		cmd.value = "insert";
		target = "action_frame";
		action = "EsettleStoreCartAction";
		submit();
	}
}


/**
 * 하나의 상품을 장바구니 담기
 *
 * @param cart_yn:
 *            장바구니화면여부(장바구니화면-'Y', 그이외의회면-'N')
 * @param goods_code:
 *            상품코드
 * @param quantity:
 *            수량
 * @param stock_quantity:
 *            실재고 수량
 *
 * @author 손성택
 * @since 2009.10.22
 */
function fnOneInsertBasket(cart_yn, goods_code, quantity, stock_quantity,ctg_id){
// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	// 악세사리 일 경우
	if('100006' == ctg_id){
		alert("본 제품은 개봉하시면 절대 반품이 불가하오니,\n고객님이 갖고 계신 제품과 호환되는지\n구입전에 반드시 대응기종을 확인하시기 바랍니다.");
	}

	if ( typeof(document.tempForm) == "undefined" ) {
// alert("로딩중입니다.");
		return;
	}

	with( document.tempForm ){

		var obj = document.getElementById("divTemp");
		obj.innerText = "";



		if( goods_code == ""){

			alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC02]");
			return;
		}

		if( stock_quantity<1){

			alert("일시품절된 상품은 장바구니에 담을 수 없습니다..[SC03]");
			return;
		}

		putDomInput(obj, "cart_yn", cart_yn);	// 장바구니 화면여부

		putDomInput(obj, "goods_code", goods_code);

		if( quantity.value == "" ) {
			putDomInput(obj, "quantity", 1);
		}else {
			putDomInput(obj, "quantity", quantity);
		}

		cmd.value = "insert";
		target = "action_frame";
		// action = "EsettleOrderInfoAction";
		action = "EsettleStoreCartAction";
		submit();

	}
}

/**
 * 장바구니 담기후 처리
 *
 * @author 김현정
 * @since 2009.12.04
 */
function fnStoreCartAddRst(vCartYn) {
	if(vCartYn == "Y") {	// 장바구니 페이지에서 처리시
		alert("해당 상품이 장바구니에 추가되었습니다.");
		parent.fnGoStoreCart();
	} else {	// 그 이외의 화면
		if(!confirm("해당 상품이 장바구니에 추가되었습니다.\n장바구니로 이동하시겠습니까?")) {
			location.replace("");
		} else {
			parent.fnGoStoreCart();
		}
	}
}

/**
 * ********************************** 주문 관련 Link
 * *************************************************
 */

/**
 * 주문하기
 *
 * @param cart_yn:
 *            장바구니화면여부(장바구니 주문-'Y', 상품상세 바로주문-'N')
 * @param fi_goods_code:
 *            상품코드 (ex f.goods_code)
 * @param fi_quantity:
 *            수량 (ex f.quantity)
 * @param slct_gift :
 *            사은품 선택박스
 * @param org_gift :
 *            변경전 사은품
 *
 * @author 김현정
 * @since 2009.10.15
 */
function fnOrder(cart_yn, fi_goods_code, fi_quantity, fi_stock_quantity, fi_goods_name, fi_order_limit_quantity, slct_gift, org_gift){

	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}

	if ( typeof(document.tempForm) == "undefined" ) {
// alert("로딩중입니다.");
		return;
	}

	with( document.tempForm ){

		var obj = document.getElementById("divTemp");
		obj.innerText = "";

		if( isArray(fi_goods_code) <= 0 ){			// 0건

			alert("선택된 상품이 없습니다.[SC01]");
			return;
		}else if( isArray(fi_goods_code) == 1 ){	// 1건

			if( fi_goods_code.value == ""){

				alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC02]");
				return;
			}

			if( fi_goods_code.checked == false ) {	// 선택된 상품처리
				alert("선택된 상품이 없습니다.");
				return;
			}

			if(typeof(fi_stock_quantity) != "undefined") {
				if(fi_stock_quantity.value < 1) {
					alert(fi_goods_name.value + "은(는) 품절된 상품입니다.\n다시 시도해주세요.");
					return;
				}
				if(parseInt(fi_quantity.value) > parseInt(fi_stock_quantity.value)) {
					alert(fi_goods_name.value + "\n제품의 재고 수량이 부족합니다. 다시 시도해주세요.\n");
					return;
				}
				if(parseInt(fi_order_limit_quantity.value) > 0	// 주문제한 수량이 있으며
					&& parseInt(fi_quantity.value) > parseInt(fi_order_limit_quantity.value)	// 주문제한수량
																								// 초과
																								// 주문시
					)
				{
					alert(fi_goods_name.value + "\n의 최대주문수량은 " + fi_order_limit_quantity.value + "개 입니다.");
					return;
				}
			}

			putDomInput(obj, "cart_yn", cart_yn);	// 장바구니 화면여부

			putDomInput(obj, "goods_code", fi_goods_code.value);

			if( isArray(fi_quantity) < 1 || fi_quantity.value == "" ) {
				putDomInput(obj, "quantity", 1);
			}else {
				putDomInput(obj, "quantity", fi_quantity.value);
			}

			if(typeof(slct_gift) != "undefined" && slct_gift != "") {
				if(org_gift.value != "none") {
					if(slct_gift.value == "") {
						alert("사은품을 선택해 주세요.");
						slct_gift.focus();
						return;
					}

					if(typeof(org_gift) != "undefined" && org_gift != "") {
						if(slct_gift.value != org_gift.value ) {
							alert("선택하신 사은품의 변경사항을 저장해 주세요.");
							slct_gift.focus();
							return;
						}
					}

					putDomInput(obj, "gift_seq", slct_gift.value);
				}
			}

		}else{									// 배열
			putDomInput(obj, "cart_yn", cart_yn);	// 장바구니 화면여부

			var selTf = false;
			for( var idx = 0; idx < isArray(fi_goods_code); idx++ ){


				if( fi_goods_code[idx].value == ""){

					alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC03]");
					return;
				}

				if( fi_goods_code[idx].checked == true ) {	// 선택된 상품처리
					selTf = true;

					if(typeof(fi_stock_quantity[idx])!="undefined") {
						if(fi_stock_quantity[idx].value < 1) {
							alert(fi_goods_name[idx].value + "은(는) 품절된 상품입니다.\n다시 시도해주세요.");
							return;
						}

						if(parseInt(fi_quantity[idx].value) > parseInt(fi_stock_quantity[idx].value)) {
							alert(fi_goods_name[idx].value + "\n제품의 재고 수량이 부족합니다. 다시 시도해주세요.");
							return;
						}
						if(parseInt(fi_order_limit_quantity[idx].value) > 0	// 주문제한
																			// 수량이
																			// 있으며
							&& parseInt(fi_quantity[idx].value) > parseInt(fi_order_limit_quantity[idx].value)	// 주문제한수량
																												// 초과
																												// 주문시
							)
						{
							alert(fi_goods_name[idx].value + "\n의 최대주문수량은 " + fi_order_limit_quantity[idx].value + "개 입니다.");
							return;
						}
					}

					putDomInput(obj, "goods_code", fi_goods_code[idx].value);

					if( isArray(fi_quantity) <= 1 || fi_quantity[idx].value == "" ) {
						putDomInput(obj, "quantity", 1);
					} else {
						putDomInput(obj, "quantity", fi_quantity[idx].value);
					}

					// 사은품 선택
					if(typeof(slct_gift) != "undefined" && slct_gift != "") {
						if(org_gift[idx].value != "none") {
							if(typeof(slct_gift[idx])!="undefined") {
								if( slct_gift[idx].value == ""){
									alert("사은품을 선택해 주세요");
									slct_gift[idx].focus();
									return;
								}

								if(typeof(org_gift[idx]) != "undefined" && org_gift != "") {
									if(slct_gift[idx].value != org_gift[idx].value ) {
										alert("선택하신 사은품의 변경사항을 저장해 주세요.");
										slct_gift[idx].focus();
										return;
									}
								}

								putDomInput(obj, "gift_seq", slct_gift[idx].value);
							}
						}
					}
				}
			}
			if(!selTf) {
				alert("선택된 상품이 없습니다.");
				return;
			}
		}

		cmd.value = "insert";
		target = "action_frame";
		action = "EsettleOrderInfoAction";
		submit();
	}
}



/**
 * 하나의 상품 주문하기
 *
 * @param cart_yn:
 *            장바구니화면여부(장바구니 주문-'Y', 상품상세 바로주문-'N')
 * @param v_goods_code:
 *            상품코드 (ex f.goods_code)
 * @param fi_quantity:
 *            수량 (ex f.quantity)
 *
 * @author 김현정
 * @since 2009.10.21
 */
function fnOrderOne(v_cart_yn, v_goods_code, v_quantity, v_stock_quantity, v_goods_name, v_order_limit_quantity,v_ctg_id, slct_gift){

	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}

	if ( typeof(document.tempForm) == "undefined" ) {
// alert("로딩중입니다.");
		return;
	}
	// 악세사리 일 경우
	if('100006' == v_ctg_id){
		alert("본 제품은 개봉하시면 절대 반품이 불가하오니,\n고객님이 갖고 계신 제품과 호환되는지\n구입전에 반드시 대응기종을 확인하시기 바랍니다.");
	}
	with( document.tempForm ){

		var obj = document.getElementById("divTemp");
		obj.innerText = "";


		if( v_goods_code == ""){

			alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC02]");
			return;
		}

		if(typeof(v_stock_quantity) != "undefined") {
			if(v_stock_quantity < 1) {
				alert(v_goods_name + "은(는) 품절된 상품입니다.\n다시 시도해주세요.");
				return;
			}
			if(parseInt(v_quantity) > parseInt(v_stock_quantity)) {
				alert(v_goods_name + "\n제품의 재고 수량이 부족합니다. 다시 시도해주세요.");
				return;
			}
			if(parseInt(v_order_limit_quantity) > 0	// 주문제한 수량이 있으며
				&& parseInt(v_quantity) > parseInt(v_order_limit_quantity)	// 주문제한수량
																			// 초과
																			// 주문시
				)
			{
				alert(v_goods_name + "\n의 최대주문수량은 " + v_order_limit_quantity + "개 입니다.");
				return;
			}
		}

		putDomInput(obj, "cart_yn", v_cart_yn);	// 장바구니 화면여부

		putDomInput(obj, "goods_code", v_goods_code);

		if( isArray(v_quantity) < 1 || v_quantity == "" ) {
			putDomInput(obj, "quantity", 1);
		}else {
			putDomInput(obj, "quantity", v_quantity);
		}

		// 선택 사은품 체크
		if(slct_gift != "" && typeof(slct_gift) != "undefined") {
			if(slct_gift.value == "") {
				alert("사은품을 선택해 주세요");
				slct_gift.focus();
				return;
			}

			putDomInput(obj, "gift_seq", slct_gift.value);
		}

		cmd.value = "insert";
		target = "action_frame";
		action = "EsettleOrderInfoAction";
		submit();
	}
}




/**
 * ********************************** 위시리스트 관련 Link
 * *************************************************
 */


/**
 * 위시리스트 가기
 */
function fnGoWishList() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/MyCanonInterestGoodsList?cmd=list";
}


/**
 * 위시리스트 담기
 *
 * @param fi_goods_code:
 *            상품코드 (ex f.goods_code)
 *
 * @author sst
 * @since 2009.10.15
 */
function fnInsertAllWishlist(fi_goods_code){

	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}

	goods_code="";

	if ( typeof(document.tempForm) == "undefined" ) {
// alert("로딩중입니다.");
		return;
	}

	with( document.tempForm ){

		var obj = document.getElementById("divTemp");
		obj.innerText = "";

		if( isArray(fi_goods_code) <= 0 ){			// 0건

			alert("선택된 상품이 없습니다.[SC01]");
			return;
		}else if( isArray(fi_goods_code) == 1 ){	// 1건

			if( fi_goods_code.value == ""){

				alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC02]");
				return;
			}

			goods_code=fi_goods_code.value;

			DWRSettle.insertWishList(goods_code, resultReturnWishList);

		}else{

			var selTf = false;
			for( var idx = 0; idx < isArray(fi_goods_code); idx++ ){

				if( fi_goods_code[idx].value == ""){

					alert("상품ID가 잘못 전달되었습니다. 다시 시도해주세요.[SC03]");
					return;
				}

				if( fi_goods_code[idx].checked == true ) {	// 선택된 상품처리
					selTf = true;
					goods_code += fi_goods_code[idx].value+"#";
				}
			}
			if(!selTf) {
				alert("선택된 상품이 없습니다.");
				return;
			}

			goods_code = goods_code.substring(0,goods_code.length-1);
			// alert(goods_code);

			DWRSettle.insertAllWishList(goods_code, resultReturnWishList);
		}
	}
}

	/**
	 * 위시리스트 한건추가하기
	 *
	 * @param v_goods_code:
	 *            상품코드 value값 (ex f.goods_code.value)
	 */
	function fnInsertAllWishlistOne(v_goods_code) {
		// 로그인 체크
		if(!fnChkLogin()) {
			return;
		}

		DWRSettle.insertWishList(v_goods_code, resultReturnWishList);
	}

/**
 * ********************************** 마이캐논 관련 Link
 * *************************************************
 */

// 배송현황 확인
function goDeliveryStatus(arg) {
	var surl = "http://www.hlc.co.kr/hydex/jsp/tracking/trackingViewCus.jsp?InvNo=" + arg;
	// var surl =
	// "http://www.hydex.net/ehydex/jsp/home/distribution/tracking/tracingNView.jsp?param1=222902&param2="
	// + f.order_code.value;
	var name = "DELIVERY_POPUP";
	var Top  = (window.screen.availHeight - 700) / 2;
	var Left = (window.screen.availWidth  - 900) / 2;
	var Feature = "fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=" + Left + ",top=" + Top + ",width=650,height=800";
	window.open(surl, name, Feature);
}


// //////////////
// PG 매출전표 팝업 링크
function fnShowSaleSlipPop(s_cd, o_cd, div) {
	// 신용카드 결제:SC0010
	if(div == 'A'){
		popupWin =  window.open( "https://pgweb.dacom.net/MpFlowCtrl?eventDiv1=search&eventDiv2=getReceipt&TRANSACTIONID="+s_cd+"&SYSTEM=NEW", "popWinName","scrollbars=yes,width=440,height=700,resize=1,left=100,top=50" );
	// 실시간 계좌이체시:SC0030
	}else if(div == 'B'){
		popupWin =  window.open( "https://pg.dacom.net/transfer/cashreceipt.jsp?orderid="+o_cd+"&mid=canonkorea02&servicetype=SC0030", "popWinName","scrollbars=yes,width=420,height=600,resize=1,left=100,top=50" );
	// 무통장입금시:SC0040
	}else if(div == 'C'){
		popupWin =  window.open( "https://pg.dacom.net/transfer/cashreceipt.jsp?orderid="+o_cd+"&mid=canonkorea03&servicetype=SC0040&seqno=001", "popWinName","scrollbars=yes,width=420,height=600,resize=1,left=100,top=50" );
	}
}

/**
 * 결제 상세 페이지
 *
 * @author 김현정
 * @since 2008.11.05
 *
 * @param :
 *            v_order_code 주문코드
 */
function fnGoSettleDtlView(v_order_code) {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}

// location.href = "/actions/EmyCanonFrontSettleAction?cmd=view&order_code=" +
// v_order_code;
	window.open('/actions/MyCanonFrontSettleAction?cmd=view&order_code='+v_order_code+'','popup_view','width=690,height=720,statubar=no,scrollbars=no');

}

/**
 * 주문내역 리스트
 *
 * @author 김현정
 * @since 2008.11.06
 */
function fnGoSettleList() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}

	location.href = "/actions/MyCanonFrontSettleList?cmd=list";
}


/**
 * 쿠폰 다운로드 팝업
 */
 /*
	 * function fnCpnDn(no) { // 로그인 체크 if(!fnChkLogin()) { return; }
	 *
	 * var width = 400; var height = 500; var wid = (screen.width)/2 - width/2 ;
	 * var hei = (screen.height)/2 - height/2; var param = "&coupon_seq="+no;
	 * var win = window.open("/actions/EstoreCouponDetailView?cmd=view" + param,
	 * "coupond", "menubar=no, scrollbars=no, resizable=no, width=" + width + ",
	 * height=" + height+ ",top=" + hei + ",left=" + wid + ""); win.focus(); }
	 */

// 쿠폰적용상품 팝업
function fnUsableGoods(seq) {
	if ( seq == "") {
		alert("올바른 링크가 아닙니다. 다시시도해 주십시오.");
		return;
	}
	var url="/actions/EstoreCouponGoodsList?cmd=list";
	var param = "&coupon_seq="+seq;
	window.open(url + param, 'test', "menubar=no, scrollbars=yes, resizable=no, width=" + 620 + ", height=" + 425);
}

/**
 * ********************************** 상품 전시관련 Link
 * *************************************************
 */

/**
 * 이스토어 메인
 *
 * @author 김현정
 * @since 2008.11.06
 */
function fnGoEstoreMainView() {
	location.href = "/actions/CategoryEstoreMainView?cmd=view";
}

/**
 * @author 손성택
 */
function fnListType(type){
	var obj = document.GoodsPageForm;
	obj.list_type.value=type
	obj.action="/actions/EstoreGoodsList";
	obj.submit();
}

/**
 * @author 손성택
 */
function fnOrderbyType(type){
	var obj = document.GoodsPageForm;

	obj.orderby_type.value=type

	obj.action="/actions/EstoreGoodsList";
	obj.submit();
}

/**
 * 상품상세
 *
 * @author 손성택
 */
function fnViewDetail(v_goods_code, v_ctg_id, v_accYN, gift_seq){
	var url = "/actions/EstoreGoodsDetailView?cmd=view&goods_code=" + v_goods_code;
	if(typeof(v_ctg_id) != "undefined" && v_ctg_id != "")
	{
		url += "&ctg_id="+v_ctg_id;
	}

	if(typeof(gift_seq) != "undefined" && gift_seq != "" && gift_seq > 0) {
		if(!confirm("해당 상품은 사은품을 선택해야 주문이 가능합니다. \n\n상품상세로 이동하시겠습니까?")) {
			return;
		}

	}

	location.href = url;

}

/**
 * 팝업에서 상품상세
 *
 * @author 손성택
 */
function fnViewDetail_P(v_goods_code, v_ctg_id, v_accYN){
// if(v_accYN == true || v_accYN == "Y")
// { // 악세사리
// opener.location.href =
// "/actions/EstoreAccGoodsDetailView?cmd=view&goods_code=" + v_goods_code +
// "&ctg_id="+v_ctg_id;
// }
// else
// {
		opener.location.href = "/actions/EstoreGoodsDetailView?cmd=view&goods_code=" + v_goods_code + "&ctg_id="+v_ctg_id;
// }//end if
	window.self.close();
}

/**
 * 상품상세
 *
 * @author
 */
function fnViewDetailBlank(v_goods_code, v_ctg_id, v_accYN){

// if(v_accYN == true || v_accYN == "Y") { // 악세사리
// window.open("/actions/EstoreAccGoodsDetailView?cmd=view&goods_code=" +
// v_goods_code + "&ctg_id="+v_ctg_id);
// } else {
		window.open("/actions/EstoreGoodsDetailView?cmd=view&goods_code=" + v_goods_code + "&ctg_id="+v_ctg_id);
// }
}

/**
 * @author 손성택
 */
function goGoodsList(level,ctg_id){
	location.href="/actions/EstoreGoodsList?cmd=list&level="+level+"&ctg_id="+ctg_id+"";
}

function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}

function getCookie(name)
{
	var nameOfCookie = name + "=";
	var x = 0;
	 while(x <= document.cookie.length)
	{
		var y = (x+nameOfCookie.length);
	if(document.cookie.substring(x,y) == nameOfCookie)
	{
		if((endOfCookie=document.cookie.indexOf(";",y)) == -1)
		{
			endOfCookie = document.cookie.length;
		}
		return unescape(document.cookie.substring(y,endOfCookie));
	}
     x= document.cookie.indexOf(" ", x) + 1;
	if(x==0)
		break;
	}
	return " ";
}

function setCookie(name,value,expiredays)
{
  var todayDate = new Date();
  todayDate.setDate(todayDate.getDate() + expiredays);
  document.cookie = name + "=" + escape(value) + "; path=/; expired="
  todayDate.toGMTString() + ";" // path= 는쿠키가 저장될 위치 , 위치지정안하면 웹문서가 있는폴더로 저장된다.
}

/**
 * 오늘본 상품 쿠키 설정
 *
 */
function todayGoods(goods_code){// 오늘본상품

		// setCookie("todayGoods", "",0);

		var checkCnt = 0;
		var checkRealCnt=0;
		var checkGoodsCode = "";

		var todayGoods = getCookie("todayGoods");
		var arrTodayGoods = todayGoods.split(", ");

		inToday=true;
		todayGoods = goods_code;
		for(j=0;j<arrTodayGoods.length;j++){
			if(arrTodayGoods[j]==goods_code){
				inToday=false;
			}else{
				if(arrTodayGoods[j]!=""){
					todayGoods += ", " + arrTodayGoods[j];
				}
			}
		}

		setCookie("todayGoods", todayGoods,7);

}

/**
 * 비교함 담기 목록에서 여러개를 한번에 비교함에 담을 때 사용하는 메소드
 *
 * @author 손성택
 */
function compareGoods(){// 상품비교 페이지

		// setCookie("compareGoods", "");
		var obj = document.goodsListForm;

		var checkCnt = 0;
		var checkRealCnt=0;
		var checkGoodsCode = "";

		var compareGoods = ltrim(getCookie("compareGoods"));
		var flag = "";
		var arrCompareGoods = 0;

		if(compareGoods != "") {
			arrCompareGoods = compareGoods.split(", ");
		}

		if(compareGoods=="")
		{
			flag="false";
		}
		else
		{
			flag="true";
		}// end else

		if(obj.chkGoods == null)
		{
			alert("등록된 이스토어 상품이 없습니다.");
			return;
		}// end if

		for(i=0;i<obj.chkGoods.length;i++)
		{
			if(obj.chkGoods[i].checked)
			{

				inCompare=true;
				for(j=0;j<arrCompareGoods.length;j++)
				{
					if(arrCompareGoods[j]==obj.chkGoods[i].value)
					{
						inCompare=false;
					}// end if
				}// end for

				if(inCompare)
				{
					checkGoodsCode += obj.chkGoods[i].value +", "
					checkRealCnt++;
				}// end if
				checkCnt++;

			}// end if
		}// end for

		if(checkCnt>0){

			checkGoodsCode = checkGoodsCode.substring(0,checkGoodsCode.length-2);

			/**
			 * */
			if(arrCompareGoods.length == 3)
			{
				alert("최대 3개의 상품을 비교 할 수 있습니다. \n\n 이미  "+arrCompareGoods.length+"개의 상품이 등록되어 있어서 "+checkCnt+"개의 상품을 추가 할 수 없습니다.");

				viewCompareGoods();
				return;
			}// end if

			if(flag=="false")
			{
				if((arrCompareGoods.length + checkCnt) >=5)
				{
					alert("최대 3개의 상품을 비교 할 수 있습니다. \n\n 이미  "+arrCompareGoods.length+"개의 상품이 등록되어 있어서 "+checkCnt+"개의 상품을 추가 할 수 없습니다.");
					viewCompareGoods();
					return;
				}// end if
			}// end if

			// alert(checkGoodsCode);
		}else{
			alert("선택된 상품이 없습니다.");
			return;
		}// end else

		if(checkCnt>3){
			alert("상품비교는 3개까지 가능합니다.");
			return;
		}





		var arrCompareGoodsCnt = arrCompareGoods.length;

		if(arrCompareGoodsCnt+checkRealCnt>=4)
		{
			alert("최대 3개의 상품을 비교 할 수 있습니다. \n\n 이미 "+arrCompareGoodsCnt+"개의 상품이 등록되어 있어서 "+checkRealCnt+"개의 상품을 추가 할 수 없습니다.");
			viewCompareGoods();
			return;
		}

		if(compareGoods!=""){
			if(checkGoodsCode!=""){
				compareGoods =  compareGoods + ", " + checkGoodsCode;
			}
		}else{
			compareGoods = checkGoodsCode;
		}

		setCookie("compareGoods", compareGoods,0);


		var width=820; // 안선아 주임님. 팝업사이즈 가로 변경 805로..
  		var height=600;


	  	var wid = (screen.width)/2 - width/2 ;
		var hei = (screen.height)/2 - height/2;

		theURL = "/actions/EstoreCompareGoods?cmd=list&compare_goods_code=" + compareGoods;

		var win = window.open(theURL , "compareGoods", "menubar=no, scrollbars=yes, resizable=no, width=" + width + ", height=" + height+ ",top=" + hei + ",left=" + wid + "");
		win.focus();
}


/**
 * 비교함 담기 목록에서 여러개를 한번에 비교함에 담을 때 사용하는 메소드
 *
 * @author 손성택
 */
function viewCompareGoods(){// 상품비교 페이지

		var compareGoods = ltrim(getCookie("compareGoods"));


		if(compareGoods!="")
		{
			var width=820;	// 2009-11-27 21시 수정. by mercurii
			var height=600;	// 2009-11-27 21시 수정. by mercurii


			var wid = (screen.width)/2 - width/2 ;
			var hei = (screen.height)/2 - height/2;

			theURL = "/actions/EstoreCompareGoods?cmd=list&compare_goods_code=" + compareGoods;

			var win = window.open(theURL , "compareGoods", "menubar=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height+ ",top=" + hei + ",left=" + wid + "");
			win.focus();
		}
		else
		{
			alert("비교함에 담긴 상품이 없습니다.");
		}// end else

}


/**
 * 비교함 담기 목록에서 여러개를 한번에 비교함에 담을 때 사용하는 메소드
 *
 * @author 손성택
 */
function compareOneGoods(goods_code){// 상품비교 페이지

		// setCookie("compareGoods", "");
		var obj = document.goodsListForm;

		var checkCnt = 0;
		var checkRealCnt=0;
		var checkGoodsCode = "";

		var compareGoods = ltrim(getCookie("compareGoods"));
		var arrCompareGoods = compareGoods.split(", ");


		inCompare=true;
		for(j=0;j<arrCompareGoods.length;j++){
			if(arrCompareGoods[j]==goods_code){
				inCompare=false;
			}
		}


		if(inCompare){// 없는 상품일경우

			if(arrCompareGoods.length>2){// 이미 3개의 상품이 담겨 있을 경우
				alert("상품비교는 3개까지 가능합니다.");
			}else{// 아직 3개가 안될경우

				if(compareGoods==""){// 쿠키에 값이 없을때...
					compareGoods = goods_code;
				}else{
					compareGoods+= ", "+goods_code;
				}

			}
		}else{// 이미 등록되어있는 상품일 경우
			alert("이미등록된 상품입니다..");
		}




		setCookie("compareGoods", compareGoods,0);


		var width=820;
  		var height=800;


	  	var wid = (screen.width)/2 - width/2 ;
		var hei = (screen.height)/2 - height/2;

		theURL = "/actions/EstoreCompareGoods?cmd=list&compare_goods_code=" + compareGoods;

		var win = window.open(theURL , "compareGoods", "menubar=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height+ ",top=" + hei + ",left=" + wid + "");
		win.focus();
}

/**
 * @author 손성택
 */
function deleteCompare(){

	// setCookie("compareGoods", "");
		var obj = document.goodsListForm;

		var checkCnt = 0;
		var checkRealCnt=0;
		var checkGoodsCode = "";

		var compareGoods = getCookie("compareGoods");
		var arrCompareGoods = compareGoods.split(", ");

		if(obj.chkGoods == null)
		{
			alert("삭제할 상품이 없습니다.");
			return;
		}// end if

		for(i=0;i<arrCompareGoods.length;i++){
			var inCompare=true;
			if(typeof(obj.chkGoods.length)=="undefined"){
				if(obj.chkGoods.checked){
					if(arrCompareGoods[i]==obj.chkGoods.value){
						inCompare=false;
					}
					checkCnt++;
				}
			}else{
				for(j=0;j<obj.chkGoods.length;j++){
					if(obj.chkGoods[j].checked){
						if(arrCompareGoods[i]==obj.chkGoods[j].value){
							inCompare=false;
						}
						checkCnt++;
					}
				}
			}


			if(inCompare){
				checkGoodsCode += arrCompareGoods[i] +", "
				checkRealCnt++;
			}


		}


		if(checkCnt>0){

			checkGoodsCode = checkGoodsCode.substring(0,checkGoodsCode.length-2);
			// alert(checkGoodsCode);
		}else{
			alert("선택된 상품이 없습니다.");
			return;
		}

		setCookie("compareGoods", checkGoodsCode,0);

		theURL = "/actions/EstoreCompareGoods?cmd=list&compare_goods_code=" + checkGoodsCode;

		location.href=theURL;
}

/**
 * @author 손성택
 */
function go_planshopView(planshop_seq){
	location.href="/actions/EstorePlanshopView?cmd=list&planshop_seq=" + planshop_seq;
}

/**
 * @author 손성택
 */
function viewDetailImg(goods_code){
	var width=732;
	var height=640;


	var wid = (screen.width)/2 - width/2 ;
	var hei = (screen.height)/2 - height/2;

	if(goods_code!=""){


	theURL = "/actions/EstoreGoodsDetailImgView?cmd=view&goods_code=" + goods_code;

	var win = window.open(theURL , "detailImg", "menubar=no, scrollbars=yes, resizable=no, width=" + width + ", height=" + height+ ",top=" + hei + ",left=" + wid + "");
	win.focus();
	}else{
		alert("상품코드가 정확하지 않습니다.")
	}
}

/**
 * 마이크로 사이트로 이동하기
 *
 * @author 손성택
 */
function goMicrosite(theURL){

	var width=1220;
	var height=850;


	var wid = (screen.width)/2 - width/2 ;
	var hei = (screen.height)/2 - height/2;






	var win = window.open(theURL , "microSite", "menubar=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height+ ",top=" + hei + ",left=" + wid + "");
	win.focus();

}

/**
 * @author 손성택
 */
function fnGoLcategory(ctg_id){
	location.href="/actions/EstoreGoodsList?cmd=list&ctg_id="+ctg_id+"&level=L";
}

/**
 * 공지사항 상세보기 페이지로 가기
 *
 * @author 손성택
 */
function goNoticeView(seq,gubun){
	// location.href =
	// "/actions/FrontPage?cmd=list&url=/ckcifront/customer/notice_view.jsp?seq="+seq+"&cpage=1&search_type=&search_str=&gubun="+gubun;
	location.href = "/actions/SupportNoticeViewAction?cmd=view&seq="+seq+"&cpage=1&search_type=&search_str=&gubun="+gubun;
}

/**
 * @author 손성택
 */
function goSupportView(seq){

	// location.href =
	// "/actions/FrontPage?cmd=list&url=/ckcifront/customer/notice_view.jsp?seq="+seq+"&cpage=1&search_type=&search_str=&gubun=SP";
	location.href = "/actions/SupportNoticeViewAction?cmd=view&seq="+seq+"&cpage=1&search_type=&search_str=&gubun=SP";

}
/**
 * @author 손성택
 */
function goCpsView(seq){

	location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/customer/notice_view.jsp?seq="+seq+"&cpage=1&search_type=&search_str=&gubun=CP";
}

/**
 * @author 손성택
 */
function goEventView(seq){

	location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/customer/evemt_view.jsp?seq="+seq+"&cpage=1&search_type=&search_str=&gubun=";
}

/**
 * @author 손성택
 */
function goBodoView(seq){

	window.open("/actions/CompanyUserInfoNewsAction?cmd=view&news_idx="+seq+"");
}

/**
 * 위시리스트 추가하기
 *
 * @author 손성택
 */
function fnAddWishlist(goods_code,chkLogin,ctgid) {
	if(!fnChkLogin()) {
		return;
	}

	DWRSettle.insertWishList(goods_code, resultReturnWishList);
}

/**
 * 위시리스트 추가하기 에러메세지
 *
 * @author 손성택
 */
function errorHandlerWishList(){
	alert("관심상품 추가가 실패하였습니다.");
	consubmit=false;
}

/**
 * 위시리스트 추가하기 결과
 *
 * @author 손성택
 */
function resultReturnWishList(rnum){
	if(rnum >= 1 ){
		alert("상품이 관심상품에 추가되었습니다.");
	 	return;
	}else if(rnum == -1){
		errorHandlerWishList();
	}else if(rnum == -2){
		alert("이미 등록된 상품입니다.");
	}
}

/**
 * 파티 목록
 *
 * @author 손성택
 */
function fnGoPartyList(party_idx) {
	location.href="/actions/PlayCkciPartyJoinList?cmd=list&party_idx="+party_idx;
}

/**
 * 상세보기 페이지 이동(주간베스트샷)
 *
 * @author 손성택
 */
function fnGoGalleryDetailView(openg_idx){

	// location.href =
	// "/actions/GalleryCkciBestAction?cmd=view&best_year="+year+"&best_month="+month+"&go_check=1";
// location.href =
// "/actions/GalleryCkciOpenAction?cmd=view&openg_idx="+openg_idx;
	location.href = "/actions/GalleryPhotoDetailAction?cmd=view&openg_idx="+openg_idx;
}

/**
 * 상세보기 페이지 이동(월간베스트샷)
 *
 * @author 손성택
 */
function fnGoGalleryDetailViewMonth(year,month){

	location.href = "/actions/GalleryCkciBestAction?cmd=view&best_year="+year+"&best_month="+month+"&go_check=1";
	// location.href =
	// "/actions/GalleryCkciOpenAction?cmd=view&openg_idx="+openg_idx;
}

/**
 * 삭제
 *
 * @author 손성택
 */
function fnDeleteWishlist(deleteidx) {

	// 삭제 대상이 존재하는 경우
	if(deleteidx != "") {
		if(confirm("삭제 하시겠습니까?")) {
			DWRSettle.deleteWishList(deleteidx, resultDeleteReturnWishList);
		}
	} else {
		alert("삭제 대상이 선택되지 않았습니다.");
	}
}

function fnDeleteArrWishList(arr_Wish_code) {
	DWRSettle.deleteArrWishList(arr_Wish_code, resultDeleteReturnWishList);
}

/**
 * 위시리스트 추가하기 에러메세지
 *
 * @author 손성택
 */
function errorDeleteHandlerWishList(){
	alert("관심상품 추가가 실패하였습니다.");
	consubmit=false;
}

/**
 * 위시리스트 추가하기 결과
 *
 * @author 손성택
 */
function resultDeleteReturnWishList(rnum){
	if(rnum >= 1 ){
		alert("해당 상품이 관심상품에서 삭제되었습니다.");
		location.reload();
	 	return;
	}else if(rnum == -1){
		errorDeleteHandlerWishList();
	}else if(rnum == -2){
		alert("삭제할 상품이 없습니다. 다시 확인 바랍니다.");
	}
}

/**
 * @author 손성택
 */
function createWeeklyGallery(){

	DWREstore.createWeeklyGallery(resultCreateXMLList);
}

/**
 * @author 손성택
 */
function createMonthGallery(){

	DWREstore.createMonthGallery(resultCreateXMLList);
}

/**
 * @author 손성택
 */
function createCategoryEstore()
{
	DWREstore.createCategoryEstore(resultCreateXMLList);
}// end createCategoryEstore

/**
 *
 * @author mercurii
 */
function createGNBProductList()
{
	DWREstore.createGNBProductList(resultCreateXMLList);
}// end createCategoryEstore

/**
 * XML 생성 결과
 *
 * @author 손성택
 */
function resultCreateXMLList(rnum){
// alert(rnum);
	if(rnum >= 0 ){
		alert("XML이 생성되었습니다.");
		// location.reload();
	 	return;
	}else if(rnum == -1){
		alert("XML이 생성실패했습니다.");
	}else if(rnum == -2){
		// alert("삭제할 상품이 없습니다. 다시 확인 바랍니다.");
	}
}

/*******************************************************************************
 * My캐논관련
 ******************************************************************************/

	function goMenu(szValue) {
		// 로그인 체크
		if(!fnChkLogin()) {
			return;
		}
		// URL
		if(szValue == "A") {
			location.href = "/actions/MyCanonServicePointList?cmd=list";
		} else if(szValue == "B") {
			location.href = "/actions/MyCanonMemberInfoAction?cmd=write";
		} else if(szValue == "C") {
			location.href = "/actions/MyCanonPhotoGalleryList?cmd=list";
		} else if(szValue == "D") {
			location.href = "/actions/FrontPage?cmd=list&url=/ckcifront/support/contact/Q_list.jsp";
		} else if(szValue == "E") {
			// location.href = "/actions/MyCanonSerialList?cmd=list";
			location.href = "/actions/MyCanonPickupList?cmd=list";
		} else if(szValue == "F") {
			location.href = "/actions/SupportAsPolicyAction?cmd=view";
		} else if(szValue == "G") {
			fnGoSettleList();
		} else if(szValue == "H") {
			fnGoRefundList("01");	// 취소반품조회
		} else if(szValue == "I") {
			fnGoRefundList("02");	// 교환신청조회
		} else if(szValue == "CPN") {
			fnGoMyCoupon();	// 쿠폰현황
		} else if(szValue == "FAV") {
			fnGoWishList();
		}else if(szValue == "ME") {
			fnGoMyEvent();
		}else if(szValue == "MGR") {
			fnGoMySreialMgr();
		}
	}

/**
 * 취소/반품 신청
 *
 * @author 김현정
 * @since 2009.11.15
 */
function fnGoRefundList(refund_gb) {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/EmyCanonFrontRefundList?cmd=list&search_refund_type=" + refund_gb;
}

/**
 * 쿠폰현황 가기
 *
 * @author 김현정
 * @since 2009.11.15
 */
function fnGoMyCoupon() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/MyCanonCouponList?cmd=list";
}

/**
 * 이벤트참여내역 가기
 *
 * @author 이관규
 * @since 2010.07.07
 */
function fnGoMyEvent() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/MyCanonMyEventList?cmd=list";
}


/**
 * 나의정품,보증기간 관리 가기
 *
 * @author 이관규
 * @since 2010.09.02
 */
function fnGoMySreialMgr() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/MyCanonSerialMgrList?cmd=list";
}

// 플래쉬에서 사용하는 window open 스크립트.
function openWinSP(oURL, name, wwidth, wheight, top, left, isscroll, isresize )
{
	var aw, ah;
	if( wwidth == 0 && wheight == 0 )
	{
		if (screen.availHeight < 960) {
			aw = screen.availWidth;
			ah = screen.availHeight;
		}else{
			aw = screen.availWidth;
			ah = 960;
		}
	}
	else
	{
		aw = wwidth;
		ah = wheight;
	}
	window.open(oURL, name, "width="+aw+",height="+ah+", top="+top+", left="+left+", scrollbars="+isscroll+", resizable="+isresize+", menubar=no, status=no, toolbar=no");
}


// QuickRepair 메인 페이지 이동
function jsQuickRepair() {
	// 로그인 체크
	if(!fnChkLogin()) {
		return;
	}
	location.href = "/actions/QuickRepairIndexAction?cmd=view";
}

/**
 * 이용약관
 */
function fnGOGuideInfo() {
	location.href = "/actions/MemberShipGuideInfoView";
}
/**
 * 개인정보 취급방침
 */
function fnGoRuleInfo() {
	location.href = "/actions/MemberShipRuleInfoView";
}

/**
 * 이메일 주소 무단 수집거부 팝업
 */
function popup_mail_no() {
	window.open('/layouts/ckci/common/popup_main_no.jsp','popup','width=400, height=295, resizable=no');
}
/**
 * 사이트 맵
 */
function fnGoSiteMap() {
	location.href = "/actions/MainSitemapAction?cmd=view";
}
/**
 * FamillySite
 */
function fnGoFamillySite(flag) {
	switch(flag) {
		case "Korea" : // Canon in Korea
			window.open("http://www.canon.co.kr");
			break;
		case "Global" :	// Canon Global
			window.open("http://www.canon.com");
			break;
		case "Japan" :	// Canon in Japan
			window.open("http://canon.jp");
			break;
		case "Solution" :	// Canon Korea Business Solution
			window.open("http://www.canon-bs.co.kr");
			break;
	}
}

/**
 * GNB 링크
 *
 * made by mercurii. 2009.10.21
 */
function fnMenuLink(no, value) {
	switch(no) {
		case "home" :
			location.href = "/actions/CategorySiteMainView?cmd=view";// 메인으로가기
			break;
		case "0//" :
			location.href = "/actions/CategoryProductMainView?cmd=view"; // 프로덕트
																			// 메인
			break;
		// 프로덕트 서브 메인
		case "0/0" :
			location.href = "/actions/ProductInfoMainList?cmd=list&type=1001"; // EOS시리즈
																				// 서브메인
			break;
		case "0/1" :
			location.href = "/actions/ProductInfoMainList?cmd=list&type=3001"; // EF
																				// 렌즈
																				// 서브메인
			break;
		case "0/2" :
			location.href = "/actions/ProductInfoMainList?cmd=list&type=1002"; // IXUS시리즈
																				// 서브메인
			break;
		case "0/3" :
			location.href = "/actions/ProductInfoMainList?cmd=list&type=1003"; // 파워샷시리즈
																				// 서브메인
			break;
		case "0/4" :
			location.href = "/actions/ProductInfoMainList?cmd=list&type=4001"; // 캠코더
																				// 서브메인
			break;
		case "0/5" :
			location.href = "/actions/ProductInfoMainList?cmd=list&type=5001"; // 포토프린터
																				// 서브메인
			break;
		case "0/6" :
			location.href = "/actions/ProductMainAccList?cmd=list&menu_id=7001&ctg_id=1001"; // 악세서리 메인
 			break;
		case "0/7" :
			location.href = "/actions/ProductMainSterilizeDigitalList?cmd=list"; // 단종상품리스트
 			break;
 		case "0/0/0" :
			location.href = "#"; // EOS시리즈
			break;
		case "0/1/0" :
			location.href = "#"; // EF 렌즈
			break;
		case "0/2/0" :
			location.href = "#"; // IXUS시리즈
			break;
		case "0/3/0" :
			location.href = "#"; // 파워샷시리즈
			break;
		case "0/4/0" :
			location.href = "#"; // 캠코더
			break;
		case "0/5/0" :
			location.href = "#"; // 포토프린터
			break;
		case "0/6/0" :
			location.href = "/actions/ProductMainAction?cmd=view&product_code="+value; // 제품상세
			break;
		// 아카데미
	    case "1//" :
			location.href = "/actions/AcademyNewMainAction?cmd=view";	// 아카데미
																		// 메인
			break;
	   case "1/0" :
			location.href = "/actions/AcademyNewLecturesupportAction?cmd=view";	// 강의신청요령
			break;
	    case "1/0_1" :
			location.href = "/actions/AcademyNewLecturesupportAction?cmd=view&gubun=MAP";	// 교육장
																							// 오는길
			break;
	    case "1/1" :
			location.href = "/actions/AcademyNewOfflectureList?cmd=list";	// 오프라인
																			// 강좌
			break;
	    case "1/2" :
			location.href = "/actions/AcademyNewMovingpictureList?cmd=list";	// 동영상
																				// 강의
			break;
	    case "1/3" :
			location.href = "/actions/AcademyNewProlectureList?cmd=list";	// 전문가
																			// 노하우
			break;
	    case "1/4" :
			location.href = "/actions/AcademyNewPostscriptList?cmd=list";	// 강의
																			// 후기
			break;
	    case "1/5" :
			location.href = "/actions/AcademyNewEnjoydslrAction?cmd=view";	// Enjoy
																			// DSLR!
			break;
	    case "1/6" :
	    	goLensMicrosite('G');	// EF렌즈 첫걸음
			break;
	    case "1/7" :
	    	goLensMicrosite('D');	// EF렌즈 완전정복
			break;
	    case "1/8" :
	    	window.open("/jsp/ckci/academy_new/AcademyNewMap.jsp","map_pop","status=yes,menubar=no,resizable=no,scrollbars=no,width=470,height=700,top=200,left=350");	// 교육장
																																										// 위치보기
			break;

		// 라운지
		case "2//" :
			location.href = "/actions/CategoryPlexMainView?cmd=view"; // 라운지
																		// 메인
			break;
		case "2/0" :
			location.href = "/actions/SupportEventList?cmd=list&statusgubun=2"; // 이벤트
			break;
		case "2/1" :
			location.href = "/actions/PlayTripList?cmd=list"; // 출사정보
			break;
		case "2/2" :
			location.href = "/actions/PlayCkciPeopleList?cmd=list"; // 캐논피플
			break;
		case "2/3" :
			location.href = "/actions/ReviewCkciProList?cmd=list"; // 제품리뷰
			break;
		case "2/4" :
			location.href = "/actions/PlayCkciWebzineAction?cmd=view"; // 매거진
			break;
		case "2/5" :
			location.href = "/actions/CategoryCanonStoryMainView?cmd=view"; // 캐논이야기
			break;
		case "2/6" :
			location.href = "/actions/PlayCkciPointMallList?cmd=list"; // 클럽포인트몰
			break;
		case "2/7" :
			pageTracker._trackPageview('/PritingService/GNB.html');	// 인화샵
			jsMainFotoAction();
			break;
		// 갤러리
		case "3//" :
			location.href = "/actions/CategoryGalleryMainView?cmd=view"; // 갤러리
																			// 메인
			break;
		case "3/0" :
			location.href = "/actions/GalleryBestMonthAction?cmd=view&is_first_load=Y"; // 베스트
																						// 샷
			break;
		case "3/1" :
			location.href = "/actions/GalleryPhotoList?cmd=list"; // 포토갤러리
			break;
		case "3/2" :
			location.href = "/actions/CompanyUserInfoConceptcarList?cmd=list"; // 플렉스
																				// 갤러리
			break;
		case "3/3" :
			location.href = "/actions/GalleryPhotoDetailAction?cmd=view&openg_idx="+value; // 포토갤러리
																							// 상세
			break;
		case "3/4" :
			location.href = "/actions/GalleryBestWeekAction?cmd=view"; // 주간
																		// 베스트 샷
			break;

		// 고객지원
		case "4//" :
			location.href = "/actions/CategorySupportMainView?cmd=list"; // 고객지원
																			// 메인
			break;
	    case "4/0" :
			location.href = "/actions/SupportRegistAction?cmd=view"; // 정품 등록
																		// 혜택 안내
																		// // 신청
			break;
		case "4/1" :
			// location.href =
			// donwload_url;//"/actions/FrontPage?cmd=list&url=/ckcifront/support/download/firm_list.jsp";
			// // 다운로드
			//window.open(donwload_url);																								// FAQ
			location.href = "/actions/SupportDownGuideAction?cmd=view";//다운로드 FAQ
			break;
		case "4/2" :
			var param = "";
			if(typeof(value) != "undefined" && value != "" ) {
				param = "&gubun=" + value;
			}
			location.href = "/actions/SupportNoticeList?cmd=list" + param; // 공지사항
			break;
		case "4/3" :
			location.href = "/actions/SupportSvcGuideAction?cmd=view"; // 서비스안내
			break;
		case "4/4" :
			location.href = "/actions/SupportShopGuideAction?cmd=view"; // 판매점안내
			break;
		case "4/5" :
			location.href = "/actions/SupportCpsMemberAction?cmd=join"; // CPS
																		// 멤버쉽
			break;
		case "4/6" :
			location.href = "/actions/ProductMainCatalogList?cmd=list"; // 카달로그
			break;
		case "4/7" :
			location.href = "/actions/SupportSvcMapList?cmd=list"; // 서비스
																	// 접수/위치안내
			break;
		case "4/8" :
			location.href = "/actions/SupportAsRssAction?cmd=view"; // 원격 서비스
			break;
		case "4/9" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportAsCdAction?cmd=write"; // 소프트웨어 Cd구매
			break;
		case "4/10" :
			location.href = "/actions/SupportAsPolicyAction?cmd=view"; // 서비스 정책 안내
			break;
		case "4/11" :
			location.href = "/actions/SupportSvcPlazaList?cmd=list&type=6"; // 직영매장
			break;
		case "4/12" :
			location.href = "/actions/SupportSvcPlazaList?cmd=list&type=7"; // 캐논전문매장
			break;
		case "4/13" :
			location.href = "/actions/SupportSvcShopList?cmd=list&type=3"; // 일반매장
			break;
		case "4/14" :
			location.href = "/actions/SupportSvcShopList?cmd=list&type=1"; // 전국총판
			break;
		case "4/15" :
			location.href = "/actions/SupportCpsMemberAction?cmd=join"; // CPS
			break;
		case "4/16" :
			location.href = "/actions/SupportCpsJrMemberAction?cmd=join"; // CPS Jr
			break;
		case "4/17" :
			location.href = "/actions/SupportPicGuideAction?cmd=view"; // 추가 픽처 스타일
			break;
		case "4/18" :
			location.href = "/actions/SupportPicStyleAction?cmd=view"; // 픽처 스타일
			break;
		case "4/19" :
			 location.href = "/actions/SupportRegistAction?cmd=view";	// 정품등록 혜택보기
			break;
		case "4/20" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/SupportAsPickUpOrdAction?cmd=write"; // 픽업서비스
			break;
		case "4/21" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/QuickRepairIndexAction?cmd=view"; // 퀵 리페어 서비스
			break;
		case "4/22" :
			if(!fnChkLogin()) {
				return;
			}
			 location.href = "/actions/SupportRegistAction?cmd=rgst";	// 정품등록
 			break;
		case "4/23" :
			//location.href = "/actions/SupportDownGuideAction?cmd=view";//다운로드 FAQ
			window.open(donwload_url);																								// FAQ
 			break;
		case "4/24" :
			location.href = "/actions/SupportDownDriverList?cmd=list";//다운로드 드라이버
 			break;
		case "4/25" :
			location.href = "/actions/SupportDownUtilList?cmd=list";//다운로드 유틸리티
 			break;
		case "4/26" :
			location.href = "/actions/SupportDownFirmList?cmd=list";//다운로드 펌웨어
 			break;
		case "5//" :	// eStore 메인
			location.href = "/actions/CategoryEstoreMainView?cmd=view";
			break;
		case "5" :	// eStore 섹션
			location.href = "/actions/EstoreGoodsList?cmd=list&ctg_id="+value+"&level=L";
			break;
		case "5/7" :	// 리퍼&아울렛몰
			location.href = "/actions/EstoreRefurbishedView?cmd=view";
			break;
		case "5/8" :	// 상품기획전
			location.href = "/actions/EstorePlanshopList?cmd=list";
			break;
		case "5/9" :	// FAQ
			location.href = "/actions/EstoreFAQList?cmd=list";
			break;
		case "5/10" :	// 기업구매/대량구매
			location.href = "/actions/EstoreFrontEnterpriseAction?cmd=view";
			break;
		case "5/11" :
			pageTracker._trackPageview('/PritingService/GNB.html');
			jsMainFotoAction();// 인화샵
			break;
		case "mycanon" :
			if(!fnChkLogin()) {
				return;
			}
			location.href = "/actions/CategoryMyCanonMainView?cmd=view";// 마이캐논
			break;

		case "event" :
			location.href = "/actions/SupportEventList?cmd=list&statusgubun=2";// 이벤트
			break;

		case "companyview" :
			window.open("/actions/CompanyUserMainAction?cmd=view");// 회사소개
			break;

		case "logout" :// var locationVal = document.URL;
			location.href = "/actions/LoginUserAction?cmd=logout";
			//location.href = "/actions/LoginUserAction?cmd=logout&locationVal="+document.URL;	// 로그아웃
			break;

		case "member" :
			location.href = "/actions/MemberShipAction?cmd=introPage";// 회원가입
																		// 분기
			break;

		case "member_general" :
			location.href = "/actions/MemberShipAction?cmd=agreePage&child_yn=N";// 회원가입
			break;

		case "member_child" :
			location.href = "/actions/MemberShipAction?cmd=agreePage&child_yn=Y";// 회원가입
			break;

		case "idsearch" :
			location.href = "/actions/MemberShipAction?cmd=idsearch";// 아이디찾기
			break;

		case "pwsearch" :
			location.href = "/actions/MemberShipAction?cmd=pwsearch";// 비밀번호찾기
			break;


		case "comintro" :
			window.open("/actions/CompanyGroupInfoFix?cmd=view"); 	//캐논그룹소개
			break;

		case "comnews" :
			window.open("/actions/CompanyUserInfoNewsList?cmd=list");	//보도자료
			break;

		case "comculture" :
			window.open("/actions/CompanyUserInfoStudentmainList?cmd=list"); 	//장학프로그램
			break;

		case "comhistory" :
			window.open("/actions/CompanyUserHistory1933Fix?cmd=list"); 	//캐논히스토리
			break

		case "comrecruit" :
			window.open("/actions/CompanyUserRecruitNoticeList?cmd=list"); 	//채용정보
			break;

	}
}

/**
 * SNS 연결 flag : facebook, twitter, me2day, yozm url : 연결 URL value : 텍스트값
 */
function fnGoSNS(flag, url, value){

	var actionUrl = encodeURIComponent(url);
	var message = encodeURIComponent(value);

	switch(flag) {
		case "facebook" :
			var ran_no = Math.ceil(Math.random()*100);
			var editUrl = url;
			if(editUrl.indexOf("?") != -1) {
				editUrl += "&ran_no="+ ran_no;
			} else {
				editUrl += "?ran_no="+ ran_no;
			}
			actionUrl = encodeURIComponent(editUrl);
			window.open("http://www.facebook.com/sharer.php?u="+actionUrl + "&t=" + message);
			break;

		case "twitter" :
			window.open("http://twitter.com/share?url="+actionUrl+"&text="+message+"&","recom_icon_popup", "width=560,height=480,scrollbars=no,resizable=no");
			break;

		case "me2day" :
			//fnGetShortUrl(actionUrl, message, fnGoMe2Day);
			window.open("http://me2day.net/posts/new?new_post[body]=\"" + message + "\":" + actionUrl  );
			break;

		case "yozm" :
			window.open("http://yozm.daum.net/api/popup/prePost?sourceid=41&link="+actionUrl+"&prefix="+message);
			break;
	}

}

function fnGetShortUrl(longUrl, message, callBack) {
	var loginId = "sibee";
	var apiKey = "R_3d6c48553916f03800ae6ce916d50186";
	var format = "txt";
	var url = "http://api.bit.ly/v3/shorten?login="+loginId+"&apiKey="+apiKey+"&format="+format+"&longUrl=" + longUrl;

	fn_xmlHttpGet(url, callBack, message);
}

function fnGoMe2Day(url, message) {
	window.open("http://me2day.net/posts/new?new_post[body]=" + message + url);
}

// 기본 픽쳐 스타일
function fnDefaultStyle() {

	location.href = "/actions/SupportPicStyleAction?cmd=view";
}


// 추가 픽쳐 스타일
function fnAddStyle() {

	location.href = "/actions/SupportPicNosList?cmd=list";
}
// 1:1문의
function fnQuestWrite(){
	location.href = "/actions/MyCanonOneAndOneWriteAction?cmd=write";
}

function fnProductDetail(product_code)
{
	if(product_code != null)
	{
		location.href = "/actions/ProductMainAction?cmd=view&product_code="+product_code;
	}
}

// 환불/반품안내
function fnRefundGuide() {
	location.href = "#";
}



// 픽업 서비스 상세보기
function popup_pickup_view(up_seq) {
	window.open('/actions/MyCanonPickupAction?cmd=view&up_seq='+up_seq+'','popup_pickup_view','width=500,height=460,statubar=no,scrollbars=yes');
}

// 픽업 서비스 결제정보
function popup_settle(up_seq,info_seq) {
	window.open('/actions/MyCanonPickUpSettleAction?cmd=write&info_seq='+info_seq+'&up_seq='+up_seq+'','popup_registerModify','width=464,height=336,statubar=no,scrollbars=no');
}

// 배송 현황 추적
function popup_service_delivery(inv_no) {
	window.open('http://www.hlc.co.kr/hydex/jsp/tracking/trackingViewCus.jsp?InvNo='+inv_no,'','width=580,height=700,statubar=no,scrollbars=yes');
}

// cd/매뉴얼 상세보기
function popup_manual_status(info_seq) {
	window.open('/actions/MyCanonManualAction?cmd=view&info_seq='+info_seq+'','popup_manual_status','width=495,height=480,statubar=no,scrollbars=yes');
}

// 퀵리페어 상세보기
function go_view(request_seq) {
	location.href = "/actions/MyCanonQuickRepairAction?cmd=view&request_seq=" + request_seq;
}

// 이스토어 혜택 페이지
function fnEstoreBenefit(){
	location.href = "/actions/EstoreSpecialBenefitView";
}

// 갤러리 상세보기
function fnGalleryView(openg_idx){
	location.href = "/actions/GalleryPhotoDetailAction?cmd=view&openg_idx=" + openg_idx;
}

// 캐논 플렉스 소개
function fnCanonPlex() {
	window.open("/actions/CanonplexIntroAction?cmd=view");
}

function goLensMicrosite(arg){
	if('D' == arg){
		window.open("/microsite/event/201009_EFLens_dictionary/index.jsp","micro_lens_d",'left=0,top=0,width=1500,height=760,scrollbars=yes,resizable=yes,status=yes');
	}else if ('G' == arg){
		window.open("/microsite/event/201009_EFLens_guide/index.jsp","micro_lens_g",'left=0,top=0,width=1500,height=760,scrollbars=yes,resizable=yes,status=yes');
	}
}


// 이스토어 신용카드 이용안내
function fnEstoreCreditGuide() {
	location.href = "/actions/EstoreCreditGuideView";
}


// 이스토어 교환/환불 이용안내
function fnEstoreExchangeGuide() {
	location.href = "/actions/EstoreExchangeGuideView";
}

// 월간 베스트샷 이동
function fnBestMonthGallery(bestYear, bestMonth){
	location.href = "/actions/GalleryBestMonthAction?cmd=view&best_year="+bestYear+"&best_month="+bestMonth; // 월간
																												// 베스트
																												// 샷
}

// //////////////
// 포토로그 이동
function goPhotoLog(robot_id) {

	location.href = "/actions/MyCanonPhotoGalleryList?cmd=list&robot_id="+robot_id;
}

// 시스템뷰
function fnOpenSystemMap(lctg_id, product_code) {
	var url = "/actions/ProductSystemMapAction?cmd=view&lctg_id=" + lctg_id;

	if(product_code != "" && typeof(product_code) != "undefined") {
		url += "&product_code=" + product_code;
	}

	window.open(url,'popup2','width=840,height=760');
}

// 단종상품 상세
function fnProductSterilizeView(product_code) {

	location.href = "/actions/ProductMainSterilizeAction?cmd=view&product_code=" + product_code;
}


//마이크로 사이트 링크
function fnSelectMicrosite(value)
{
	//alert("ss");
	if("" == value){
		return false;
	}else{
		if( value == 'PowerShotS90' ){
			window.open('/microsite/event/201004_S90/index.html','','left=0,top=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=907,height=557');
		} else if( value == 'RealCompactCampaign' ){
			window.open('/microsite/event/RealCompactCampaign/images/index.jsp','','width=1220,height=850,top=0,left=0');
		} else if( value == 'EOS7D' ){
		window.open('/microsite/event/EOS7D/images/index.jsp','','width=1220,height=850,top=0,left=0');
			} else if( value == 'IXUSCampaign' ){
			window.open('/microsite/event/090401_IXUS_Campaign/kevent/index1.jsp','','width=1220,height=850,top=0,left=0');
		} else if( value == 'EOS500D' ){
			window.open('/microsite/event/090522_EOS_Micro/images/index.jsp','','width=1220,height=850,top=0,left=0');
		} else if( value == 'IXUS870IS' ){
			window.open('/global/event/compact2/main.jsp','','width=1220,height=850,top=0,left=0');
		} else if( value == 'EOS5DMarkII' ){
			window.open('/global/event/5dm2/5D_main.html','','width=1220,height=850,top=0,left=0');
		} else if( value == 'EOS450D' ){
			window.open('/global/event/450d2/intro.html','','width=1220,height=850,top=0,left=0');
		} else if( value == 'EOS50D' ){
			window.open('/global/event/50d/main.jsp','','width=1220,height=850,top=0,left=0');
		} else if( value == 'HF10' ){
			window.open('/global/event/hf10/main.jsp','','width=1220,height=850,top=0,left=0');
		} else if( value == 'IXUS300HS' ){
			window.open("/microsite/event/201007_IXUS_300HS/main.jsp","micro_300hs",'left=0,top=0,width=980,height=650,scrollbars=no,resizable=no,status=no');
		} else if( value == 'EFLENSDICTIONARY' ){
			window.open("/microsite/event/201009_EFLens_dictionary/index.jsp","micro_lens_d",'left=0,top=0,width=1500,height=760,scrollbars=yes,resizable=yes,status=yes');
		} else if( value == 'EFLENSGUIDE' ){
			window.open("/microsite/event/201009_EFLens_guide/index.jsp","micro_lens_g",'left=0,top=0,width=1500,height=760,scrollbars=yes,resizable=yes,status=yes');
		} else if( value == 'EOS60D' ){
			 window.open("/microsite/event/201008_EOS60D_2ND/intro.html","micro_60d_2nd",'left=0,top=0,width=970,height=700,scrollbars=no,resizable=no,status=no');
		} else if( value == 'HSSYSTEM' ){
			 window.open("/microsite/event/201010_HS_SYSTEM/index.jsp","micro_hs_system",'left=0,top=0,width=1013,height=696,scrollbars=yes,resizable=yes,status=no');
		} else if( value == 'HSSYSTEM' ){
			 window.open("/microsite/event/201010_HS_SYSTEM/index.jsp","micro_hs_system",'left=0,top=0,width=1013,height=696,scrollbars=yes,resizable=yes,status=no');
		} else if( value == 'EOS600D' ){
			 window.open("/microsite/event/201103_EOS600D_2ND/index.jsp","micro_600d_2nd",'left=0,top=0,width=1220,height=850,,scrollbars=no,status=no, resizable=yes');
		} else if( value == 'EOS550D' ){
			 window.open("/microsite/event/201003_EOS550D_Micro/images/index.jsp","micro_550d",'left=0,top=0,width=1240,height=750,scrollbars=yes,resizable=yes,status=no');
		} else if( value == 'IXUS210IS' ){
			 window.open("/microsite/event/DC_Campaign/index.jsp","micro_dc_ixus",'left=0,top=0,width=982,height=645,scrollbars=no,resizable=no,status=no');
		} else if( value == 'EOS1100D' ){
			 window.open("/microsite/event/201103_EOS1100D/index.jsp","micro_1100d",'left=0,top=0,width=970,height=700,scrollbars=no,status=no, resizable=yes');
		} else if( value == 'IXUS310HS' ){
			  window.open("/microsite/event/201103_IXUS_310HS/index.jsp","micro_310hs",'left=0,top=0,width=1200,height=750,,scrollbars=no,status=no, resizable=yes');
		} else if( value == 'EOSMOVIE' ){
			  window.open("/microsite/event/201106_EOS_Movie/images/index.jsp","micro_eosmovie",'left=0,top=0,width='+screen.width+',height='+screen.height+',scrollbars=no,status=no, resizable=yes');
		} else if( value == 'EOS600DCAMPAIGN' ){
			  window.open("/microsite/event/201110_EOS600D_Campaign/index.jsp","micro_600d_campaign",'');
		}

	}//end else
}//end fnSelectMicrosite

// 배너 링크
function fnBnnrLink(url, target, width, height, bnnr_id)
{	
	if(url == "" || typeof(url) == "undefined") {
		location.href = "#";
	} else {
		if(typeof(target) == "undefined" || target == "" || target == "_self") {
			location.href = url;
		} else {
			if(target == "popup")
			{
				if(typeof(bnnr_id) == "undefined" || typeof(bnnr_id) == "") {
					bnnr_id = "BNNR_POP";
				}
				window.open(url, bnnr_id,"left=0,top=0,width=" + width + ", height=" + height+ ",scrollbars=no,status=no, resizable=yes");
			}
			else
			{
				window.open(url, bnnr_id , ''  );
			}
		}
	}
}







