﻿var URLList = "http://list.yes24.com";
function LayerFormView(oDIV, strLayer) {
	if (document.all) {
		oDIV.innerHTML = strLayer;
		oDIV.style.posLeft = event.clientX + 2;
		oDIV.style.posTop = event.clientY + document.body.scrollTop + 6;
		oDIV.style.visibility = "visible";
	}
}

//회원닉네임클릭시
function mbrLayerForm(MBR_ID, reviewYn, listYn, MsgYn, friendYn, rType, lType, mType, fType) {
	if (document.all) {
		strLayer = "";
		strLayer += "<table width='115' height='60' border='0' cellpadding='0' cellspacing='1' bgcolor='D4D4D4'>\n";
		strLayer += "    <tr>\n";
		strLayer += "        <td align='center' bgcolor='FAFAFA'>\n";
		strLayer += "            <table width='80%' border='0' cellspacing='0' cellpadding='0' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '1', '" + MBR_ID + "', '', '');return false;\">블로그 보기</a></td></tr>\n";

		strLayer += "                <tr><td height='3'></td></tr>\n";
		strLayer += "                <tr><td height='1' background='/images/dot_2px.gif'></td></tr>\n";
		strLayer += "                <tr><td height='5'></td></tr>\n";

		//친구등록
		if(MsgYn=="Y")
			strLayer += "                <tr><td><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '5', '" + MBR_ID + "', '', '" + fType + "');return false;\">친구등록</a></td></tr>\n";
		else
			strLayer += "                <tr><td><font color='888888'>친구등록</font></td></tr>\n";

		strLayer += "            </table>\n";
		strLayer += "        </td>\n";
		strLayer += "    </tr>\n";
		strLayer += "</table>\n";


		LayerFormView(oDIVLayer1, strLayer);
	}
}

//블로그형 글보기
function artLayerForm(MBR_ID, ART_SEQ_NO, scrapYn, sType) {
	if (document.all) {

		strLayer = "";
		strLayer += "<table width='115' border='0' cellpadding='0' cellspacing='1' bgcolor='D4D4D4'>\n";
		strLayer += "    <tr>\n";
		strLayer += "        <td align='center' bgcolor='FAFAFA'>\n";
		strLayer += "            <table width='80%' border='0' cellspacing='0' cellpadding='0' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		if(scrapYn!="N"){
			if(scrapYn =="Y") {
				strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '7', '" + MBR_ID + "', '" + ART_SEQ_NO + "', '" + sType + "');return false;\">스크랩</a></td></tr>\n";
			}
			else {
				if (sType != "4")
					strLayer += "                <tr><td style='padding: 3 0 1 0'><font color='888888'>스크랩</font></td></tr>\n";
			}

			strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '8', '" + MBR_ID + "', '" + ART_SEQ_NO + "', '" + sType + "');return false;\")>프린트</a></td></tr>\n";
		}
		else
		{
			strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '8', '" + MBR_ID + "', '" + ART_SEQ_NO + "', '" + sType + "');return false;\")>프린트</a></td></tr>\n";
		}
		strLayer += "            </table>\n";
		strLayer += "        </td>\n";
		strLayer += "    </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
	}
}

//리스트보기
function listLayerForm(MBR_ID, LIST_SEQ_NO, scrapYn, sType, friendYn, fType, qs) {
	if (document.all) {

		strLayer = "";
		strLayer += "<table width='115' height='45' border='0' cellpadding='0' cellspacing='1' bgcolor='D4D4D4'>\n";
		strLayer += "    <tr>\n";
		strLayer += "        <td align='center' bgcolor='FAFAFA'>\n";
		strLayer += "            <table width='80%' border='0' cellspacing='0' cellpadding='0' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		if(scrapYn!="N"){
			if(scrapYn =="Y"){
		        strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '13', '" + MBR_ID + "', '" + LIST_SEQ_NO + "', '" + sType + "');return false;\">스크랩</a></td></tr>\n";}
		    else{
		        strLayer += "                <tr><td style='padding: 3 0 1 0'><font color='888888'>스크랩</font></td></tr>\n";}

		    strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '14', '" + MBR_ID + "', '" + LIST_SEQ_NO + "', '" + qs + "');return false;\")>프린트</a></td></tr>\n";
		}
		else{
		    strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '14', '" + MBR_ID + "', '" + LIST_SEQ_NO + "', '" + qs + "');return false;\")>프린트</a></td></tr>\n";
		}
		strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '15', '" + MBR_ID + "', '" + LIST_SEQ_NO + "', '');return false;\")>엑셀다운로드</a></td></tr>\n";
		if(friendYn!="N"){
		    strLayer += "                <tr><td height='3'></td></tr>\n";
		    strLayer += "                <tr><td height='1' background='/images/dot_2px.gif'></td></tr>\n";
		    strLayer += "                <tr><td height='5'></td></tr>\n";
			if(friendYn =="Y")
		        strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '16', '" + MBR_ID + "', '" + LIST_SEQ_NO + "', '" + fType + "');return false;\")>친구에게보내기</a></td></tr>\n";
		    else
		        strLayer += "                <tr><td style='padding: 0 0 1 0'><font color='888888'>친구에게보내기</font></td></tr>\n";
		}
		strLayer += "            </table>\n";
		strLayer += "        </td>\n";
		strLayer += "    </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
	}
}

//상품..
function goodsLayerForm(MBR_ID, ART_SEQ_NO, gType) {
	if(document.all) {

		strLayer = "";
		strLayer += "<table width='115' border='0' cellpadding='0' cellspacing='1' bgcolor='D4D4D4'>\n";
		strLayer += "    <tr>\n";
		strLayer += "        <td align='center' bgcolor='FAFAFA'>\n";
		strLayer += "            <table width='80%' border='0' cellspacing='0' cellpadding='0' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		if(gType != "N"){
		    strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '9', '" + MBR_ID + "', '" + ART_SEQ_NO + "');return false;\">포스트보기</a></td></tr>\n";
		    strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '10', '" + MBR_ID + "', '" + ART_SEQ_NO + "');return false;\")>리뷰보기</a></td></tr>\n";
		    strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '11', '" + MBR_ID + "', '" + ART_SEQ_NO + "');return false;\")>메모보기</a></td></tr>\n";
		    strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '12', '" + MBR_ID + "', '" + ART_SEQ_NO + "');return false;\")>리스트보기</a></td></tr>\n";
		}
		else{
		    strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '9', '" + MBR_ID + "', '" + ART_SEQ_NO + "');return false;\">포스트보기</a></td></tr>\n";
		    strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '12', '" + MBR_ID + "', '" + ART_SEQ_NO + "');return false;\")>리스트보기</a></td></tr>\n";
		}
		strLayer += "            </table>\n";
		strLayer += "        </td>\n";
		strLayer += "    </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
	}
}

//카트로 복사/이동
function cartLayerForm(MBR_ID, ART_SEQ_NO, copyYn, cType, moveYn, mType) {
	if(document.all) {

		strLayer = "";
		strLayer += "<table width='115' border='0' cellpadding='0' cellspacing='1' bgcolor='D4D4D4'>\n";
		strLayer += "    <tr>\n";
		strLayer += "        <td align='center' bgcolor='FAFAFA'>\n";
		strLayer += "            <table width='80%' border='0' cellspacing='0' cellpadding='0' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		if(moveYn!="N"){
			strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '17', '" + MBR_ID + "', '" + ART_SEQ_NO + "', '" + cType + "');return false;\">카트로 복사</a></td></tr>\n";
			strLayer += "                <tr><td style='padding: 0 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '18', '" + MBR_ID + "', '" + ART_SEQ_NO + "', '" + mType + "');return false;\")>카트로 이동</a></td></tr>\n";
		}
		else
		{
			strLayer += "                <tr><td style='padding: 3 0 1 0'><a href='#' onclick=\"javascript:layer_Menu(oDIVLayer1, '17', '" + MBR_ID + "', '" + ART_SEQ_NO + "', '" + cType + "');return false;\")>카트로 복사</a></td></tr>\n";
		}
		strLayer += "            </table>\n";
		strLayer += "        </td>\n";
		strLayer += "    </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
	}
}


function layer_Menu(oDIV, no, mbr_id, art_seq_no, jType) {
	oDIV.style.visibility='hidden';
	//회원닉네임클릭시▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨
	if(no == 1){	//블로그 보기
		this.location.href="/" +mbr_id;
	}
	else if (no == 2){	//리뷰보기
		this.location.href="/blog/BlogPersonalMain.aspx?blogid=" +mbr_id;
	}
	else if (no == 3){	//리스트보기
		if(jType=="3")
			this.location.href=URLList + "/bloglist/ListListAll.aspx?blogid=" +mbr_id;
		else if(jType=="4")
			alert("해당블로거는 리스트메뉴를 사용하지 않습니다.");
	}
	else if (no == 4){	//쪽지보내기
		if(jType=="5")
			reqLog();
		else if(jType=="6")
			alert("권한이 없습니다.");
		else if(jType=="8")
			alert("자신에게는 쪽지를 보낼 수 없습니다.");
		else if(jType=="7")
			window.open('/lib/libSendMemo.aspx?recv=' + mbr_id,'Msg','width=340,height=350,toolbar=no,scrollbars=no,status=no');
	}
	else if (no == 5){	//친구등록
		if(jType=="5")
			reqLog();
		else if(jType=="8")
			alert("자신을 친구로 등록할 수 없습니다.");
		else if(jType=="9")
			alert("이미 등록되어 있습니다.");
		else if(jType=="10")
			window.open('/blog/blogRegistFriendPop.aspx?blogid='+ mbr_id,'regFrd','width=275,height=220,toolbar=no,scrollbars=no,status=no');
	}
	else if (no == 6){	//클럽초대
			window.open('/blog/blogClubInvitePop.aspx?blogid='+ mbr_id,'club','width=300,height=350,toolbar=no,scrollbars=no,status=no');
	}
	//▨▨▨▨▨▨포스트블로그형보기▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨
	else if (no == 7){	//스크랩
		if(jType == "1")
			reqLog();
		else if(jType == "3")
			chgMbrStat(mbr_id);    //<--블로그 아이디 말고 자기 아이디
		else if(jType == "5")
			alert("권한이 없습니다.");
		else if(jType == "6")
			alert("해당글은 스크랩이 금지되어있습니다.");
		else
			window.open('/blog/blogScrapPop.aspx?blogid='+ mbr_id +'&artseqno=' + art_seq_no,'post_scrap','width=330,height=210,toolbar=no,scrollbars=no,status=yes');

	}
	else if (no == 8){	//프린트
		window.open('/lib/blogArtPrintLayer.aspx?blogid='+ mbr_id +'&artseqno=' + art_seq_no,'view_info','width=616,height=630,toolbar=no,scrollbars=no,status=yes');
	}
	//▨▨▨▨▨▨리뷰&메모블로그형보기▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨
	else if (no == 9){	//포스트보기
		this.location.href="/main/MainSearchGoodPost.aspx?goodsno="+ art_seq_no;
	}
	else if (no == 10){	//리뷰보기
		this.location.href="/main/MainSearchGoodReview.aspx?goodsno="+ art_seq_no;
	}
	else if (no == 11){	//메모보기
		this.location.href="/main/MainSearchGoodMemo.aspx?goodsno="+ art_seq_no;
	}
	else if (no == 12){	//리스트보기
		this.location.href="/main/MainSearchGoodList.aspx?goodsno="+ art_seq_no;
	}
	//▨▨▨▨▨▨리스트▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨
	else if (no == 13){	//리스트스크랩
		if(jType == "1")
			reqLog();
		else if(jType == "3")
			chgMbrStat(mbr_id);    //<--블로그 아이디 말고 자기 아이디
		else if(jType == "5")
			alert("권한이 없습니다.");
		else if(jType == '6')
		    chgMenuList(mbr_id);    //<--블로그 아이디 말고 자기 아이디
		else
			window.open(URLList + '/bloglist/listScrapPop.aspx?blogid='+ mbr_id +'&listseqno=' + art_seq_no,'list_scrap','width=330,height=180,toolbar=no,scrollbars=no,status=yes');

	}
	else if (no == 14){	//리스트프린트
		window.open('/lib/blogArtPrintLayer.aspx?blogid='+ mbr_id +'&listseqno=' + art_seq_no + "&qs=" + escape(jType),'view_info','width=616,height=630,toolbar=no,scrollbars=no,status=yes');
		//alert("리스트프린트");
	}
	else if (no == 15){	//엑셀다운로드
		alert("서비스 준비중입니다.");
	}
	else if (no == 16){	//친구에게 보내기
		if(jType == "1")
			reqLog();
		else if(jType == "3")
			chgMbrStat(mbr_id);
		else if(jType == "5")
			alert("권한이 없습니다.");
		else
		    window.open(URLList + '/bloglist/listSendFrdPop.aspx?blogid='+ mbr_id + "&listseqno=" +art_seq_no,'list_send','width=405,height=390,toolbar=no,scrollbars=no,status=yes');
	}
	//▨▨▨▨▨카트로복사이동▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨
	else if(no==17){//카트로 복사
	    if(chk_submit())
		{
	        document.forms[0].FuncType.value="cartcopy";
	        document.forms[0].submit();
	    }
	}
	else if(no==18){
		if(chk_submit())
		{
	        document.forms[0].FuncType.value="cartmove";
	        document.forms[0].submit();
	    }
	}


	//▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨▨

}

function Toggle(menuNm, openNm, val){
	openLayer = eval("document.all." +openNm+ ".style");
	tenLayer = eval("document.all." +menuNm+ "TenSpan.style");
	closeLayer = eval("document.all." +menuNm+ "CloseSpan.style");

	if (val == "open"){
		openLayer.display="none";
		tenLayer.display = "block";
		closeLayer.display = "block";
	}
	else if (val == "close"){
		openLayer.display="block";
		tenLayer.display = "none";
		closeLayer.display = "none";
	}
}


// 물음표 버튼 눌렀을때... Layer
function open_qmark(val){
	if (document.all) {
		strLayer="";

		if(val=="summary"){
			strCont = "글이 너무 길어질 경우, 내용을 한꺼번에 보여주지 않고, <더보기>를 클릭했을 때 보여지게 할 수 있습니다.";
		}
		else if(val=="notice"){
			strCont = "지금 작성하려는 글이 내 블로그에 방문한 모든 사람에게 알려야 할 공지글일때 체크해주세요. 블로그 상단에 글이 뜹니다.";
		}
		else if(val=="trackback"){
			strCont = "다른 사람의 포스트와 관련된 글을 쓸 때 그 포스트의 트랙백주소를 입력하세요<br>양쪽 포스트에서 서로 관련된 글임을 자동으로 표시가 됩니다.";
		}
		else if(val=="tag"){
			strCont = "자신의 글 내용과 관련된 단어입니다. 자신이 직접 내용의 핵심을 나타내는 단어를 키워드로 입력해두면 분류의 정리에 도움이 되고, 같은 태그를 사용하는 사람들의 글도 볼 수 있습니다.";
		}

		strLayer += "<table width='210' border='0' cellspacing='0' cellpadding='0'>\n";
		strLayer += "  <tr>\n";
		strLayer += "    <td style='padding: 7'> \n";
		strLayer += "      <table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='CCCCB9'>\n";
		strLayer += "        <tr>\n";
		strLayer += "          <td bgcolor='F8F8ED' style='padding:10 10 7 10'> \n";
		strLayer += "            <table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
		strLayer += "              <tr> \n";
		strLayer += "                <td valign=\"top\">\n";
		//내용
		strLayer += "<img src=\"/images/center_agree02.gif\" align=\"right\" style=\"cursor:hand;\" onclick=\"oDIVLayer2.style.visibility='hidden';\" />" + strCont
		strLayer += "                </td>\n";
		strLayer += "              </tr>\n";
		//strLayer += "              <tr>\n";
		//strLayer += "                <td align='right' style='padding: 3 0 0 0'>[<a href='#'><font color='FF6344'>자세히보기</font></a>]</td>\n";
		//strLayer += "              </tr>\n";
		strLayer += "            </table></td>\n";
		strLayer += "        </tr>\n";
		strLayer += "      </table> \n";
		strLayer += "    </td>\n";
		strLayer += "  </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer2, strLayer);
	}
}

//Yes24 바로가기
function yes24LayerForm() {
	if (document.all) {

		strLayer = "";
		strLayer += "<table width='95' border='0' cellpadding='0' cellspacing='1' bgcolor='D4D4D4'>\n";
		strLayer += "    <tr>\n";
		strLayer += "        <td align='center' bgcolor='FAFAFA' style='padding:2 0 2 0;'>\n";
		strLayer += "            <table width='80%' border='0' cellspacing='0' cellpadding='0' onmouseover=\"mouse_on_layer(oDIVLayer1, true);\" onmouseout=\"mouse_on_layer(oDIVLayer1, false);\">\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/\">YES24홈</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/Main/Book.aspx?CategoryNumber=001\">국내도서</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/Main/Foreign.aspx?CategoryNumber=002\">외국도서</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://edu.yes24.com/\">e-러닝</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/Main/Music.aspx?CategoryNumber=003\">음반</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/Main/Dvd.aspx?CategoryNumber=004\">DVD/비디오</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://movie.yes24.com/\">영화</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/Main/Gift.aspx?CategoryNumber=006\">GIFT</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/Main/beauty.aspx?CategoryNumber=008\">화장품</a></td></tr>\n";
		strLayer += "                <tr><td style='padding: 3 0 1 0'><a href=\"http://www.yes24.com/home/chyes/index.asp\">채널예스</a></td></tr>\n";
		strLayer += "            </table>\n";
		strLayer += "        </td>\n";
		strLayer += "    </tr>\n";
		strLayer += "</table>\n";

		LayerFormView(oDIVLayer1, strLayer);
	}
}





var is_on_layer1 = false;

function mouse_on_layer(oDIV, bool) {
	if (oDIV.id == "oDIVLayer1")
		is_on_layer1 = bool;
}


document.onclick = backclick;

function backclick(e) {
}

