// »ùÇÃ : window.open("/member/pop_login.php?ct_open=reload", "win_login", "width=480,height=320,scroll=no,status=no,help=no");

$(function(){

	// »ó´Ü ¸Þ´º(mem) ¸¶¿ì½º ¿À¹ö/¾Æ¿ô
	$(".topm01").hover(function(){
		$(this).css({textDecoration:'underline', color:'#73909e'});
	}, function(){
		$(this).css({textDecoration:'none', color:'#898989'});
	});

	// ¹öÆ° : »ó´Ü / ¼îÇÎÄ«Æ®
	$(".bt_cart_in").click(function(){
		$.ajax({
			type : "POST", url : "/_login_ck.php",
			success:function(msg){ 
				if($.trim(msg) == "ok"){ 
					top.location.href = "/mypage/pay.php";
				}else{
					top.location.href = "/member/login.php?goto=%2Fmypage%2Fpay.php";					
				}
			}
		});
	});

	// ¹öÆ° : »ó´Ü / ¸¶ÀÌÆäÀÌÁö
	$(".bt_mypage_in").click(function(){
		$.ajax({
			type : "POST", url : "/_login_ck.php",
			success:function(msg){ 
				if($.trim(msg) == "ok"){ 
					top.location.href = "/mypage/mypage.php";
				}else{
					top.location.href = "/member/login.php?goto=%2Fmypage%2Fmypage.php";
				}
			}
		});
	});

	/**/
	// ¹öÆ° : °Ë»ö°á°ú / ¼îÇÎÄ«Æ®
	$(".bt_img_cart_in").click(function(){
		var rel = $(this).attr('rel');
		if(!rel) return false;
		$.ajax({
			type : "GET", url : "/mypage/zzim_ok.php?rt=ok&ct_func=payadd&goods_code="+rel,
			success:function(msg){ 
				if($.trim(msg) == 'ok'){ 
					if(confirm("¼îÇÎÄ«Æ®¿¡ ´ã¾Ò½À´Ï´Ù\n\n¼îÇÎÄ«Æ®·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?")){
						top.location.href = "/mypage/pay.php";
					}else{
						var Bcart_ii_rel = $(".Bcart_ii").attr('rel');
						Bcart_ii_rel++;
						$(".Bcart_ii").html('('+Bcart_ii_rel+')').attr('rel', Bcart_ii_rel);

						try{ parent.frames['t_footer'].location.reload(); 
						}catch(err){ }

					}
				}else if($.trim(msg) == "!login"){
					window.open("/member/pop_login.php?ct_open=reload", "win_login", "width=480,height=320,scroll=no,status=no,help=no");
				}
			}
		});
	});

	// ¹öÆ° : °Ë»ö°á°ú / ¶óÀÌÆ®¹Ú½º
	$(".bt_img_lbox_in").click(function(){
		var rel = $(this).attr('rel');
		if(!rel) return false;
		$.ajax({
			type : "GET", url : "/mypage/zzim_ok.php?rt=ok&ct_func=zzimadd&goods_code="+rel,
			success:function(msg){ 
				if($.trim(msg) == 'ok'){ 
					if(confirm("¶óÀÌÆ®¹Ú½º[º¸°üÇÔ]¿¡ ´ã¾Ò½À´Ï´Ù\n\n¶óÀÌÆ®¹Ú½º·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?")){
						top.location.href = "/mypage/lightbox.php";
					}else{
						try{ parent.frames['t_footer'].location.reload(); 
						}catch(err){ }
					}
				}else if($.trim(msg) == "!login"){
					window.open("/member/pop_login.php?ct_open=reload", "win_login", "width=480,height=320,scroll=no,status=no,help=no");
				}
			}
		});
	});

	//
});
