if(typeof(__embed_target_id)=='undefined'){
var __embed_target_id = null;
}
/**
* embed 패치를 적용할 태그를 설정합니다
* 기본값은 object,eembed,appelt 태그입니다
* false 값인경우 패치에서 제외됩니다
*/
if(typeof(__embed_tags)=='undefined'){
var __embed_tags = {object:true,embed:true,applet:false}
}
/**
* 플래쉬파일중 flashvars 를 사용할경우 해당 플래쉬의 오브젝트아이디:true 값으로 object를 등록해 주세요
*/
var __flash_force_objs = {};
if(document.attachEvent){
document.write('');
document.attachEvent('onreadystatechange',
function (){
if(__embed_target_id===null){
var __target = document;
}else{
var __target = document.getElementById(__embed_target_id);
}
if (document.readyState == "complete"){
function _replace(obj){
var obj_re = document.createElement(obj.outerHTML);
obj_re.style.display='inline';
obj.parentNode.replaceChild(obj_re,obj);
}
function _inner(obj){
obj.style.display='inline';
var html = obj.outerHTML;
var classid = obj.classid.toLowerCase();
if(classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' && typeof(__flash_force_objs[obj.id])=='undefined'){//flash 인경우
obj.insertAdjacentHTML('beforeBegin',html);
obj.parentNode.removeChild(obj);
}else{
//변경하고자하는 ActiveX classid 를 추가하시기 바랍니다
if(classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' || //media 7
classid=='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' || //6.4
classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' ||
classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'
){//media player 10
embed_pos = html.indexOf('embed');
if(embed_pos!=-1){//embed 가 존재하는경우
var embed = '<'+html.substr(embed_pos);
embed = embed.substr(0,embed.length-9);
obj.insertAdjacentHTML('beforeBegin',embed);
obj.parentNode.removeChild(obj);
}else{
//object로만 되어 있는경우 동영상 부분만 패치한다
var embed = document.createElement('embed');
var total = obj.childNodes.length;
embed.setAttribute('autostart',0);
if(obj.width){
embed.setAttribute('width',obj.width);
}
if(obj.height){
embed.setAttribute('height',obj.height);
}
for(var k=0;k0){
_inner(objs[i]);
}
}
if(__embed_tags.embed===true){
var objs = __target.getElementsByTagName('embed');
var i = objs.length;
while(i-->0){
_replace(objs[i])
}
}
if(__embed_tags.applet===true){
var objs = __target.getElementsByTagName('applet');
var i = objs.length;
while(i-->0){
_replace(objs[i])
}
}
}
}
);
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
if ( bNetscape4plus ) {
yMenuFrom = document["divMenu"].top;
yMenuTo = top.pageYOffset + 62;
}
else if ( bExplorer4plus ) {
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = document.body.scrollTop + 234;
}
timeoutNextCheck = 300;
if ( Math.abs (yButtonFrom - (yMenuTo + 50)) < 6 && yButtonTo < yButtonFrom ) {
setTimeout ("CheckUIElements()", timeoutNextCheck);
return;
}
if ( yButtonFrom != yButtonTo ) {
yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
if ( yButtonTo < yButtonFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divLinkButton"].top += yOffset;
else if ( bExplorer4plus )
divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
if ( yMenuTo < yMenuFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divMenu"].top += yOffset;
else if ( bExplorer4plus )
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function quickmenu()
{
var y;
if ( top.frames.length )
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 50;
document["divMenu"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 50;
divMenu.style.visibility = "visible";
}
CheckUIElements();
return true;
}
/**********************************************************************************
예전 comm_nsi_script.js 부분
***********************************************************************************/
// 농시미 타임즈 부분
function getYear() {
return (new Date()).getYear();
}
function getMonth() {
var month = (new Date()).getMonth()+1;
if(month<10) month = "0"+month;
return month;
}
function getDay() {
var day = (new Date()).getDate();
if(day<10) day = "0"+day;
return day;
}
function getDate() {
return getYear()+'-'+getMonth()+'-'+getDay();
}
function goLogin() {
alert("로그인 해 주세요.");
}
function onlyNumber(obj)
{
key =obj.event.keyCode;
if ( key == 13 || key == 9 )
{ // 엔터,TAB
return true;
}
if (key == 91 || key == 92 || key == 93 || key == 229 || key == 21 || key == 25 || key == 19) return true;
if (key >= 112 && key <= 123) { // function key
obj.event.returnValue = true;
return true;
}
if ((key == 40) || (key == 38 )) { // 위, 아래 화살표
obj.event.returnValue = true;
return true;
}
if (( key > 95) && ( key < 106 )) { // 우측 키패드 숫자 key
obj.event.returnValue = true;
return true;
}
if (( key > 47) && ( key < 58 )) { // 키보드 상단 숫자 key
obj.event.returnValue = true;
return true;
}
if (( key == 37)||( key == 39 )||( key == 46)||( key == 8 )) { // 좌,우 화살표,DEL,BACKS,-
obj.event.returnValue = true;
return true;
}
if (obj.event.altKey || obj.event.shiftKey || obj.event.ctrlKey)
{
obj.event.returnValue = true;
return true;
}
if (( key > 36) && ( key < 41 ))
{ // 좌,상,우,하 화살표
obj.event.returnValue = true;
return true;
}
if (( key > 32) && ( key < 37 ))
{ // Page-Up, Page-Down, End, Home
obj.event.returnValue = true;
return true;
}
if (( key == 45) || ( key == 46 ) || ( key == 144 ))
{ // Insert,Delete,NumLock
obj.event.returnValue = true;
return true;
}
if (( key == 46)||( key == 8 )||( key == 17)||( key == 18 )||( key == 20)||( key == 27 ))
{ // DEL,BACKS,Ctrl,Alt,CapsLock,Esc
obj.event.returnValue = true;
return true;
}
obj.event.returnValue=false;
//alert('숫자만 입력 가능합니다.');
return false;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
function win_open(url,x,y,scrollerbar){
var hp;
var vp;
var windows;
hp = ( screen.width - x ) / 2 + 1;
vp = ( screen.height - y ) / 2 + 1;
var winatt="width="+x+",height="+y+",toolbars=no,scrollbars="+scrollerbar+",esizable=no,status=no,left="+hp+",top="+vp;
windows = window.open(url,"winpop",winatt);
}
function replace(str,regular_expression,replacement_string)
{
var re = new RegExp(regular_expression,"ig");
return str.replace(re,replacement_string);
return str;
}
function goPopup(val){
if(val==""){
alert("로그인 해 주세요.");
}else{
var url = "http://www.nongshimi.com/nsi/tim/wrt_deft_pro.jsp?mem_id="+val;
win_open(url,400,213,"NO");
}
}
function goDetail(cat_code, cat_seq, data_seq){
var strUrl = "./time_prev_viw.jsp?cat_code="+cat_code+"&cat_seq="+cat_seq+"&data_seq="+data_seq;
win_open(strUrl,"600","540","yes");
}
function delete_Char(source,char)
{
if (typeof(source) == "string")
{
return replace(source,char,'');
}
else if (typeof(source) == "object")
{
source.value = replace(source.value,char,'');
}
else
{
alert("지원하지 않는 형태입니다.");
}
}
function display_Money(str)
{
var div = str.length % 3;
var s_str="";
if (div == 0 ) {
count = (str.length/3)-1;
}else{
count = (str.length-div) /3;
}
for (i=1;i<=count;i++){
s_str =str.substr(str.length-3,3)+s_str;
str = str.substr(0,str.length-3);
if (str.length>0){
s_str =","+s_str;
}
}
s_str = str + s_str;
if(s_str.substr(0,1) == "-"){
s_str = delete_Char(s_str.substr(0,2),',')+s_str.substr(2);
}
return s_str;
}
function goMenu(cat_code){
var catcode = cat_code.substring(0,2);
switch(catcode){
case '01': document.shMaster.action="news_deft_idx.jsp";
break;
case '02': document.shMaster.action="news_deft_idx.jsp?menu_code=02";
break;
case '03': document.shMaster.action="news_deft_idx.jsp?menu_code=03";
break;
case '04': document.shMaster.action="news_deft_idx.jsp?menu_code=04";
break;
case '05': document.shMaster.action="news_deft_idx.jsp?menu_code=05";
break;
case '06': document.shMaster.action="news_deft_idx.jsp?menu_code=06";
break;
case '07': document.shMaster.action="news_deft_idx.jsp?menu_code=07";
break;
case '08': document.shMaster.action="news_deft_idx.jsp?menu_code=08";
break;
case '09': document.shMaster.action="news_deft_idx.jsp?menu_code=09";
break;
case '10': document.shMaster.action="news_deft_idx.jsp?menu_code=10";
break;
case '11': document.shMaster.action="news_deft_lst.jsp?menu_code=11&cate_code=111";
break;
}
document.shMaster.cat_code.value = cat_code;
document.shMaster.times_menu.value = cat_code;
document.shMaster.submit();
}
function goMenulst(cate_code, cate_seq){
var catcode_tmp = cate_code.substring(0,2);
switch(catcode_tmp){
case '01': document.shMaster.action="news_deft_lst.jsp?menu_code=01&cate_code="+cate_code;
break;
case '02': document.shMaster.action="news_deft_lst.jsp?menu_code=02&cate_code="+cate_code;
break;
case '03': document.shMaster.action="news_deft_lst.jsp?menu_code=03&cate_code="+cate_code;
break;
case '04': document.shMaster.action="news_deft_lst.jsp?menu_code=04&cate_code="+cate_code;
break;
case '05': document.shMaster.action="news_deft_lst.jsp?menu_code=05&cate_code="+cate_code;
break;
case '06': document.shMaster.action="news_deft_lst.jsp?menu_code=06&cate_code="+cate_code;
break;
case '07': document.shMaster.action="news_deft_lst.jsp?menu_code=07&cate_code="+cate_code;
break;
case '08': document.shMaster.action="news_deft_lst.jsp?menu_code=08&cate_code="+cate_code;
break;
case '09': document.shMaster.action="news_deft_lst.jsp?menu_code=09&cate_code="+cate_code;
break;
case '10': document.shMaster.action="news_deft_lst.jsp?menu_code=10&cate_code="+cate_code;
break;
case '11': document.shMaster.action="news_deft_lst.jsp?menu_code=11&cate_code="+cate_code;
break;
}
document.shMaster.cate_code.value = cate_code;
document.shMaster.cate_seq.value = cate_seq;
document.shMaster.submit();
}
function goPropose(){
document.shMaster.action="/nsi/tim/jost_deft_int1.jsp";
document.shMaster.submit();
}
function goInfoWrite(){
document.shMaster.action="/nsi/tim/jost_deft_int.jsp";
document.shMaster.submit();
}
//-------- 이하 하단기타---------------------
//관리자에게 메일
function down02_1(){
SendMailMaster();
}
//이메일주소무단수집거부
function down02_3(){
comPop('/cmm/nMail.jsp','농심홈페이지','toolbar=no,top=1,left=1,width=488,height=187 scrollbars=no,resizable=no');
}
//개인정보보호정책
function down02_2(){
doAdd();
}
function doAdd() {
document.form.action="<%=opAddUserPage%>";
document.form.submit();
}
function comPop(filename,title,cond){
window.open(filename,title,cond);
}
function onepass_AddUser()
{
path = "https://sso.nongshim.com/onepass/onepass_adduser.jsp?sid=COC&rtnurl=http://www.cocoichibanya.co.kr";
window.location.href=path;
}
/////////////////////////Main 발송 /////////////////////////////
var vChildWin = new Array(1);
function OpenWindow(vGubn,vUrl,vWinInfo,vWinName) {
if (vChildWin[vGubn] != null) vChildWin[vGubn].close();
vChildWin[vGubn] = window.open(vUrl,vWinName,vWinInfo);
if (vChildWin[vGubn].opener == null) vChildWin[vGubn].opener = window;
}
// "All 발송" 버튼을 클릭하였을 경우.....
function AllMail() {
var vUrl,vWinInfo,vWinName;
vWinInfo = " toolbar=no,location=no ,directories=no,status=no, ";
vWinInfo += " menubar=no,scrollbars=no,resizable=no ,copyhistory=no,";
vWinInfo += " width=500,height=420,left=370,top=200";
vWinName = "MailALL";
if(document.liMaster.txtMCount.value == "0") {
alert("메일 발송할 대상이 없습니다.");
return false;
}
vUrl = "/cmm/pMail.jsp?txtType=QUERY&txtTo=" + document.liMaster.txtMailSQL.value;
OpenWindow(1,vUrl,vWinInfo,vWinName);
}
// Mail 발송 버튼 클릭시...
function SendMail() {
var vUrl,vWinInfo,vWinName;
vWinInfo = " toolbar=no,location=no ,directories=no,status=no, ";
vWinInfo += " menubar=no,scrollbars=no,resizable=no ,copyhistory=no,";
vWinInfo += " width=500,height=420,left=370,top=200";
vWinName = "MailOne";
var vMailList = "";
var vStr = "";
var vForm = "";
var vCnt = Number(document.liMaster.txtMCount.value); // 현재 생성된 객체의 Count
var vOkCnt = 0;
// 체크 Count 초기화...
for (var i = 1; i < vCnt ; i++) { // 객체의 갯수 만큼..
vStr = "document.liMaster.chkMail" + i; // 객체변수 생성...
vForm = eval(vStr); // 객체로 재평가..
if (vForm.checked == true && vForm.value != "" ) { // Click여부 Check
vOkCnt += 1; // Click 객수 Count
vMailList += vForm.value + ";"; // 선택된 제품코드를 구분자를 두어 저장한다..
}
}
if (vOkCnt == 0) {
alert("메일이 없으면 발송할수 없습니다.");
return false;
}
vUrl = "/cmm/pMail.jsp?txtType=EMAIL&txtTo="+vMailList;
OpenWindow(2,vUrl,vWinInfo,vWinName);
}
function SendMailMaster() {
var vUrl,vWinInfo,vWinName;
vWinInfo = " toolbar=no,location=no ,directories=no,status=no, ";
vWinInfo += " menubar=no,scrollbars=no,resizable=no ,copyhistory=no,";
vWinInfo += " width=510,height=372,left=370,top=200";
vWinName = "MailOne";
var vMailList = "";
vUrl = "/cmm/pMail.jsp?txtType=ADMIN&txtTo="+vMailList;
OpenWindow(2,vUrl,vWinInfo,vWinName);
}
/************************************
* 날짜 type 인지를 검사
************************************/
function date_type_check(strDate) {
if ((strDate.length) < 8) {
return -4;
}
var Fyyyy = strDate.substring(0,4);
var Fmm = strDate.substring(4,6);
var Fdd = strDate.substring(6,8);
if (Fyyyy<1900) {
return -1;
}
if (Fmm < 1 || Fmm >12) {
return -2;
}
if (Fdd < 1 || Fdd >31) {
return -3;
}
return 0;
}
/************************************
* 날짜 From~To 체크
* From이 To보다 클수없다.
************************************/
function date_check_ft(fdate,tdate) {
var Fyyyy = fdate.substring(0,4);
var Fmm = fdate.substring(4,6);
var Fdd = fdate.substring(6,8);
var Tyyyy = tdate.substring(0,4);
var Tmm = tdate.substring(4,6);
var Tdd = tdate.substring(6,8);
var datef = Fyyyy+"/"+Fmm+"/"+Fdd;
var datet = Tyyyy+"/"+Tmm+"/"+Tdd;
if (datef>datet) {
return -1;
}
return 0;
}
/************************************
* 문자열 타입체크
* type : 체크할 문자타입 (A,N,AN)
* val : 체크할 문자열
************************************/
function checkAN( type, val ) {
var regExpr;
if ( type == 'A' ) { // 알파벳만...
regExpr = /^[a-zA-Z]+$/;
} else if ( type == 'N' ) { // 숫자만...
regExpr = /^[0-9]+$/;
} else if ( type == 'AN' ) { // 알파벳, 숫자만...
regExpr = /^[a-zA-Z0-9]+$/;
}
if ( !regExpr.test( val ) ) {
return false;
}
return true;
}
/************************************
* 문자의 앞뒤 공백 제거 함수
************************************/
function trim(inString){
var i;
var istrLen = String(inString).length;
var bFrontChk = false;
var bRearChk = false;
var iFront = -1;
var iRear = istrLen;
var j = istrLen-1;
inString = String(inString);
for (i=0; i < istrLen; i++) {
if(!bFrontChk){
if(inString.charAt(i) != " "){
iFront = i;
bFrontChk = true;
}
}
if(!bRearChk){
if(inString.charAt(j) != " "){
iRear = j+1
bRearChk = true;
}
}
j--
}
if(iFront == -1) {
return "";
}else {
return inString.substring(iFront,iRear);
}
}
/************************************
* 널체크를 위한 공통 스크립트
************************************/
function NullCheckT(InObj, InMsg) {
if (InObj.value == "") {
alert(InMsg + " 입력하세요");
InObj.focus();
InObj.select();
return true;
}
return false;
}
/************************************
* 널체크를 위한 공통 스크립트(select)
************************************/
function NullCheckS(InObj, InMsg) {
if (InObj.value == "") {
alert(InMsg + " 선택하세요");
InObj.focus();
return true;
}
return false;
}
/************************************
* textarea 글자수 제한
************************************/
function fc_chk_byte(aro_name,ari_max) {
var ls_str = aro_name.value; // 이벤트가 일어난 컨트롤의 value 값
var li_str_len = ls_str.length; // 전체길이
var li_max = ari_max; // 제한할 글자수 크기
var i = 0; // for문에 사용
var li_byte = 0; // 한글일경우는 2 그밗에는 1을 더함
var li_len = 0; // substring하기 위해서 사용
var ls_one_char = ""; // 한글자씩 검사한다
var ls_str2 = ""; // 글자수를 초과하면 제한할수 글자전까지만 보여준다.
for(i=0; i< li_str_len; i++) {
ls_one_char = ls_str.charAt(i); // 한글자추출
// 한글이면 2를 더한다.
if (escape(ls_one_char).length > 4) {
li_byte += 2;
// 그밖의 경우는 1을 더한다.
} else {
li_byte++;
}
// 전체 크기가 li_max를 넘지않으면
if(li_byte <= li_max) {
li_len = i + 1;
}
}
// 전체길이를 초과하면
if(li_byte > li_max) {
alert( li_max + " 글자를 초과 입력할수 없습니다. \n 초과된 내용은 자동으로 삭제 됩니다. ");
ls_str2 = ls_str.substr(0, li_len);
aro_name.value = ls_str2;
return true;
}
return false;
}
/************************************
* 일정길이 이상 입력시 포커스 이동
* (예:주민등록번호)
************************************/
function moveFocus(objInput1,length,objInput2) {
if(objInput1.value.length >= length) {
objInput2.focus();
}
}
/************************************
* 새창오픈함수
************************************/
function newWindow(url, objName, width, height, scroll) {
var x = (window.screen.width-width) / 2;
var y = (window.screen.height-height) / 2;
var CalOpen = window.open(url, objName, "scrollbars=" + scroll + ", left=0, top=0, width=" + width + ", height=" + height + ", top=" + y + ", left=" + x);
}
/************************************
* 숫자만 입력가능하게 하는 함수
************************************/
function chkNum(form){
var digits="0123456789";
var temp
for (var i=0;i 128) {
alert('영문과 숫자조합으로 입력해주십시요.');
x.value="";
x.focus();
return;
}
}
}
/************************************
* 체크박스 전체선택 함수
************************************/
function check(theForm){
cbox = theForm.menuChk;
if(cbox.length) { // 여러 개일 경우
for(var i = 0; i