
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) { //v3.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); 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_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; }
}

function MM_shLayer() { //v3.0
  var i,p,v,obj,args=MM_shLayer.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')?'block':(v='hide')?'none':v; }
    obj.display=v; }
}


function hideLayer() {
}


//°Ë»ö Ã¼Å© ½ÃÀÛ
var bool_bg = false;
function check_bg (val) {
        val.value='';
        document.searchform.kw.value = '';
        document.searchform.co.value = '';
        document.searchform.sa.value = '';
        document.searchform.st.value = '';
        document.searchform.so.value = '';
        document.searchform.keyword.value = '';
        bool_bg = true;

}
function Set_Action()
{
        var wheres = document.searchform.where.value;
        var Sel_Keyword = document.searchform.keyword.value;
        var postvalue = '';
        if(document.searchform.keyword.value == ''){
                alert('°Ë»ö ¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
                return false;
        }
        switch (wheres)
        {
                case "all":
                        document.searchform.action = "http://search.hankooki.com/search.php";
                        document.searchform.kw.value = Sel_Keyword;
                        document.searchform.co.value = '';
                        document.searchform.sa.value = 'all';
                        document.searchform.st.value = '0';
                        document.searchform.so.value = '1';
                        break;
                case "article" :
                        document.searchform.kw.value = Sel_Keyword;
                        document.searchform.co.value = 'sp';
                        document.searchform.sa.value = 'all';
                        document.searchform.st.value = '0';
                        document.searchform.so.value = '1';
                        document.searchform.mode.value = 'gisa';
                        document.searchform.action ="http://search.hankooki.com/search.php";
                        break;
                case "photo" :
                        document.searchform.kw.value = Sel_Keyword;
                        document.searchform.mode.value ='eyenews';
                        document.searchform.co.value ='eyenews';
                        document.searchform.action = "http://search.hankooki.com/search.php";
                        break;
		case "freechal" :
                        document.searchform.kw.value = Sel_Keyword;
                        document.searchform.mode.value ='freechal';
                        document.searchform.co.value ='freechal';
                        document.searchform.action = "http://search.hankooki.com/search.php";
                        break;
                case "digital" :
                        document.searchform.kw.value = Sel_Keyword;
                        document.searchform.mode.value ='digital';
                        document.searchform.co.value ='digital';
                        document.searchform.action = "http://search.hankooki.com/search.php";
                        break;
                case "blog" :
                        document.searchform.kw.value = Sel_Keyword;
                        document.searchform.mode.value ='blog';
                        document.searchform.co.value ='blog';
                        document.searchform.action = "http://search.hankooki.com/search.php";
                        break;
        }
        return true;

}

//ui °³Æí °Ë»ö °ü·Ã
var searc_bg = false;
function check_search (val) {
        val.value='';
        document.isearch.kw.value = '';
        document.isearch.co.value = '';
        document.isearch.sa.value = '';
        document.isearch.st.value = '';
        document.isearch.so.value = '';
        document.isearch.keyword.value = '';
        searc_bg = true;

}
function GoAction()
{
        var wheres = document.isearch.title.value;
        var Sel_Keyword = document.isearch.keyword.value;
        var postvalue = '';
        if(document.isearch.keyword.value == ''){
                alert('°Ë»ö ¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
                return false;
        }
        document.isearch.action = "http://search.hankooki.com/search.php";
        document.isearch.kw.value = Sel_Keyword;
        document.isearch.co.value = '';
        document.isearch.sa.value = 'all';
        document.isearch.st.value = '0';
                                document.isearch.so.value = '1';

        return true;

}
function MenuSearch(){
        document.write("<table width=\"737\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
        document.write("     <form name=isearch method=get action=\"http://search.hankooki.com/search.php\" onSubmit='return GoAction()'>");
        document.write("            <input type=hidden name=kw value=''>");
        document.write("       <input type=hidden name=co value=''>");
        document.write("       <input type=hidden name=sa value=''>");
        document.write("       <input type=hidden name=st value=''>");
        document.write("       <input type=hidden name=so value=''>");
        document.write("       <input type=hidden name=mode value=''>");
        document.write("       <input type=hidden name=title value='all'>");
        document.write("<tr>");
        document.write("<td width=60 height=\"28\" align=\"right\"><img src=\"http://img.hankooki.com/site/m13.gif\"></td><td><input name=\"keyword\" type=\"text\" size=\"50\" class=\"f1\" onclick=\"check_search(this)\">&nbsp;<input type=image src=\"http://img.hankooki.com/site/m14.gif\" width=\"39\" height=\"19\" border=\"0\" align=\"absmiddle\"></td>");
        document.write("</tr>");
        document.write("</form>");
        document.write("</table>");
}
//°Ë»ö Ã¼Å© ³¡

//ÆË¾÷Ã¢ ½ÃÀÛ
	//ÀÏ¹Ý ÆË¾÷
function window_open2(urls, widths, heights){
	window.open( urls, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+widths+',height='+heights);
}
function window_slide(urls){
	window.open( urls, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=788,height=680');
}
function window_movie(urls){
	window.open( urls, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=610,height=400');
}
function window_slide2(urls){
	window.open( urls, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=785,height=680');
}
//ÆË¾÷Ã¢ ½ÃÀÛ

//ÀüÃ¼±â»çº¸±â ÆË¾÷
function opengisa(){
window.open('http://www.hankooki.com/totallist/gisalist.php?media=sp','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1020,height=730');
}


// ÇÁ¸°Æ®
function PrintOpen(srcurl){
        printurl = "/service/print/Print.php?po="+srcurl;
        window.open(printurl, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=100,top=10,width=700,height=758');
}

//±â»ç¸ÞÀÏº¸³»±â ÄíÅ° °ª
function TimetoString(date) {
    var year  = date.getFullYear();
    var month = date.getMonth() + 1; // 1¿ù=0,12¿ù=11ÀÌ¹Ç·Î 1 ´õÇÔ
    var day   = date.getDate();
    var hour  = date.getHours();
    var min   = date.getMinutes();
    var sec   = date.getSeconds();
    var rnd_val = Math.ceil(100*Math.random());

    if (("" + month).length == 1) { month = "0" + month; }
    if (("" + day).length   == 1) { day   = "0" + day;   }
    if (("" + hour).length  == 1) { hour  = "0" + hour;  }
    if (("" + min).length   == 1) { min   = "0" + min;   }
                if (("" + sec).length   == 1) { sec   = "0" + sec;   }
                if (("" + rnd_val).length   == 1) { rnd_val   = "0" + rnd_val;   }

    return ("" + year + month + day + hour + min + sec + rnd_val)
}

//±â»ç¸ÞÀÏº¸³»±â ÄíÅ° ¼³Á¤
function SetGisaMailCookie(name, value, expmimutes) {
  var todayDate = new Date();
  todayDate.setMinutes( todayDate.getMinutes() +  expmimutes);
  document.cookie = name + "=" + value + "; path=/; expires=" + todayDate.toGMTString() + ";domain=.hankooki.com";
}

function Search_ShowHide() { //v6.0
	var area_y=window.event.y+document.body.scrollTop;
        var area_x=window.event.x+document.body.scrollLeft;
        if(area_y < 124 ||  area_y > 200 || area_y > 793){
		baseball.style.visibility='hidden';
		soccer.style.visibility='hidden';
		more.style.visibility='hidden';
		entertain.style.visibility='hidden';
		life.style.visibility='hidden';
                search_layer.style.display='';
        }
}

//±â»ç¸ÞÀÏº¸³»±â ¸ÞÀÎ
function GisaMail(uid){
        var Cookievalue;
        var urls = location.host + location.pathname + location.search;
        Cookievalue = GetCookie('mlogin_cookie');
        if(Cookievalue == "") {
                alert("È¸¿ø·Î±×ÀÎÀ» ÇÏ¼Å¾ß º¼¼ö ÀÖ´Â ÆäÀÌÁö ÀÔ´Ï´Ù.");
                location.href="http://member.hankooki.com/member/login.php?path=0630&url=" + urls;
        }else{
                //Á¤»óÀûÀÎ ¹æ¹ýÀ¸·Î Ã¢À» ¶ç¿ü´ÂÁö È®ÀÎÇÏ±â À§ÇØ Äí±â ÀÌ¿ë
                tmp = new Date();
                cookval=TimetoString(tmp);
                SetGisaMailCookie('GisaMail',cookval,10);
                mailurl = "http://www.hankooki.com/common/GisaMail/GisaMailForm.php?uid="+uid+"&certify="+cookval;
                window.open(mailurl, 'WinGisaMail','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=100,top=10,width=602,height=427');
        }
}
