﻿// JScript File

// 업소 팝업창 띄우기
function PopupShopHompy(id)
{
	var shopWin = PopupCenter("../Shop/ShopHome.aspx?shop=" + id, 'ShopHompy', '948', '612', 'no');
	shopWin.focus();	
}

function ShowInfo()
{
	divInfo.style.display = "";
}

function HideInfo()
{
    divInfo.style.display = "none";
}

// s1: 고유번호
// s2: 업소명
// s3: 소개
// s4: 주인성명
// s5: 전화번호
// s6: 휴대전화
function SetInfo(s1, s2, s3, s4, s5, s6, x, y)
{
	var text;
	text = 
    '        <!--정보보기 시작-->' +
    '            <table width="162" border="0" cellpadding="0" cellspacing="0">' +
    '                <tr>' +
    '                    <td><img src="../images/info_bg01.gif" width="162" height="6"></td>' +
    '                </tr>' +
    '                <tr>' +
    '                    <td align="center" background="../images/info_bg02.gif">' +
    '                        <table width="144" border="0" cellpadding="0" cellspacing="0">' +
    '                            <tr>' +
    '                                <td>' +
    '                                    <!--업소이름 시작-->' +
    '                                    <table width="144" height="20" border="0" cellpadding="0" cellspacing="0">' +
    '                                        <tr>' +
    '                                            <td width="5" bgcolor="#02B598">&nbsp;</td>' +
    '                                            <td align="left" bgcolor="#02B598" class="info01">' + s2 + '</td>' +
    '                                        </tr>' +
    '                                    </table>' +
    '                                    <!--업소이름 끝-->' +
    '                                </td>' +
    '                            </tr>' +
    '                            <tr>' +
    '                                <td height="5">' +
    '                                </td>' +
    '                            </tr>' +
    '                            <tr>' +
    '                                <td>' +
    '                                    <!--사진,전화번호,주소 시작-->' +
    '                                    <table width="144" border="0" cellpadding="0" cellspacing="0">' +
    '                                        <tr>' +
    '                                            <td width="66">' +
    '                                                <img src="../Data/Shop/' + s1 + '/profile/__thumb.jpg" width="66" height="50"></td>' +
    '                                            <td width="2">' +
    '                                                &nbsp;</td>' +
    '                                            <td align="left" class="info02">' + s3 +
    '                                            </td>' +
    '                                        </tr>' +
    '                                    </table>' +
    '                                    <!--사진,전화번호,주소 끝-->' +
    '                                </td>' +
    '                            </tr>' +
    '                            <tr>' +
    '                                <td height="10">' +
    '                                </td>' +
    '                            </tr>' +
    '                            <tr>' +
    '                                <td>' +
    '                                    <table width="144" border="0" cellpadding="0" cellspacing="0">' +
    '                                        <tr>' +
    '                                            <td class="info02">' +
    '                                                <div align="right" class="freebtxt05">' +
    '                                                    <!--기타 소개 시작-->' +
    '                                                    <table width="144" border="0" cellpadding="0" cellspacing="0">' +
    '                                                        <tr>' +
    '                                                            <td width="50" class="freebtxt05">' +
    '                                                                <div align="right" class="info03">' +
    '                                                                    주인성명 |</div>' +
    '                                                            </td>' +
    '                                                            <td width="5">' +
    '                                                                &nbsp;</td>' +
    '                                                            <td align="left" class="info04">' + s4 + '</td>' +
    '                                                        </tr>' +
    '                                                    </table>' +
    '                                                    <table width="144" border="0" cellpadding="0" cellspacing="0">' +
    '                                                        <tr>' +
    '                                                            <td width="50" class="freebtxt05">' +
    '                                                                <div align="right" class="info03">' +
    '                                                                    전화번호 |</div>' +
    '                                                            </td>' +
    '                                                            <td width="5">' +
    '                                                                &nbsp;</td>' +
    '                                                            <td align="left" class="info04">' + s5 + '</td>' +
    '                                                        </tr>' +
    '                                                    </table>' +
    '                                                    <table width="144" border="0" cellpadding="0" cellspacing="0">' +
    '                                                        <tr>' +
    '                                                            <td width="50" class="freebtxt05">' +
    '                                                                <div align="right" class="info03">' +
    '                                                                    휴대전화 |</div>' +
    '                                                            </td>' +
    '                                                            <td width="5">' +
    '                                                                &nbsp;</td>' +
    '                                                            <td align="left" class="info04">' + s6 + '</td>' +
    '                                                        </tr>' +
    '                                                    </table>' +
    '                                                    <!--기타 소개 끝-->' +
    '                                                </div>' +
    '                                            </td>' +
    '                                        </tr>' +
    '                                    </table>' +
    '                                </td>' +
    '                            </tr>' +
    '                        </table>' +
    '                    </td>' +
    '                </tr>' +
    '                <tr>' +
    '                    <td>' +
    '                        <img src="../images/info_bg03.gif" width="162" height="6"></td>' +
    '                </tr>' +
    '            </table>' +
    '        <!--정보보기 끝-->';
	divInfo.innerHTML = text;

    if (s1 == "82")
    {
	    divInfo.style.left = (x-162) + "px";
	    divInfo.style.top = y + "px";
	}
	else
	{
	    divInfo.style.left = (x+16) + "px";
	    divInfo.style.top = y + "px";
	}
}

function ShowAll()
{
	var form = window.document.all;
	
	for (var i = 0; i < form.length; i++)
	{
		if (document.all[i].tagName != null && document.all[i].tagName == "DIV")
		{
			if (document.all[i].id.indexOf("divShop") > -1)
			{
				document.all[i].style.display = bAllFlag ? "" : "none";
			}
		}
	}

	bAllFlag = !bAllFlag;
}

function ShowTextAll()
{
	var form = window.document.all;
	
	for (var i = 0; i < form.length; i++)
	{
		if (document.all[i].tagName != null && document.all[i].tagName == "DIV")
		{
			var strID = document.all[i].id;
			
			if (strID.indexOf("divShopText") > -1)
			{
				if (document.all[strID.replace(/Text/, "")].style.display == "")  // 보여진 경우에만 처리
				{
					if (document.all[i].style.display == "")
						document.all[i].style.display = "none";
					else
						document.all[i].style.display = "";
				}
			}
		}
	}
}

function Show(shopType)
{
	var form = window.document.all;
	
	for (var i = 0; i < form.length; i++)
	{
		if (document.all[i].tagName != null && document.all[i].tagName == "DIV")
		{
			if (document.all[i].id.indexOf("divShop") > -1 && document.all[i].id.indexOf("_"+shopType) > -1)
			{
				document.all[i].style.display = bAllFlag ? "" : "none";
			}
		}
	}

	bAllFlag = !bAllFlag;
}

function ShowText(shopType)
{
	var form = window.document.all;
	
	for (var i = 0; i < form.length; i++)
	{
		if (document.all[i].tagName != null && document.all[i].tagName == "DIV")
		{
			var strID = document.all[i].id;
			
			if (document.all[i].id.indexOf("divShopText") > -1 && document.all[i].id.indexOf("_"+shopType) > -1)
			{
				if (document.all[strID.replace(/Text/, "")].style.display == "")  // 보여진 경우에만 처리
				{
					if (document.all[i].style.display == "")
						document.all[i].style.display = "none";
					else
						document.all[i].style.display = "";
				}
			}
		}
	}
}

