function chkLogin(){
    with(document.frmLogin){
        if("" == mid.value){
            alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
            mid.focus();
            return false;
        }
        if("" == pwd.value){
            alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
            pwd.focus();
            return false;
        }else submit();
    }
}
function sendLogin(){
    var ikeyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (ikeyCode == 13) {
        chkLogin();
    }
}
function goPage(idx){
    document.app.page.value = idx;
    chkForm();
}

function sendEnter(obj){
    var ikeyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (ikeyCode == 13) {
        chkForm();
    }
}
function goGroupRank(str){
	with(document.app){
		mode.value = str;
		target = "_self";
		action = "../rank/Rank_S.php";
		submit();
	}
}
function goNotice(idx){
    with(document.app){
        target = "_self";
        action = "../help/Notice_V.php";
        n_id.value = idx;
        submit();
    }
}
function goFind(idx){
    with(document.app){
        target = "_self";
        action = "../help/Find_L.php";
        n_id.value = idx;
        submit();
    }
}
function goFaq(idx){
    with(document.app){
        target = "_self";
        action = "../help/Faq_L.php";
        n_id.value = idx;
        submit();
    }
}
function goGroup(str){
    with(document.app){
        target = "_self";
        action = "../group/Group_L.php";
        p_part.value = str;
		page.value = 1;
        submit();
    }
}

function goTMoney(str){
    with(document.app){
        target = "_self";
        action = "../group/TMoney_L.php";
        p_part.value = str;
		page.value = 1;
        submit();
    }
}
function viewUpimg(str){
	window.open("/etc/imgView.php?uimg="+str,"Ppop","width=500,height=400,resizable=1")
}
function popProd(str){
    window.open("../popup/popProd_V.php?p_id="+str,"Ppop","width=750,height=450")
/*
    with(document.app){
        target = "Ppop";
        action = "";
        p_id.value = str;
        submit();
    }
*/
}
function prodView(str){
    with(document.app){
        target = "_self";
        action = "../group/Prod_V.php?p_id=" + str;
        p_id.value = str;
        submit();
    }
}
function goDiary(){
    with(document.app){
        target = "_self";
        action = "../diary/";
        submit();
    }
}
function goDiaryPart(str){
    with(document.app){
        target = "_self";
        p_part.value = str;
        action = "../diary/Diary_S.php";
        submit();
    }
}
function maniaView(idx){
    with(document.app){
        p_id.value = idx;
        target = "_self";
        action = "../play/Mania_V.php";
        submit();
    }
}

function oopsView(idx){
    with(document.app){
        p_id.value = idx;
        target = "_self";
        action = "../play/Oops_V.php";
        submit();
    }
}
function blahView(idx){
    with(document.app){
        p_id.value = idx;
        target = "_self";
        action = "../play/Blah_V.php";
        submit();
    }
}
function cartoonView(ids, idx){
    with(document.app){
        c_id.value = ids;
        p_id.value = idx;
        target = "_top";
        action = "../play/Cartoon_M.php";
        submit();
    }
}
function brandView(str){
    with(document.app){
        target = "_self";
        action = "../brand/Brand_V.php?c_id="+str;
        c_id.value = str;
        page.value=1;
        submit();
    }
}
function brandPart(idx,str){
    with(document.app){
        target = "_self";
        action = "../brand/Brand_V.php";
        c_id.value = idx;
        ppart.value = str;
        page.value=1;
        submit();
    }
}
function goTheme(idx){
    with(document.app){
        target = "_self";
        action = "../play/Theme_M.php";
        p_id.value = idx;
        submit();
    }
}

function goEvent(idx){
    with(document.app){
        p_id.value = idx;
        target = "_self";
        action = "../event/Event_V.php?p_id=" +idx;
        submit();
    }
}

function eventPart(str){
    with(document.app){
        n_id.value = str;
        target = "_self";
        action = "../event/Event_M.php";
        submit();
    }
}
function delTalk(idx){
    with(document.frmTalk){
        if("" != subchk.value){
            alert("ÇöÀç ÀÛ¼ºÇÏ½Å ±ÛÀ» »èÁ¦ÇÏ´Â ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä.");
            return false;
        }
        if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
            t_id.value=idx;
            subchk.value="S";
            target = "_self";
            action = "../etc/Talk_D.php";
            submit();
        }
    }
}
function chkTalk(){
    with(document.frmTalk){
        if("" != subchk.value){
            alert("ÇöÀç ÀÛ¼ºÇÏ½Å ±ÛÀ» µî·ÏÇÏ´Â ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä.");
            return false;
        }
        if(w_id.value == ""){
            alert("ÀÛ¼ºÀÚÀÇ ´Ð³×ÀÓÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
            w_id.focus();
            return false;
        }else{
			if(getCookie("cGrant") != "S"){
				tmps = w_id.value;
				if(tmps.search("ÈÄÃß") != -1){
					alert("ÀÛ¼ºÀÚÀÇ ´Ð³×ÀÓ¿¡ 'ÈÄÃß'¶ó´Â ´Ü¾î´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
					w_id.select();
					return false;
				}
				if(tmps.search("°ü¸®ÀÚ") != -1){
					alert("ÀÛ¼ºÀÚÀÇ ´Ð³×ÀÓ¿¡ '°ü¸®ÀÚ'¶ó´Â ´Ü¾î´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
					w_id.select();
					return false;
				}
			}
        }
        var str = talk.value;
        if(str == ""){
            alert("ÇÑÁÙ ÅåÅåÀ» 100ÀÚ ÀÌ³»·Î Àû¾îÁÖ¼¼¿ä.");
            talk.focus();
            return false;
        }else{
            str = notValidStr(str);
            if(str != ""){
                alert("»ç¿ëÀÌ ±ÝÁöµÈ ´Ü¾î(" + str + ")°¡ Æ÷ÇÔÀÌ µÇ¾îÀÖ½À´Ï´Ù.");
                return false;
            }
        }
        if(confirm("ÀÛ¼ºÇÏ½Å ±ÛÀ» µî·ÏÇÏ½Ã°Ú½À´Ï±î?")){
            subchk.value="S";
            target = "_self";
            action = "../etc/Talk_I.php";
            submit();
        }
    }
}

function goMainDir(str){
	location.href= "http://www.hoochootong.com" + str;
}

function goNaver(){
	window.open("http://www.naver.com/");
}
function notValidStr(str){
    var rs = "";
    var noStr = new Array("½Ö³â","½Ö³ð","ºù½Å","Á¿±î","Á¿°°Àº°Ô","¾Ã»õ³¢","¾¾¹ß","¾¾ÆÈ","½Ã¹ú","¾¾¹ú","¾¾¹ú","¶°±×¶ö","Á¿¹ä","¾¾¹ë³Ñ");
    for (i=0; i< noStr.length; i++){
        if (str.indexOf(noStr[i]) != -1){
            rs = noStr[i];
            break;
        }
    }
    return rs;
}

function setCookie( name, value, expiredays ) {
        var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
}
function getCookie( name ) {
        var nameOfCookie = name + "="; 
        var x = 0; 
        while ( x <= document.cookie.length ) {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&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<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function Layers_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf('?'))>0&&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<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=Layers_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.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; }
}