﻿var toastBarValue = {
	docHeight:0,
	docWidth:0
}
    	
$(document).ready(function() {
	// 토스트바
	var loc = document.location.href;
	if(loc.indexOf("203.239.145.24") > -1 || loc.indexOf("203.239.145.23") > -1 || loc.indexOf("203.239.145.22") > -1 || loc.indexOf("203.239.145.21") > -1 || loc.indexOf("www.thebodyshop.co.kr") > -1){
		if(loc.indexOf("Bodymain.aspx") > -1 || loc.indexOf("/shop/product/first.aspx") > -1 || loc.indexOf("/brand/culture/first.aspx") > -1 || loc.indexOf("/shop/membership_no/cart.aspx") > -1 || loc.indexOf("/shop/mypage/cart.aspx") > -1 || loc.indexOf("/shop/mypage/Index.aspx") > -1 || loc.indexOf("/membership/mem_reg_step1.aspx") > -1 || loc == "http://www.thebodyshop.co.kr/" || loc == "http://203.239.145.21/" || loc == "http://203.239.145.22/" || loc == "http://203.239.145.23/" || loc == "http://203.239.145.24/" || loc.indexOf("/wellbeingspa/spa_main.aspx") > -1 || loc.indexOf("/shop/product/pro_detail.aspx") > -1 || loc.indexOf("/mem_end.aspx") > -1 || loc.indexOf("/brand/lyb/benefit.aspx") > -1){
			var fixedScrollHeight = 0;
			
			// 크기 구할 레이어 생성
			$("<div/>", {
				id:"divDocSize",
				css:{
					position:"absolute",
					left:"0px",
					top:"0px",
					width:"100%",
					height:"100%",
					zIndex:0
				}
			}).appendTo($("body"));
			
			toastBarValue.docHeight = $("div.#divDocSize").height();
			toastBarValue.docWidth = $("div.#divDocSize").width();
			fixedScrollHeight = $(document).height() - $("div.#divDocSize").height();
			
			$("div#divDocSize").remove();
	
	
			//alert(toastBarValue.docHeight);
			//alert(toastBarValue.docWidth);
			//alert($("#toastBarLayer div:even").length);
			$("<div/>", {
				id:"toastBar",
				css:{
					position:"absolute",
					left:((toastBarValue.docWidth - 992) / 2) + "px",
					top:toastBarValue.docHeight + "px", //178
					width:"992px",
					height:"167px",
					//backgroundColor:"white",
					zIndex:9999
				}
			}).appendTo($("body")).html($("#toastBarLayer").html());
	
			$("#toastBarLayer").remove();
			
			/*
			$("#toastBar div:even").each(function(i){
			});
			*/

			openToastBarLayers();
				
			setTimeout(function(){
				$("#toastBar").animate({top:"-=178"}, 1000);
			}, 1100);
			
			$(window).scroll(function(e) {
				if($(document).scrollTop() > fixedScrollHeight){ return; }
				$("#toastBar").css({
					top: (((toastBarValue.docHeight - 178) + $(document).scrollTop())) + "px"
				});
			});
			
			$(window).resize(function() {
			        // 크기 구할 레이어 생성
			        $("<div/>", {
				        id:"divDocSize",
				        css:{
					        position:"absolute",
					        left:"0px",
					        top:"0px",
					        width:"100%",
					        height:"100%",
					        zIndex:0
				        }
			        }).appendTo($("body"));
        			
			        toastBarValue.docHeight = $("div.#divDocSize").height();
			        toastBarValue.docWidth = $("div.#divDocSize").width();
			        fixedScrollHeight = $(document).height() - $("div.#divDocSize").height();
        			
			        $("div#divDocSize").remove();
			        
                    		if($(document).scrollTop() > fixedScrollHeight){ return; }
				    $("#toastBar").css({
				        left:((toastBarValue.docWidth - 992) / 2) + "px",
					    top: (((toastBarValue.docHeight - 178) + $(document).scrollTop())) + "px"
				    });
                	});
			//alert($("#toastBar").html());

		}
	}
	
	if(document.location.href.indexOf("new.aspx") > -1){
		$("p.location:eq(0)").html('<a>쇼핑홈</a><span>신제품</span>');
	}else if(document.location.href.indexOf("first_pro.aspx") > -1){
		$("p.location:eq(0)").html('<a>쇼핑홈</a><span>전제품 카테고리</span>');
	}else if(document.location.href.indexOf("event.aspx") > -1){
		$("p.location:eq(0)").html('<a>쇼핑홈</a><span>쇼핑기획전</span>');
	}else if(document.location.href.indexOf("p_raw") > -1){
		$("p.location:eq(0)").html('<a>쇼핑홈</a><span>원료별 제품</span>');
	}

/*
	$("img").each(function() {
		//alert($(this).attr("src").indexOf("png"));
		if ($(this).attr("src").indexOf("png") > -1) {
			//fixPNG(this);
		}
	});
*/

  $("ul#categorDepth>li").each(function(i){
  	$(this).mouseover(function(){
  		$("div.cateall_over:eq(" + $(this).index() + ")").show();
  	}).mouseout(function(){
  		$("div.cateall_over").hide();
  	});
  });
  
  $("div.cateall_over").each(function(i){
  	$(this).mouseover(function(){
  		$("div.cateall_over:eq(" + $(this).index() + ")").show();
  	}).mouseout(function(){
  		$(this).hide();
  	});
  });

	$("#globalKeyword").keyup(function(E){
		if(E.keyCode == 13){
			searchGlobal();
		}
	}).val("Search").click(function(E){
		if($(this).val() == "Search"){
			$(this).val("");
		}
	}).blur(function(E){
		if($(this).val() == ""){
			$(this).val("Search");
		}
	});
});

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) {
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) {
        var imgID = (myImage.id) ? "id='" + myImage.id + "' " : "";
        var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
        var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' ";
        var imgStyle = "display:inline-block;" + myImage.style.cssText;
        var strNewHTML = "<span " + imgID + imgClass + imgTitle
                      + " style=\"" + "width:" + myImage.width
                      + "px; height:" + myImage.height
                      + "px;" + imgStyle + ";"
                      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                      + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>";
        myImage.outerHTML = strNewHTML;
    }
}

$(document).keydown(function(e){
//alert(e.target.nodeName);
	if(e.keyCode == 13){
		if(e.target.nodeName != "TEXTAREA")
			e.preventDefault();
	}
});

function enterPress(e, button) {
    if (e.keyCode == 13) {
        button.click();
    }
}

/*
* setLayer // div 레이어 팝업 띄우기

setLayer.show({
	id:"test",						// 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
	left:100,							// left 좌표 지정(지정하지 않으면 가로 가운데 정렬)
	top:100,							// top 좌표 지정(지정하지 않으면 세로 가운데 정렬)
	position:"absolute",	// position 지정(지정하지 않으면 "forceabsolute" -> 상위 태그 css의 position의 영향을 받지 않음 / "css"를 줄 경우 해당 레이어의 position, top, left 속성을 사용 함)
	bgcolor:"white",			// 오버레이(배경 불투명 레이어 생성 시 배경 색상 지정(지정하지 않으면 "gray")
	opacity:.4,						// 불투명도 지정(지정하지 않으면 0)
	scroll:false					// 마우스 스크롤 시 가운데 위치 교정 여부(지정하지 않으면 true / position이 forceabsolute, absolute일때만 작동)
});
		
setLayer.hide("test")		// #test 레이어 숨김(오버레이 있을 시 같이 사라짐 / 지정하지 않으면 마지막으로 생성된 레이어 숨김)

ex)
setLayer.show(); // 모든게 귀찮을 때. <div id="layerPopup">레이어</div> 를 html 내의 가로세로 가운데 위치에 띄우게 하되 스크롤이 있는 html의 경우 세로스크롤의 높이만큼 레이어 위치를 교정
setLayer.show({overlay:.4}); // 위와 같은 상황에서 레이더 뒷배경에 불투명 오버레이 적용

- require : jQuery 1.4.x
- author : saystone@wylielab.co.kr
*/
var setLayer = {
	id: "layerPopup",
	opacity: 0,
	wrapperId: "_divWrapper",
	overlayId: "_divOverlay",
	ie6Height: 0,
	show: function(options) {
		var options = (typeof arguments[0] != 'object') ? {} : arguments[0];
		options = {
			id: (typeof options.id == 'undefined') ? setLayer.id : options.id,
			left: (typeof options.left == 'undefined') ? -1 : options.left,
			top: (typeof options.top == 'undefined') ? -1 : options.top,
			opacity: (typeof options.opacity == 'undefined') ? 0 : options.opacity,
			position: (typeof options.position == 'undefined') ? "forceabsolute" : options.position,
			bgcolor: (typeof options.bgcolor == 'undefined') ? "gray" : options.bgcolor,
			scroll: (typeof options.scroll == 'undefined') ? true : options.scroll
		}

		// hide 메서드에서 사용하기 위해 셋팅
		this.id = options.id;
		this.opacity = options.opacity;

		var objLayerOverlay = $("#" + this.overlayId);
		//console.log(objLayerOverlay.length);
		if (objLayerOverlay.length == 1) {
			alert("이미 opacity를 사용하여 생성된 레이어가 존재합니다.");
			return;
		}

		var objLayer = $("#" + options.id) // 레이어의 id
		if (objLayer.length == 0) {
			alert("지정된 id 속성을 가진 레이어가 존재하지 않습니다. : " + options.id);
			return;
		}

		var docWidth = $(document).width(); // 스크롤 여백을 포함 한 document의 넓이
		var docHeight = $(document).height(); // 스크롤 여백을 포함 한 document의 높이
		var bodyHeight = $("body").height(); // 스크롤 여백을 제외 한 document의 넓이
		
		var scrollWidth = 0;

		/*
		if(typeof LOGINID != undefined){
			if(LOGINID == "saystone5"){
				alert("bodyHeight:"+bodyHeight);
				alert("docHeight:"+docHeight);
				alert("fixedHeight:"+$.height);

				bodyHeight = screen.height - 80;
				alert(bodyHeight);
				bodyHeight = document.body.offsetHeight / 2;
				alert(bodyHeight);

				var db = document.body;
				var dde = document.documentElement;

				var docHeight_ = Math.max(db.scrollHeight, dde.scrollHeight, db.offsetHeight, dde.offsetHeight, db.clientHeight, dde.clientHeight)
				alert(docHeight_);
			}
		}
		*/

		if ($.browser.msie) {
			scrollWidth = 20;
			if(parseInt($.browser.version) == 6){
				$("select").hide();
				//bodyHeight = (bodyHeight / 2) - 100;
				//bodyHeight = screen.height - 200;
				//bodyHeight = document.body.offsetHeight / 2;
				/*
				if(options.id == "popup" || options.id == "pop") {
					alert(bodyHeight);
					bodyHeight = bodyHeight -20;
					alert(bodyHeight);
				}	
				*/							
				
				var tempHeight = "";
				if(setLayer.ie6Height == 0){
					tempHeight = "100%";
				}else{
					tempHeight = setLayer.ie6Height + "px";
				}

				$("<div/>", {
					id:"tempHeight",
					css:{
						position:"absolute",
						left:"0px",
						top:"0px",
						width:"1px",
						height:tempHeight,
						zIndex:0
					}
				}).appendTo($("body"));

				if(setLayer.ie6Height == 0){
					setLayer.ie6Height = $("div#tempHeight").height();
					bodyHeight = $("div#tempHeight").height();
				}else{
					bodyHeight = setLayer.ie6Height;
				}
			}
		}
		var docScrollTop = $(document).scrollTop();
		//alert(docScrollTop);
		//console.log(docScrollTop);

		var layerWidth = objLayer.width(); // 레이어의 넓이
		var layerHeight = objLayer.height(); // 레이어의 높이

		var positionLeft, positionTop;
		// left 위치 지정 하지 않으면 가로 센터 정렬
		if (options.left == -1) {
			positionLeft = (docWidth - layerWidth) / 2 // 가로 가운데 정렬
		} else {
			positionLeft = options.left;
		}

		// top 위치 지정 하지 않으면 세로 센터 정렬
		if (options.top == -1) {
			positionTop = ((bodyHeight - layerHeight) / 2) + docScrollTop // 세로 가운데 정렬
		} else {
			positionTop = options.top;
		}


		// 해당 레이어의 css 속성을 따름
		if (options.position == "css") {
			options.position = objLayer.css("position");
			options.left = objLayer.css("left").replace(/\px/gi, "");
			options.top = objLayer.css("top").replace(/\px/gi, "");
		// 어떤 상위 태그의 position 속성에도 영향을 받지 않도록 body 밑에 래핑 레이어 생성
		} else if (options.position == "forceabsolute") {
			$("<div/>", {
				id: setLayer.wrapperId,
				css: {
				position: "absolute",
				left: positionLeft + "px",
				top: positionTop + "px",
				width: objLayer.width() + "px",
				height: objLayer.height() + "px",
				zIndex: 10000
			}
			}).appendTo("body").html(objLayer.html());

		}

		if (options.position == "forceabsolute"){
			objLayer = $("#" + this.wrapperId);
		}else{
			objLayer.css({
				position: options.position,
				left: positionLeft + "px",
				top: positionTop + "px",
				zIndex: 10001
			}).show();
		}

		// 스크롤 높이에 따라 세로 가운데 정렬
		if (options.position == "absolute" || options.position == "forceabsolute") {
			if (options.scroll == true) {
				$(window).scroll(function(e) {
						//console.log(((bodyHeight - layerHeight) / 2) + $(document).scrollTop());
						objLayer.css({
						top: (((bodyHeight - layerHeight) / 2) + $(document).scrollTop()) + "px"
					});
				});
			}
		}

		// opacity 값을 셋팅 했을때만 오버레이 레이어 생성
		if (options.opacity > 0) {
			$("<div/>", {
				id: setLayer.overlayId,
				css: {
					position: "absolute",
					left: 0,
					top: 0,
					width: (docWidth - scrollWidth) + "px",
					height: docHeight + "px",
					backgroundColor: options.bgcolor,
					display: "none",
					opacity: options.opacity,
					zIndex: 9999
				}
			}).appendTo("body").fadeIn(300);
		}
	},
	hide: function(id) {
		var id = (typeof id == 'undefined') ? setLayer.id : id;

		if (this.opacity == 0) {
			$("#" + id).hide();
			// 로그인 레이어 예외처리..
			if($("#_divOverlay").length > 0){
				$("#_divOverlay").fadeOut(300, function() {
					$(this).remove();
					if ($.browser.msie) {
						if(parseInt($.browser.version) == 6){
							if($("p.location:eq(0) select").length > 0){
								$("p.location:eq(1)").hide();
								$("p.location:eq(0)").show();
							}
						}
					}
				});
			}
		} else {
			try{
				console.log(id);
			}catch(E){
			}
			
			$("#" + id).hide();
			$("#" + setLayer.overlayId).fadeOut(300, function() {
				$(this).remove();
			});
		}

		$("#" + this.wrapperId).remove();


		if ($.browser.msie) {
			if(parseInt($.browser.version) == 6){
				$("select").show();				

				$("div#tempHeight").remove();
			}
		}
	}
}
//보물찾기 팝업
function open_treasure_pop()
{
if ((version >= 5.5) && (version < 7)) {
  setLayer.show({
    id: "divTreasure",     // 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
    left: 200,
    top: 50,
  	opacity: .5     // 불투명도 지정(지정하지 않으면 0)
  });
}else {
  setLayer.show({
    id: "divTreasure",     // 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
  	opacity: .5     // 불투명도 지정(지정하지 않으면 0)
  });
}
}


function open_loung_pop()
{
  setLayer.show({
    id: "LoungPop",     // 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
  	opacity: .5     // 불투명도 지정(지정하지 않으면 0)
  });
}

function open_login_pop()
{
	/*
  setLayer.show({
    id: "popWrap",     // 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
  	opacity: .5     // 불투명도 지정(지정하지 않으면 0)
  });
	*/
	var docWidth = $(document).width(); // 스크롤 여백을 포함 한 document의 넓이
	var docHeight = $(document).height(); // 스크롤 여백을 포함 한 document의 높이
	var scrollWidth = 0;

	if ($.browser.msie) {
		// 스크롤바 넓이 추가
		scrollWidth = 20;
	}
	
	$("<div/>", {
		id: "_divOverlay",
		css: {
			position: "absolute",
			left: 0,
			top: 0,
			width: (docWidth - scrollWidth) + "px",
			height: docHeight + "px",
			backgroundColor: "gray",
			display: "none",
			opacity: .5,
			zIndex: 9999
		}
	}).appendTo("body").fadeIn(300, function(){
		$("iframe[name=ifrLogin]").attr("src", "/membership/login_pop.aspx");
		$("#popLogin").show();
		
		// 셀렉트박스 예외처리
		if ($.browser.msie) {
			if(parseInt($.browser.version) == 6){
				if($("p.location:eq(0) select").length > 0){
					var dep1 = "<span>" + $('p.location:eq(0)>select:eq(0)>option:selected').text() + "</span>";
					var dep2 = "&nbsp;&gt;&nbsp;<span>" + $('p.location:eq(0)>select:eq(1)>option:selected').text() + "</span>";
					$("p.location:eq(1)").html('<div style="padding-top:3px;"><a>쇼핑홈</a>' + dep1 + dep2 + "</div>");
					$("p.location:eq(1)").show().css("height","17px");
					$("p.location:eq(0)").hide();
				}
			}
		}
		
		try{
			$.scrollTo(0, 500);
		}catch(E){
			window.scrollTo(0);
		}
	});
}

function open_preview_pop()
{
  setLayer.show({
    id: "showPop",     // 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
  	opacity: .5     // 불투명도 지정(지정하지 않으면 0)
  });
}

function open_quantity_pop()
{
  setLayer.show({
    id: "popQuantity",     // 띄울 레이어의 id 지정(지정하지 않으면 #layerPopup 을 사용)
  	opacity: .5     // 불투명도 지정(지정하지 않으면 0)
  });
}

function open_quickshopping_pop(){
	$("iframe[name=ifrQuickShopping]").attr("src", "/shop/product/first_layer.aspx");
	setLayer.show({
		id:'popQuickShopping',
		opacity:.5
	});
}

function open_shoppingbag_pop(){
	$("iframe[name=ifrShoppingBag]").attr("src", "/shop/product/my_layer.aspx");
	setLayer.show({
		id:'popShoppingBag',
		opacity:.5
	});
}

function open_myshopping_pop(){
	if(document.getElementById('popMyShopping').style.display != 'none') {
		$('#ctl00_cphLocation_ucShop_Location1_ddlNavi').show();		
		$('#ctl00_cphLocation_ucShop_Location1_ddlNaviSub').show();		

		
		$('#popMyShopping').hide();
	}
	else {
		$('#ctl00_cphLocation_ucShop_Location1_ddlNavi').hide();		
		$('#ctl00_cphLocation_ucShop_Location1_ddlNaviSub').hide();		
		$('#popMyShopping').show();
		
	}

}

function close_myshopping_pop(){	
	$('#popMyShopping').hide();
	
}

function commaNum(num) {
	if (num < 0) { num *= -1; var minus = true }
	else var minus = false
	var dotPos = (num + "").split(".")
	var dotU = dotPos[0]
	var dotD = dotPos[1]
	var commaFlag = dotU.length % 3

	if (commaFlag) {
		var out = dotU.substring(0, commaFlag)
		if (dotU.length > 3) out += ","
	}
	else var out = ""
	for (var i = commaFlag; i < dotU.length; i += 3) {
		out += dotU.substring(i, i + 3)
		if (i < dotU.length - 3) out += ","
	}
	if (minus) out = "-" + out
	if (dotD) return out + "." + dotD
	else return out
}

function getItem(category, type){
	if(LOGINID == ""){
	    
                if(type == 1){
			    var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
		        if(confirm(msg)){
			        if(category == "product"){
				        open_login_pop();
			        }else if(category == "quick"){
				        parent.setLayer.hide();
				        setTimeout(function(){
					        open_login_pop();
				        }, 200);
			        }
			        return;
		        }
		    }else if(type == 2){
			    var selector = "", PCD = "", url = "", msg = "";
    		
		        if(category == "product"){
			        selector = "ul.pro-list input[type=checkbox]:checked";
		        }else if(category == "quick"){
			        selector = "";
		        }
        		
		        
			url = "/shop/membership_no/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
		        
        		
		        $(selector).each(function(i){
			        PCD += $(this).val() + ",";
		        });
        	
		        if(PCD == ""){
			        alert("제품을 선택해 주세요.");
			        return;
		        }
        		
		        $.post("/shop/product/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			        if($.trim(result) == "success"){
				        if(type == 2 || type == 3){
					        if(confirm(msg)){
						        if(category == "product"){
							        document.location.href = url;
						        }else if(category == "quick"){
							        window.open(url);
						        }
					        }
				        }else if(type == 1){
					        document.location.href = url;
				        }
			        }else{
			        	if(type == 2){
					    		alert("제품코드 [" + result + "]는 현재 재고가 없습니다.");
					    	}
					    }
		        }, "text");
		    }else if(type == 3){
			    var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
		        if(confirm(msg)){
			        if(category == "product"){
				        open_login_pop();
			        }else if(category == "quick"){
				        parent.setLayer.hide();
				        setTimeout(function(){
					        open_login_pop();
				        }, 200);
			        }
			        return;
		        }
		    }
		
                /*var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
		        if(confirm(msg)){
			        if(category == "product"){
				        open_login_pop();
			        }else if(category == "quick"){
				        parent.setLayer.hide();
				        setTimeout(function(){
					        open_login_pop();
				        }, 200);
			        }
			        return;
		        }
		*/
	}else{
		var selector = "", PCD = "", url = "", msg = "";
		
		if(category == "product"){
			selector = "ul.pro-list input[type=checkbox]:checked";
		}else if(category == "quick"){
			selector = "";
		}
		
		if(type == 1){
			url = "/shop/pay/order.aspx";
		}else if(type == 2){
			url = "/shop/mypage/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
		}else if(type == 3){
			url = "/shop/mypage/wishlist.aspx";
			msg = "위시리스트에 제품을 담았습니다.\n\n확인 하시겠습니까?"
		}
		
		$(selector).each(function(i){
			PCD += $(this).val() + ",";
		});
	
		if(PCD == ""){
			alert("제품을 선택해 주세요.");
			return;
		}
		
		$.post("/shop/product/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			if($.trim(result) == "success"){
				if(type == 2 || type == 3){
					if(confirm(msg)){
						if(category == "product"){
							document.location.href = url;
						}else if(category == "quick"){
							window.open(url);
						}
					}
				}else if(type == 1){
					document.location.href = url;
				}
			}
		}, "text");
	}
}

function getItemSingle(type, PCD){
	if(LOGINID == ""){
	   
		var category = "product";
		
		if(type == 1){
			var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
		    if(confirm(msg))
		    {
			    open_login_pop();
			    return;
		    }
		}else if(type == 2){
			url = "/shop/membership_no/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
			$.post("/shop/product/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			    if($.trim(result) == "success"){
				    if(type == 2 || type == 3){
					    if(confirm(msg)){
						    if(category == "product"){
							    document.location.href = url;
						    }else if(category == "quick"){
							    window.open(url);
						    }
					    }
				    }else if(type == 1){
					    document.location.href = url;
				    }
			    }else{
	        	if(type == 2){
			    		alert("제품코드 [" + result + "]는 현재 재고가 없습니다.");
			    	}
			    }
		    }, "text");
		}else if(type == 3){
			var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
		    if(confirm(msg))
		    {
			    open_login_pop();
			    return;
		    }
		}
	    /*
		var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
		if(confirm(msg))
		{
			open_login_pop();
			return;
		}
	    */
	}else{
		var category = "product";
		
		if(type == 1){
			url = "/shop/pay/order.aspx";
		}else if(type == 2){
			url = "/shop/mypage/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
		}else if(type == 3){
			url = "/shop/mypage/wishlist.aspx";
			msg = "위시리스트에 제품을 담았습니다.\n\n확인 하시겠습니까?"
		}
	
		$.post("/shop/product/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			if($.trim(result) == "success"){
				if(type == 2 || type == 3){
					if(confirm(msg)){
						if(category == "product"){
							document.location.href = url;
						}else if(category == "quick"){
							window.open(url);
						}
					}
				}else if(type == 1){
					document.location.href = url;
				}
			}
		}, "text");
	}
}

function zoomImage(ImageUrl){
	$("#zoomedImage").attr("src", ImageUrl);
	
	setLayer.show({
		id:'zoomImage',
		opacity: .5
	});
}

function searchGlobal(){
	$("#hiddenKeyword").val($("#globalKeyword").val());
	document.searchGlobal.submit();
}

function searchGlobalByValue(v){
	$("#hiddenKeyword").val(v);
	document.searchGlobal.submit();
}

function copyToClipboard(targetText){
	if (window.clipboardData){
	  window.clipboardData.setData("Text", targetText);
	}else if (window.netscape){
	  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
	  var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
	  if (!clip) return;
	  var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
	  if (!trans) return;
	  trans.addDataFlavor('text/unicode');
	  var str = new Object();
	  var len = new Object();
	  var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
	  var copytext = targetText;
	  str.data = copytext;
	  trans.setTransferData("text/unicode",str,copytext.length*2);
	  var clipid=Components.interfaces.nsIClipboard;
	  if (!clip) return false;
	  clip.setData(trans,null,clipid.kGlobalClipboard);
	}
	
	return false;
}

function quick_login(){
	setTimeout('open_login_pop()', 500);
}

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=/; expires=" + todayDate.toGMTString() + ";"
}
	
function closeCookieLayer(CookieAndId){
	setCookie(CookieAndId, "done" , 1);
	$("#" + CookieAndId.toString()).hide();
}

function closeCookieLayer2(c, i){
	setCookie(c, "done" , 1);
	$("#" + i.toString()).hide();
}

/* 화면 가운데에 팝업
popc('압업주소','팝업이름', 가로, 세로, '스크롤여부'); */
function popc(Address, name, w, h, scroll){
	var scr = (scroll=="") ? "yes" : "no";
	var popwindow = null;
	var LeftPosition = (screen.width) ? (screen.width-w)/2:0;
	var TopPosition = (screen.height) ? (screen.height-h)/2:0;   
	var settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scr + ',resizable=no'
	popwindow = window.open(Address, name, settings);
	popwindow.focus();
}

/* 좌표 받는 팝업
pop('압업주소','팝업이름', 가로, 세로, 가로축, 세로축, '스크롤여부'); */
function pop(Address, name, w, h, l, t, scroll){
	var scr = "";
	if(scroll == ""){
		scr = "no";
	}else{
		scr = "yes";
	}
	var left = (l=="") ? 0 : l;
	var top = (t=="") ? 0 : t;
	var popwindow = null;
	var settings = 'height=' + h + ',width=' + w + ',top=' + top + ',left=' + left + ',scrollbars=' + scr + ',resizable=no'
	popwindow = window.open(Address, name, settings);
	popwindow.focus();
}

function getItemCL(category, type){
	if(LOGINID == ""){
		if(type == 1){
	    var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
        if(confirm(msg)){
	        if(category == "product"){
		        open_login_pop();
	        }else if(category == "quick"){
		        parent.setLayer.hide();
		        setTimeout(function(){
			        open_login_pop();
		        }, 200);
	        }
	        return;
        }
    }else if(type == 2){
	    var selector = "", PCD = "", url = "", msg = "";
		
      if(category == "product"){
        selector = "ul.pro-list input[type=checkbox]:checked";
      }else if(category == "quick"){
        selector = "";
      }
  		
      if(type == 1){
        url = "/order/order.aspx";
      }else if(type == 2){
        url = "/order/cart.aspx";
        msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
      }else if(type == 3){
        url = "/order/wishlist.aspx";
        msg = "위시리스트에 제품을 담았습니다.\n\n확인 하시겠습니까?"
      }
  		
      $(selector).each(function(i){
        PCD += $(this).val() + ",";
      });
  	
      if(PCD == ""){
        alert("제품을 선택해 주세요.");
        return;
      }
  		
      $.post("/division/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
        if($.trim(result) == "success"){
	        if(type == 2 || type == 3){
		        if(confirm(msg)){
			        if(category == "product"){
				        document.location.href = url;
			        }else if(category == "quick"){
				        window.open(url);
			        }
		        }
	        }else if(type == 1){
		        document.location.href = url;
	        }
        }
      }, "text");
    }else if(type == 3){
	    var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
      if(confirm(msg)){
        if(category == "product"){
	        open_login_pop();
        }else if(category == "quick"){
	        parent.setLayer.hide();
	        setTimeout(function(){
		        open_login_pop();
	        }, 200);
        }
        return;
      }
    }
	}else{
		var selector = "", PCD = "", url = "", msg = "";
		
		if(category == "product"){
			selector = "ul.pro-list input[type=checkbox]:checked";
		}else if(category == "quick"){
			selector = "";
		}
		
		if(type == 1){
			url = "/order/order.aspx";
		}else if(type == 2){
			url = "/order/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
		}else if(type == 3){
			url = "/order/wishlist.aspx";
			msg = "위시리스트에 제품을 담았습니다.\n\n확인 하시겠습니까?"
		}
		
		$(selector).each(function(i){
			PCD += $(this).val() + ",";
		});
	
		if(PCD == ""){
			alert("제품을 선택해 주세요.");
			return;
		}
		
		$.post("/division/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			if($.trim(result) == "success"){
				if(type == 2 || type == 3){
					if(confirm(msg)){
						if(category == "product"){
							document.location.href = url;
						}else if(category == "quick"){
							window.open(url);
						}
					}
				}else if(type == 1){
					document.location.href = url;
				}
			}
		}, "text");
	}
}

function getItemSingleCL(type, PCD){
	if(LOGINID == ""){
		var category = "product";
		
		if(type == 1){
			var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
	    if(confirm(msg))
	    {
		    open_login_pop();
		    return;
	    }
		}else if(type == 2){
			url = "/order/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
			$.post("/division/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			    if($.trim(result) == "success"){
				    if(type == 2 || type == 3){
					    if(confirm(msg)){
						    if(category == "product"){
							    document.location.href = url;
						    }else if(category == "quick"){
							    window.open(url);
						    }
					    }
				    }else if(type == 1){
					    document.location.href = url;
				    }
			    }
		    }, "text");
		}else if(type == 3){
			var msg = "더바디샵 회원만 이용 가능 합니다.\n\n지금 로그인 하시겠습니까?";
	    if(confirm(msg))
	    {
		    open_login_pop();
		    return;
	    }
		}
	}else{
		var category = "product";
		
		if(type == 1){
			url = "/order/order.aspx";
		}else if(type == 2){
			url = "/order/cart.aspx";
			msg = "장바구니에 제품을 담았습니다.\n\n확인 하시겠습니까?";
		}else if(type == 3){
			url = "/order/wishlist.aspx";
			msg = "위시리스트에 제품을 담았습니다.\n\n확인 하시겠습니까?"
		}
	
		$.post("/division/commonShop_ajax.aspx", { type : type, PCD : PCD + "," }, function(result){
			if($.trim(result) == "success"){
				if(type == 2 || type == 3){
					if(confirm(msg)){
						if(category == "product"){
							document.location.href = url;
						}else if(category == "quick"){
							window.open(url);
						}
					}
				}else if(type == 1){
					document.location.href = url;
				}
			}
		}, "text");
	}
}

//SNS 처리
function goTwitter(msg,Url)
{
	var tUrl= encodeURIComponent(msg+" "+Url)
	window.open("http://twitter.com/home?status="+tUrl,"Twitter","");
}

function goFacebook(Url,title,summary,img)
{   
	window.open("http://www.facebook.com/sharer.php?s=100&p[url]="+encodeURIComponent(Url)+"&p[title]="+encodeURIComponent(title)+"&p[summary]="+encodeURIComponent(summary)+"&p[images][0]="+encodeURIComponent(img),"FaceBook","");
}

function goMe2Day(msg,url)
{
	mMsg = encodeURI('"'+msg+'"');
	
	var mUrl = escape(url);
	var tags = encodeURI('origins');
	window.open("http://me2day.net/posts/new?new_post[body]="+mMsg+":"+mUrl+"&new_post[tags]="+ tags,"Me2Day","");
} 


<!--네이버 웹로그 분석-->
if( typeof HL_GUL == 'undefined' ){

var HL_GUL = 'ngc3.nsm-corp.com';var HL_GPT='80'; var _AIMG = new Image(); var _bn=navigator.appName; var _PR = location.protocol=="https:"?"https://"+HL_GUL:"http://"+HL_GUL+":"+HL_GPT;if( _bn.indexOf("Netscape") > -1 || _bn=="Mozilla"){ setTimeout("_AIMG.src = _PR+'/?cookie';",1); } else{ _AIMG.src = _PR+'/?cookie'; };
var _JV="AMZ2008090201";//script Version
var HL_GCD = 'CP2B3620468982'; // gcode
var _UD='undefined';var _UN='unknown';
function _IX(s,t){return s.indexOf(t)}
function _GV(b,a,c,d){ var f = b.split(c);for(var i=0;i<f.length; i++){ if( _IX(f[i],(a+d))==0) return f[i].substring(_IX(f[i],(a+d))+(a.length+d.length),f[i].length); }	return ''; }
function _XV(b,a,c,d,e){ var f = b.split(c);var g='';for(var i=0;i<f.length; i++){ if( _IX(f[i],(a+d))==0){ try{eval(e+"=f[i].substring(_IX(f[i],(a+d))+(a.length+d.length),f[i].length);");}catch(_e){}; continue;}else{ if(g) g+= '&'; g+= f[i];}; } return g;};
function _NOB(a){return (a!=_UD&&a>0)?new Object(a):new Object()}
function _NIM(){return new Image()}
function _IL(a){return a!=_UD?a.length:0}
function _ILF(a){ var b = 0; try{eval("b = a.length");}catch(_e){b=0;}; return b; }
function _VF(a,b){return a!=_UD&&(typeof a==b)?1:0}
function _LST(a,b){if(_IX(a,b)) a=a.substring(0,_IL(a));return a}
function _CST(a,b){if(_IX(a,b)>0) a=a.substring(_IX(a,b)+_IL(b),_IL(a));return a}
function _UL(a){a=_LST(a,'#');a=_CST(a,'://');return a}
function _AA(a){return new Array(a?a:0)}
function _IDV(a){return (typeof a!=_UD)?1:0}
if(!_IDV(HL_GUL)) var HL_GUL ='ngc3.nsm-corp.com'; 
if(!_IDV(HL_GPT)) var HL_GPT ='80';
_DC = document.cookie ;
function _AGC(nm) { var cn = nm + "="; var nl = cn.length; var cl = _DC.length; var i = 0; while ( i < cl ) { var j = i + nl; if ( _DC.substring( i, j ) == cn ){ var val = _DC.indexOf(";", j ); if ( val == -1 ) val = _DC.length; return unescape(_DC.substring(j, val)); }; i = _DC.indexOf(" ", i ) + 1; if ( i == 0 ) break; } return ''; }
function _ASC( nm, val, exp ){var expd = new Date(); if ( exp ){ expd.setTime( expd.getTime() + ( exp * 1000 )); document.cookie = nm+"="+ escape(val) + "; expires="+ expd.toGMTString() +"; path="; }else{ document.cookie = nm + "=" + escape(val);};}
function SetUID() {     var newid = ''; var d = new Date(); var t = Math.floor(d.getTime()/1000); newid = 'UID-' + t.toString(16).toUpperCase(); for ( var i = 0; i < 16; i++ ){ var n = Math.floor(Math.random() * 16).toString(16).toUpperCase(); newid += n; }       return newid; }
var _FCV = _AGC("ACEFCID"); if ( !_FCV ) { _FCV = SetUID(); _ASC( "ACEFCID", _FCV , 86400 * 30 * 12 ); _FCV=_AGC("ACEFCID");}
var _AIO = _NIM(); var _AIU = _NIM();  var _AIW = _NIM();  var _AIX = _NIM();  var _AIB = _NIM();  var __hdki_xit = _NIM();
var _gX='/?xuid='+HL_GCD+'&sv='+_JV,_gF='/?fuid='+HL_GCD+'&sv='+_JV,_gU='/?uid='+HL_GCD+'&sv='+_JV+"&FCV="+_FCV,_gE='/?euid='+HL_GCD+'&sv='+_JV,_gW='/?wuid='+HL_GCD+'&sv='+_JV,_gO='/?ouid='+HL_GCD+'&sv='+_JV,_gB='/?buid='+HL_GCD+'&sv='+_JV;

var _d=_rf=_fwd=_arg=_xrg=_av=_bv=_rl=_ak=_xrl=_cd=_cu=_bz='',_sv=11,_tz=20,_ja=_sc=_ul=_ua=_UA=_os=_vs=_UN,_je='n',_bR='blockedReferrer';
if(!_IDV(_CODE)) var _CODE = '' ;
_tz = Math.floor((new Date()).getTimezoneOffset()/60) + 29 ;if( _tz > 24 ) _tz = _tz - 24 ;
// Javascript Variables
if(!_IDV(_amt)) var _amt=0 ;if(!_IDV(_pk)) var _pk='' ;if(!_IDV(_pd)) var _pd='';if(!_IDV(_ct)) var _ct='';
if(!_IDV(_ll)) var _ll='';if(!_IDV(_ag)) var _ag=0;	if(!_IDV(_id)) var _id='' ;if(!_IDV(_mr)) var _mr = _UN;
if(!_IDV(_gd)) var _gd=_UN;if(!_IDV(_jn)) var _jn='';if(!_IDV(_jid)) var _jid='';if(!_IDV(_skey)) var _skey='';
if(!_IDV(_ud1)) var _ud1='';if(!_IDV(_ud2)) var _ud2='';if(!_IDV(_ud3)) var _ud3='';
if( !_ag ){ _ag = 0 ; }else{ _ag = parseInt(_ag); }
if( _ag < 0 || _ag > 150 ){ _ag = 0; }
if( _gd != 'man' && _gd != 'woman' ){ _gd =_UN;};if( _mr != 'married' && _mr != 'single' ){ _mr =_UN;};if( _jn != 'join' && _jn != 'withdraw' ){ _jn ='';};
if( _ag > 0 || _gd == 'man' || _gd == 'woman'){ _id = 'undefined_member';}
if( _jid != '' ){ _jid = 'undefined_member'; }
_je = (navigator.javaEnabled()==true)?'1':'0';_bn=navigator.appName;
if(_bn.substring(0,9)=="Microsoft") _bn="MSIE";
_bN=(_bn=="Netscape"),_bI=(_bn=="MSIE"),_bO=(_IX(navigator.userAgent,"Opera")>-1);if(_bO)_bI='';
_bz=navigator.appName; _pf=navigator.platform; _av=navigator.appVersion; _bv=parseFloat(_av) ;
if(_bI){_cu=navigator.cpuClass;}else{_cu=navigator.oscpu;};
if((_bn=="MSIE")&&(parseInt(_bv)==2)) _bv=3.01;_rf=document.referrer;var _prl='';var _frm=false;
function _WO(a,b,c){window.open(a,b,c)}
function ACEF_Tracking(a,b,c,d,e,f){ if(!_IDV(b)){var b = 'FLASH';}; if(!_IDV(e)){ var e = '0';};if(!_IDV(c)){ var c = '';};if(!_IDV(d)){ var d = '';}; var a_org=a; b = b.toUpperCase(); var b_org=b;	if(b_org=='FLASH_S'){ b='FLASH'; }; if( typeof CU_rl == 'undefined' ) var CU_rl = _PT(); if(_IDV(HL_GCD)){ var _AF_rl = document.URL; if(a.indexOf('://') < 0  && b_org != 'FLASH_S' ){ var _AT_rl  = ''; if( _AF_rl.indexOf('?') > 0 ){ _AF_rl = _AF_rl.substring(0,_AF_rl.indexOf('?'));}; var spurl = _AF_rl.split('/') ;	for(var ti=0;ti < spurl.length ; ti ++ ){ if( ti == spurl.length-1 ){ break ;}; if( _AT_rl  == '' ){ _AT_rl  = spurl[ti]; }else{ _AT_rl  += '/'+spurl[ti];}; }; var _AU_arg = ''; if( a.indexOf('?') > 0 ){ _AU_arg = a.substring(a.indexOf('?'),a.length); a = a.substring(0,a.indexOf('?')); }; var spurlt = a.split('/') ; if( spurlt.length > 0 ){ a = spurlt[spurlt.length-1];}; a = _AT_rl +'/'+a+_AU_arg;	_AF_rl=document.URL;}; _AF_rl = _AF_rl.substring(_AF_rl.indexOf('//')+2,_AF_rl.length); if( typeof f == 'undefined' ){ var f = a }else{f='http://'+_AF_rl.substring(0,_AF_rl.indexOf('/')+1)+f}; var _AS_rl = CU_rl+'/?xuid='+HL_GCD+'&url='+escape(_AF_rl)+'&xlnk='+escape(f)+'&fdv='+b+'&idx='+e+'&'; var _AF_img = new Image(); _AF_img.src = _AS_rl; if( b_org == 'FLASH' && a_org != '' ){ if(c==''){ window.location.href = a_org; }else{ if(d==''){ window.open(a_org,c);}else{ window.open(a_org,c,d); };};	};} ; }
function _PT(){return location.protocol=="https:"?"https://"+HL_GUL:"http://"+HL_GUL+":"+HL_GPT}
function _EL(a,b,c){if(a.addEventListener){a.addEventListener(b,c,false)}else if(a.attachEvent){a.attachEvent("on"+b,c)} }
function _NA(a){return new Array(a?a:0)}
function HL_ER(a,b,c,d){_xrg=_PT()+_gW+"&url="+escape(_UL(document.URL))+"&err="+((typeof a=="string")?a:"Unknown")+"&ern="+c+"&bz="+_bz+"&bv="+_vs+"&RID="+Math.random()+"&";
if(_IX(_bn,"Netscape") > -1 || _bn == "Mozilla"){ setTimeout("_AIW.src=_xrg;",1); } else{ _AIW.src=_xrg; } }
function HL_PL(a){if(!_IL(a))a=_UL(document.URL);
_arg = _PT()+_gU;
if( typeof HL_ERR !=_UD && HL_ERR == 'err'){ _arg = _PT()+_gE;};
if( _ll.length > 0 ) _arg += "&md=b";
_AIU.src = _arg+"&url="+escape(a)+"&ref="+escape(_rf)+"&cpu="+_cu+"&bz="+_bz+"&bv="+_vs+"&os="+_os+"&dim="+_d+"&cd="+_cd+"&je="+_je+"&jv="+_sv+"&tz="+_tz+"&ul="+_ul+"&ad_key="+escape(_ak)+"&skey="+escape(_skey)+"&age="+_ag+"&gender="+_gd+"&marry="+_mr+"&join="+_jn+"&member_key="+_id+"&jid="+_jid+"&udf1="+_ud1+"&udf2="+_ud2+"&udf3="+_ud3+"&amt="+_amt+"&frwd="+_fwd+"&pd="+escape(_pd)+"&ct="+escape(_ct)+"&ll="+escape(_ll)+"&RID="+Math.random()+"&";
setTimeout("",300);
}
_EL(window,"error",HL_ER); //window Error
if( typeof window.screen == 'object'){_sv=12;_d=screen.width+'*'+screen.height;_sc=_bI?screen.colorDepth:screen.pixelDepth;if(_sc==_UD)_sc=_UN;}
_ro=_NA();if(_ro.toSource||(_bI&&_ro.shift))_sv=13;
if( top && typeof top == 'object' &&_ILF(top.frames)){eval("try{_rl=top.document.URL;}catch(_e){_rl='';};"); if( _rl != document.URL ) _frm = true;};
if(_frm){ eval("try{_prl = top.document.URL;}catch(_e){_prl=_bR;};"); if(_prl == '') eval("try{_prl=parent.document.URL;}catch(_e){_prl='';};"); 
if( _IX(_prl,'#') > 0 ) _prl=_prl.substring(0,_IX(_prl,'#')); 
_prl=_LST(_prl,'#');
if( _IX(_rf,'#') > 0 ) _rf=_rf.substring(0,_IX(_rf,'#')); 
_prl=_LST(_prl,'/');_rf=_LST(_rf,'/');
if( _rf == '' ) eval("try{_rf=parent.document.URL;}catch(_e){_rf=_bR;}"); 
if(_rf==_bR||_prl==_bR){ _rf='',_prl='';}; if( _rf == _prl ){ eval("try{_rf=top.document.referrer;}catch(_e){_rf='';}"); 
if( _rf == ''){ _rf = 'bookmark';};if( _IX(document.cookie,'ACEN_CK='+escape(_rf)) > -1 ){ _rf = _prl;} 
else{ 
if(_IX(_prl,'?') > 0){ _ak = _prl.substring(_IX(_prl,'?')+1,_prl.length); _prl = _ak; }
if( _IX(_prl.toUpperCase(),'OVRAW=') >= 0 ){ _ak = 'src=overture&kw='+_GV(_prl.toUpperCase(),'OVRAW','&','=')+'&OVRAW='+_GV(_prl.toUpperCase(),'OVRAW','&','=')+'&OVKEY='+_GV(_prl.toUpperCase(),'OVKEY','&','=')+'&OVMTC='+_GV(_prl.toUpperCase(),'OVMTC','&','=').toLowerCase() }; 
if(_IX(_prl,'gclid=') >= 0 ){ _ak='src=adwords'; }; if(_IX(_prl,'DWIT=') >= 0 ){_ak='src=dnet_cb';}; 
if( _IX(_prl,"rcsite=") >= 0 &&  _IX(_prl,"rctype=") >= 0){ _prl += '&'; _ak = _prl.substring(_IX(_prl,'rcsite='),_prl.indexOf('&',_IX(_prl,'rcsite=')+7))+'-'+_prl.substring(_IX(_prl,'rctype=')+7,_prl.indexOf('&',_IX(_prl,'rctype=')+7))+'&'; };
if( _GV(_prl,'src','&','=') ) _ak += '&src='+_GV(_prl,'src','&','='); if( _GV(_prl,'kw','&','=') ) _ak += '&kw='+_GV(_prl,'kw','&','='); if(_prl.length>0){ _prl = _XV(_prl,'FWDRL','&','=','_rf'); _rf = unescape(_rf); _ak = _XV(_ak,'FWDRL','&','=','_prl'); }; if( typeof FD_ref=='string' && FD_ref != '' ) _rf = FD_ref;
_fwd = _GV(_prl,'FWDIDX','&','=');
document.cookie='ACEN_CK='+escape(_rf)+';path=/;'; 
}; 
if(document.URL.indexOf('?')>0 && ( _IX(_ak,'rcsite=') < 0 && _IX(_ak,'NVAR=') < 0 && _IX(_ak,'src=') < 0 && _IX(_ak,'source=') < 0 ) ) _ak =document.URL.substring(document.URL.indexOf('?')+1,document.URL.length); }; 
}
else{ 
_rf=_LST(_rf,'#');_ak=_CST(document.URL,'?');
if( _IX(_ak,"rcsite=") > 0 &&  _IX(_ak,"rctype=") > 0){
    _ak += '&';
    _ak = _ak.substring(_IX(_ak,'rcsite='),_ak.indexOf('&',_IX(_ak,'rcsite=')+7))+'-'+_ak.substring(_IX(_ak,'rctype=')+7,_ak.indexOf('&',_IX(_ak,'rctype=')+7))+'&';
}
}
_rl=document.URL;
var _trl = _rl.split('?'); if(_trl.length>1){ _trl[1] = _XV(_trl[1],'FWDRL','&','=','_rf'); _rf = unescape(_rf); _fwd = _GV(_trl[1],'FWDIDX','&','='); _rl=_trl.join('?'); 
_ak = _XV(_ak,'FWDRL','&','=','_prl');
}; if( typeof FD_ref=='string' && FD_ref != '' ) _rf = FD_ref;
if( _rf.indexOf('googlesyndication.com') > 0 ){ 
var _rf_idx = _rf.indexOf('&url=');  if( _rf_idx > 0 ){ var _rf_t = unescape(_rf.substring(_rf_idx+5,_rf.indexOf('&',_rf_idx+5)));  if( _rf_t.length > 0 ){ _rf = _rf_t ;};  };  };
_rl = _UL(_rl); _rf = _UL(_rf);

if( typeof _rf_t != 'undefined' && _rf_t != '' ) _rf = _rf_t ;
if( typeof _ak_t != 'undefined' && _ak_t != '' ) _ak = _ak_t ;

if( typeof _rf==_UD||( _rf == '' )) _rf = 'bookmark' ;_cd=(_bI)?screen.colorDepth:screen.pixelDepth;
_UA = navigator.userAgent;_ua = navigator.userAgent.toLowerCase();
if (navigator.language){  _ul = navigator.language.toLowerCase();}else if(navigator.userLanguage){  _ul = navigator.userLanguage.toLowerCase();};

_st = _IX(_UA,'(') + 1;_end = _IX(_UA,')');_str = _UA.substring(_st, _end);_if = _str.split('; ');_cmp = _UN ;

if(_bI){ _cmp = navigator.appName; _str = _if[1].substring(5, _if[1].length); _vs = (parseFloat(_str)).toString();} 
else if ( (_st = _IX(_ua,"opera")) > 0){ _cmp = "Opera" ;_vs = _ua.substring(_st+6, _ua.indexOf('.',_st+6)); } 
else if ((_st = _IX(_ua,"firefox")) > 0){_cmp = "Firefox"; _vs = _ua.substring(_st+8, _ua.indexOf('.',_st+8)); } 
else if ((_st = _IX(_ua,"netscape6")) > 0){ _cmp = "Netscape"; _vs = _ua.substring(_st+10, _ua.length);  
if ((_st = _IX(_vs,"b")) > 0 ) { _str = _vs.substring(0,_IX(_vs,"b")); _vs = _str ;  };}
else if ((_st = _IX(_ua,"netscape/7")) > 0){  _cmp = "Netscape";  _vs = _ua.substring(_st+9, _ua.length);  if ((_st = _IX(_vs,"b")) > 0 ){ _str = _vs.substring(0,_IX(_vs,"b")); _vs = _str;};
}
else{
if (_IX(_ua,"gecko") > 0){ if(_IX(_ua,"safari")>0){ _cmp = "Safari";_ut = _ua.split('/');for( var ii=0;ii<_ut.length;ii++) if(_IX(_ut[ii],'safari')>0){ _vst = _ut[ii].split(' '); _vs = _vst[0];} }else{ _cmp = navigator.vendor;  } } else if (_IX(_ua,"nav") > 0){ _cmp = "Netscape Navigator";}else{ _cmp = navigator.appName;}; _av = _UA ; 
}
if (_IX(_vs,'.')<0){  _vs = _vs + '.0'}
_bz = _cmp; 

var nhn_ssn={uid:HL_GCD,g:HL_GUL,p:HL_GPT,s:_JV,rl:_rl,m:[],run:nhn_ssn?nhn_ssn.uid:this.uid};
function CP2B3620468982(){var f={e:function(s,t){return s.indexOf(t);},d:function(s){var r=String(s); return r.toUpperCase();},f:function(o){var a;a=o;if(f.d(a.tagName)=='A' || f.d(a.tagName)=='AREA'){return a;}else if(f.d(a.tagName)=='BODY'){return 0;}else{return f.f(a.parentNode);} },ea:function(c,f){var wd;if(c=='click'){wd=window.document;}else{wd=window;}if(wd.addEventListener){wd.addEventListener(c,f,false)}else if(wd.attachEvent){wd.attachEvent("on"+c,f)} } };
var p={h:location.host,p:(location.protocol=='https:')?"https://"+nhn_ssn.g:"http://"+nhn_ssn.g+":"+nhn_ssn.p,s:'/?xuid='+nhn_ssn.uid+'&sv='+nhn_ssn.s,u:function(){var r=document.URL;r=r.replace('#','');return r+'';},ol:new Image(0,0),xL:function(x){if(typeof(Amz_T_e)==s.u){p.ol.src=p.p+p.s+'&url='+escape(nhn_ssn.rl)+'&xlnk='+escape(x)+'&xidx=0'+'&crn='+Math.random()+'&';nhn_ssn.m.push(p.ol);} } };
var s={Lp:'a.tagName=="B" || a.tagName=="I" || a.tagName== "U" || a.tagName== "FONT" || a.tagName=="I" || a.tagName=="STRONG"'  ,f:'function',	j:'javascript:',u:'undefined'};var c={Run:function(){f.ea('click',this.ec);},ec:function(e){var ok='';var m = document.all ? event.srcElement : e.target;var a=m;var o=m.tagName;if(o=="A" || o=="AREA" || o=="IMG" || eval(s.Lp)){ok=c.lc(m);if(ok.length != 0){p.xL(unescape(ok));};	};},lc:function(o){ try{var ar='';var obj;obj=f.f(o);if(typeof obj==s.u){return '';};ar = String(obj.href);if(ar.length == 0){return '';};ar=ar.replace(/\n|\s|#/g,'');ar=ar.replace(/'|"/g,' ');if(f.e(ar,'void(') == -1 && f.e(ar,'void0') == -1){	return ar;}else{return s.j + 'void(0)';};return '';}catch(er){return '';} } };
if(p.u().charAt(0) == 'h'){if(nhn_ssn.uid!=nhn_ssn.run){c.Run(); } };
};eval(nhn_ssn.uid + '();');

if( _IX(_pf,_UD) >= 0 || _pf ==  '' ){ _os = _UN ;}else{ _os = _pf ; };
if( _IX(_os,'Win32') >= 0 ){if( _IX(_av,'98')>=0){ _os = 'Windows 98';}else if( _IX(_av,'95')>=0 ){ _os = 'Windows 95';}else if( _IX(_av,'Me')>=0 ){ _os = 'Windows Me';}else if( _IX(_av,'NT')>=0 ){ _os = 'Windows NT';}else{ _os = 'Windows';};if( _IX(_ua,'nt 5.0')>=0){ _os = 'Windows 2000';};if( _IX(_ua,'nt 5.1')>=0){_os = 'Windows XP';if( _IX(_ua,'sv1') > 0 ){_os = 'Windows XP SP2';};};if( _IX(_ua,'nt 5.2')>=0){_os ='Windows Server 2003';};if( _IX(_ua,'nt 6.0')>=0){_os ='Windows Vista';};if( _IX(_ua,'nt 6.1')>=0){_os ='Windows 7';};};
_pf_s = _pf.substring(0,4);if( _pf_s == 'Wind'){if( _pf_s == 'Win1'){_os = 'Windows 3.1';}else if( _pf_s == 'Mac6' ){ _os = 'Mac';}else if( _pf_s == 'MacO' ){ _os ='Mac';}else if( _pf_s == 'MacP' ){_os='Mac';}else if(_pf_s == 'Linu'){_os='Linux';}else if( _pf_s == 'WebT' ){ _os='WebTV';}else if(  _pf_s =='OSF1' ){ _os ='Compaq Open VMS';}else if(_pf_s == 'HP-U' ){ _os='HP Unix';}else if(  _pf_s == 'OS/2' ){ _os = 'OS/2' ;}else if( _pf_s == 'AIX4' ){ _os = 'AIX';}else if( _pf_s == 'Free' ){ _os = 'FreeBSD';}else if( _pf_s == 'SunO' ){ _os = 'SunO';}else if( _pf_s == 'Drea' ){ _os = 'Drea'; }else if( _pf_s == 'Plan' ){ _os = 'Plan'; }else{ _os = _UN; };};
if( _cu == 'x86' ){ _cu = 'Intel x86';}else if( _cu == 'PPC' ){ _cu = 'Power PC';}else if( _cu == '68k' ){ _cu = 'Motorola 680x';}else if( _cu == 'Alpha' ){ _cu = 'Compaq Alpa';}else if( _cu == 'Arm' ){ _cu = 'ARM';}else{ _cu = _UN;};if( _d == '' || typeof _d==_UD ){ _d = '0*0';}

HL_PL(_rl); // Site Logging
}
<!--네이버 웹로그 분석 끝-->
