<!--#include virtual="/common/file/head_01message.asp"-->
<%

'response.write mysilguk()
'response.write Request.Cookies("M_sms") & "," & Request.Cookies("M_JobLevel")
'발송건에 대한 고유번호
randomize
jw1		= Int((100 * Rnd) + 1) 
jw2		= replace(right(now(),8),":","")
a_num	= trim(jw1) + trim(jw2)

'--------------------실국 리스트-------------------------
sql = "select bdm_idx, bdm_menuname from bd_menu_page where bdm_ref = 0 order by bdm_code"
Set buseo_rs = DbCon.Execute(sql)
If buseo_rs.bof Or buseo_rs.eof Then
	buseo_data1 = Null
Else
	buseo_data1 = buseo_rs.getrows
End If
Set buseo_rs = Nothing
'-------------------실국 리스트 끝-----------------------

'---------------개인주소록 그룹 리스트-------------------------
sql = "select bdm_idx, bdm_menuname, (select count(*) from bd_address_page where bdm_idx = a.bdm_idx) as cnt from bd_address as a where bdm_id = '"&session("ss_m_id")&"' and bdm_ref = 0 order by bdm_code"
Set juso_rs = DbCon.Execute(sql)
If juso_rs.bof Or juso_rs.eof Then
	juso_data1 = Null
Else
	juso_data1 = juso_rs.getrows
End If
Set juso_rs = Nothing
'-------------------개인주소록 리스트 끝-----------------------

%>

<script type="text/javascript" src="/common/js/total.js"></script>
<script type="text/javascript">
//<![CDATA[
var M_sms;
M_sms = '1';	//sms등급 전역변수 생성

//발송-----------

function smsSend(){
<%if session("ss_m_id") = "" then%>
	var frm;
	frm = document.login_frm;
	alert("로그인후 사용할 수 있습니다.");
	frm.m_id.focus();
}
<%else%>
	var eForm = document.getElementById("frmMsg");
	if((eForm.message.value == '메세지를 입력하세요!')||(eForm.message.value == '')){
		alert("메세지를 입력하세요!");
		eForm.message.focus();
		return;
	}
	if(eForm.callback.value.split(" ").join("") == ""){
		alert("송신자 번호를 입력하세요.");
		eForm.callback.focus();
		return;
	}
	if((list_rec.length - 1) > parseInt(eForm.smsQty.value)){
		alert("당월 남은 건수가 부족합니다.");
		return;
	}
	if(list_rec.length == 1){
		alert("받는사람을 선택하세요.");
		return;
	}
	eForm.list_rec.value = "";	//초기화 안시키면 계속누적!
	for (var i = 0; i < list_rec.options.length; i++) {		
		eForm.list_rec.value = eForm.list_rec.value + list_rec.options[i].value+",";
	}
	//eForm.list_rec.value = list_rec.value;
	eForm.submit();
}
<%end if%>

//]]>
</script>
<script type="text/javascript" src="/common/calendar/total.js"></script>

<!---달력---->
<div id="ifrmcal" style="z-index:1;position: absolute;left:40px;top:0px;width:123px;height:0px;border-left:0px solid buttonhighlight;border-right:1px solid buttonshadow;border-top:0px solid buttonhighlight;border-bottom: 1px solid buttonshadow;visibility: hidden;">
<iframe name="calendarfrm" src="/common/calendar/ifrmcalendar2.htm" width="100%" height="111" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" title="미니달력"></iframe>
</div>
<!---달력---->

<!--특수문자-->
<div id="schar" style="position:absolute; left:850px; top:290px; width:145px; height:87px; z-index:2;border-left:0px solid buttonhighlight;border-right:1px solid buttonshadow;border-top:0px solid buttonhighlight;border-bottom: 1px solid buttonshadow;visibility: hidden;">
<iframe name="scharfrm" src="./etcchar.html" width="100%" height="121" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"></iframe>
</div>
<!--특수문자-->



<!-- 컨텐츠 부분-->
        <td width="720" align="left" valign="top">
		<table width="720" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="560" align="left" valign="top" style="padding-bottom:30px;"><img src="/sms_img/sub/stit_01.gif" width="97" height="69" /></td>
            <td width="300" align="right" valign="bottom" style="padding-bottom:30px;"><img src="/sms_img/sub/home.gif" width="14" height="10" /><img src="/sms_img/sub/arrow.gif" width="14" height="10" /><span class="style9">문자메세지</span><img src="/sms_img/sub/arrow.gif" width="14" height="10" /><span class="style11">단문전송</span></td>
          </tr>

<!-- 핸드폰 전송 부분-->
          <tr>
            <td colspan="2">
			<table width="720" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="270" height="462" align="left" valign="top" style="background:url(/sms_img/sub/phone_bg.jpg) no-repeat; padding:75px 0 0 28px;">

				<form id="frmMsg" name='frmMsg' method='post' action='./send_sms.asp'>
				<input type="hidden" name="list_rec" value="">
				<input type="hidden" name="a_num" value="<%=a_num%>">
				<input type="hidden" name="smsQty" value="<%=smsSelect()%>">
				<table width="166" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
						<div style="padding-left:30px;">
							<textarea id="message" name="message" onkeyup="updateChar(80);" onfocus="setCleanMsg();updateChar(80);" style='border:none; font-size: 9pt; overflow: hidden; color:#ffffff; width: 100px; height:90px; background-color:transparent; color: #3b3b3b;'>메세지를 입력하세요!</textarea>
						</div>
					</td>
                  </tr>
                  <tr>
                    <td height="30" align="left" valign="top">
					<table width="166" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td align="left" valign="top" width="46"><a href="javascript:etcChar()"><img src="/sms_img/sub/phone_b01.gif" width="46" height="17" border="0" /></a></td>
                        <td align="left" valign="top"><a href="javascript:document.frmMsg.reset();" onfocus="blur();"><img src="/sms_img/sub/phone_b02.gif" width="38" height="17" border="0" /></a></td>
                        <td align="right" valign="top"><span class="style9"><span id="textlimit" style="font-weight:bold;">0</span>/80 Byte</span> </td>
                      </tr>
                    </table>
					</td>
                  </tr>
                  <tr>
                    <td height="21" style="background:url(/sms_img/sub/num_bg.gif) no-repeat;padding-left:55px">
						<input name="callback" type="text" size="11" maxlength="13" onkeyup="addDash(this);" value='<%=Replace(Trim(SESSION("ss_m_mobile")),"-","")%>' style="width:90px;height:16px;background:transparent;color:#ffffff; padding:0; border:0;font-weight:bold;"/>
					</td>
                  </tr>
                  <tr>
                    <td style="padding:5px 0 10px 0;">
						<input type="checkbox" id="resOrNot" name="resOrNot" value="Y" />
						<span class="style13"><label for="resOrNot">예약발송</label></span>
					</td>
                  </tr>
                  <tr>
                    <td align="left" valign="top" style="padding-top:6px;">
					<table width="114" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><input name="date" id="date" type="text" class="style9" value="<%=Date()%>" size="10" style="height:12px;" readonly="readonly" /></td>
                        <td align="left" valign="top" style="padding:3px 0 3px 5px;"><a href="javascript:calendarBtn(document.getElementById('date'));"><img src="/sms_img/sub/phone_b03.gif" width="38" height="17" border="0" /></a></td>
                      </tr>
                      <tr>
                        <td colspan="2" align="left" valign="top" style="padding-top:2px;">
						<select id="time1" name="time1" class="style9">
						<%
							For i = 0 To 23
								i_value = Right("0" & i, 2)
						%>
							<option value="<%=i_value%>"><%=i_value%>시</option>
						<%
							next
						%>
						</select>
						&nbsp;
						<select id="time2" name="time2" class="style9">
						<%
							For i = 0 To 50 Step 10
								i_value = Right("0" & i, 2)
						%>
							<option value="<%=i_value%>"><%=i_value%>분</option>
						<%
							next
						%>
						</select>
						</td>
                      </tr>
                    </table>
					</td>
                  </tr>
                  
                  <tr>
                    <td style="padding-top:12px;"><a href="#send" onclick="smsSend();" onkeypress="smsSend();"><img src="/sms_img/sub/btn_send.gif" width="166" height="26" border="0" /></a></td>
                  </tr>
                </table>
				</form>
				</td>

<!--주소록 부분-->
                <td width="467" align="left" valign="top" style="background:url(/sms_img/sub/sms_bg.gif) no-repeat; padding:29px 0 0 20px;">
				<table width="428" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td align="left" valign="top">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="3" style="padding-bottom:13px;"><img src="/sms_img/sub/sms01_tit.gif" width="161" height="25" /></td>
                      </tr>
                      <tr>
                        <td width="69" align="left" valign="top">
							<input id="mobile" type="text" size="12" onkeyup="addDash(this);if(event.keyCode ==13){add_input(this);}" maxlength="13" style="font-size:11px;width:65px;height:15px" />
							<!-- <img src="/sms_img/sub/sms_input.gif" width="65" height="19" /> -->
						</td>
                        <td align="left" valign="top"><a href="#addnumber" onclick="add_input(document.getElementById('mobile'));" onkeypress="add_input(document.getElementById('mobile'));"><img src="/sms_img/sub/btn_plus.gif" width="46" height="21" border="0" /></a></td>
                        <td align="left" valign="top"><a href="#csvadd" onclick="window.showModalDialog('csvadd.asp', self, 'dialogWidth:398px;dialogHeight:480px;centet:yes;scrollbars=yes;status=no');"><img src="/sms_img/sub/btn_file.gif" width="46" height="21" border="0" /></a></td>
                      </tr>
                      <tr>
                        <td colspan="3" style="padding:10px 0 10px 0;">
							<select id="list_rec" multiple size="29" style="font-size:11px;width:161px;height:225px;">
								<option value="0"> --- 받는사람 목록 --- </option>
							</select>
							<!-- <img src="/sms_img/sub/sms_box.gif" width="161" height="225" /> -->
						</td>
                      </tr>
                      <tr>
                        <td colspan="3">
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="43" align="left" valign="top"><a href="#del" onclick="memDel();" onkeypress="memDel();"><img src="/sms_img/sub/btn_del.gif" width="43" height="29" border="0" /></a></td>
                            <td align="left" valign="top"><a href="#delall" onclick="memDelAll();" onkeypress="memDelAll();"><img src="/sms_img/sub/btn_alldel.gif" width="63" height="29" border="0"/></a></td>
                          </tr>
                        </table>
						</td>
                        </tr>
                    </table>
					</td>
                    <td width="109" align="center" valign="middle"><a href="#add" onclick="memAdd(juso_mem);"><img src="/sms_img/sub/btn_plus2.gif" width="80" height="27" border="0" /></a></td>
                    <td align="left" valign="top">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="2" style="padding-bottom:13px;"><img src="/sms_img/sub/sms02_tit.gif" width="69" height="25" /><a href="javascript:sMasterAdd();"><img src="/sms_img/sub/sms03_tit.gif" width="92" height="25" border="0" /></a></td>
                      </tr>
                      <tr>
                        <td width="69" align="left" valign="top">
							<!-- <img src="/sms_img/sub/sms_input.gif" width="65" height="19" /> -->
							<select id="jusoGrp" name="jusoGrp" style="font-size:11px;width:85px;height:20px" onchange="memSelect(this.value,'bd_address_page',document.getElementById('juso_mem'));">
								<%						
									If Not(IsNull(juso_data1)) Then
										For i = 0 To UBound(juso_data1, 2)
								%>
									<option value="<%=juso_data1(0, i)%>"><%=juso_data1(1, i)%>(<%=juso_data1(2, i)%>)</option>
								<%
										Next
									End if
								%>
									<option value="0">그룹미지정</option>
								</select>
						</td>
                        <td align="left" valign="top"><a href="#groupall" onclick="Addr_grp_add();" onkeypress="Addr_grp_add();"><img src="/sms_img/sub/btn_group.gif" width="65" height="21"  border="0" /></a></td>
                        </tr>
                      <tr>
                        <td colspan="2" style="padding:10px 0 10px 0;">
							<iframe id="juso_mem" name="juso_mem" src="buseo_list.asp?bdm_idx=all" scrolling="yes" frameborder="1" style="width:161px;height:225px;"></iframe>
							<script type="text/javascript">
							//<![CDATA[
								memSelect(document.getElementById("jusoGrp").value,'bd_address_page',document.getElementById("juso_mem"));
							//]]>
							</script>
							<!-- <img src="/sms_img/sub/sms_box.gif" width="161" height="225" /> -->
						</td>
                      </tr>
                      <tr>
                        <td colspan="2">
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="43" align="left" valign="top"><a href="#allchk" onclick="chkAll(juso_mem.document.mem_list.check,true);" onkeypress="chkAll(juso_mem.document.mem_list.check,true);"><img src="/sms_img/sub/btn_all.gif" width="61" height="29" border="0" /></a></td>
                              <td align="left" valign="top"><a href="#allchkno" onclick="chkAll(juso_mem.document.mem_list.check,false);" onkeypress="chkAll(juso_mem.document.mem_list.check,false);"><img src="/sms_img/sub/btn_allc.gif" width="60" height="29" border="0" /></a></td>
                              <td align="left" valign="top"><a href="#search" onclick="window.open('addr_person.asp','addr_person','width=400,height=450')"><img src="/sms_img/sub/btn_search.gif" width="40" height="29" border="0" /></a></td>
                            </tr>
                        </table>
						</td>
                      </tr>
                    </table>
					</td>
                  </tr>
                </table>
				</td>
              </tr>
            </table>
			</td>
          </tr>

<!--이모티콘 부분-->
          <tr>
            <td colspan="2" align="left" valign="top" height="300">
			<iframe src="m_emoticon.asp" id="aaa" width="100%" height="330" align="center"  valign="top" frameborder="0"  name=main><!-- onLoad="resizeIframe(this)">--></iframe>
			
			</td>
          </tr>
        </table>
		</td>
      </tr>
    </table>
<!--#include virtual="/common/file/bottom.asp"-->
