/**************************************************************
1. Font Size Á¶Àý
2. ÀÛ¼ºÀÚ : 2007.11.12 Append by KMS
3. »ç¿ë¹ý
	GisaFont = new SetFontSize();			// ÅÇ ÇÔ¼ö ¼±¾ð
	GisaFont.name = "GisaFont";				// ÅÇ ÇÔ¼ö ÀÌ¸§ ¼±¾ð
	GisaFont.scaleFont(1);						// ÆùÆ® »çÀÌÁî Á¶Àý(-1: 1°¨¼Ò,1: 1Áõ°¡)
**************************************************************/
function SetFontSize(){
	this.fontSize;
	this.version = "0.1";
	this.name = "SetFontSize";
	
	this.getFontCookie = function(){
		var cookie = getCookie("cur_font_size");
		if ( cookie == null ) {
			return 13;
		}
		if ( cookie.length ){return cookie;
		}else{ return 13;}
	};
	this.scaleFont = function(val){
		var content, lineHeight;
		if(document.getElementById("content")){
                        content = document.getElementById("content");
                }else{
                        content = document.getElementById("GS_Content");
                }
		if (val > 0){
			if (this.fontSize <= 18) {
				this.fontSize = this.fontSize + val;
				lineHeight = this.fontSize+Math.round(1.1*this.fontSize);
				content.style.fontSize = this.fontSize + "px";
			}
		} else {
			if (this.fontSize > 13) {
				this.fontSize = this.fontSize + val;
				lineHeight = this.fontSize+Math.round(1.1*this.fontSize);
				content.style.fontSize = this.fontSize + "px";
			}
		}
		var mydate = new Date;
		mydate.setDate(mydate.getDate()+1000);
		setCookie("cur_font_size", this.fontSize, mydate);
	};
	this.PrintOpen = function(srcurl){
		var lpage,src_url
		lpage = new String(document.URL);
		if(lpage.search('sports.hankooki.com/lpage') > 0){
			src_url = lpage.replace("http://sports.hankooki.com", "");
		}
        	printurl = "/service/print/Print.php?po="+src_url;
        	MM_openBrWindow(printurl, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=100,top=10,width=700,height=758');
	}
	this.fontSize= parseInt(this.getFontCookie());
}

/**************************************************************
1. ±â»ç¸ÞÀÏ º¸³»±â
2. ÀÛ¼ºÀÚ : 2007.11.12 Append by KMS
3. »ç¿ë¹ý
	GisaMail(uid,path) //uid : ±â»ç ¾ÆÀÌµð, path : °æ·Î(0631)
**************************************************************/
function GisaMail(uid,path){
	this.Cookievalue;
	this.urls = location.host + location.pathname + location.search;
	this.Cookievalue = GetCookie('mlogin_cookie');
	this.TimetoString = function(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)
	}
	this.SetGisaMailCookie = function(name, value, expmimutes) {
                var todayDate = new Date(); 
                todayDate.setMinutes( todayDate.getMinutes() +  expmimutes);
                document.cookie = name + "=" + value + "; path=/; expires=" + todayDate.toGMTString() + ";domain=.hankooki.com";
        }
	if(this.Cookievalue == "") {
		alert("È¸¿ø·Î±×ÀÎÀ» ÇÏ¼Å¾ß º¼¼ö ÀÖ´Â ÆäÀÌÁö ÀÔ´Ï´Ù.");
		location.href="http://member.hankooki.com/member/login.php?path="+path+"&url=" + this.urls;
	}else{
		//Á¤»óÀûÀÎ ¹æ¹ýÀ¸·Î Ã¢À» ¶ç¿ü´ÂÁö È®ÀÎÇÏ±â À§ÇØ Äí±â ÀÌ¿ë
		tmp = new Date();    
		cookval=this.TimetoString(tmp);
		this.SetGisaMailCookie('GisaMail',cookval,10); 
		mailurl = "http://www.hankooki.com/common/GisaMail/GisaMailForm.php?uid="+uid+"&certify="+cookval;
		MM_openBrWindow(mailurl, 'WinGisaMail','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=100,top=10,width=602,height=427');
	}
}

/**************************************************************
1. ±â»ç ÇÁ¸°Æ®
2. ÀÛ¼ºÀÚ : 2007.11.12 Append by KMS
3. »ç¿ë¹ý
	PrintOpen(srcurl) //srcurl : ÇÁ¸°Æ® ÇÒ URL
**************************************************************/
function PrintOpen(srcurl){
	printurl = "/service/print/Print.php?po="+srcurl;
	MM_openBrWindow(printurl, '','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=100,top=10,width=700,height=758');
}

/**************************************************************
1. ±â»ç ÇÁ¸°Æ®,ÀÌ¸ÞÀÏ, ÆùÆ® »çÀÌÁî Á¶Àý
2. ÀÛ¼ºÀÚ : 2007.11.15 Append by KMS
3. »ç¿ë¹ý
	SetGisaPrintForm(LayerID,GSURL,GSNO) //(·¹ÀÌ¾î ¾ÆÀÌµð,ÇÁ¸°Æ® ÇÒ URL,±â»ç ¹øÈ£)
**************************************************************/
function SetGisaPrintForm(LayerID,GSURL,GSNO){
		var gisaprint="";
		GisaFont = new SetFontSize();			// ÅÇ ÇÔ¼ö ¼±¾ð
		GisaFont.name = "GisaFont";				// ÅÇ ÇÔ¼ö ÀÌ¸§ ¼±¾ð
	
		gisaprint +="<table border=0 cellpadding=0 cellspacing=0>\n";
		gisaprint +="<tr>\n";
		gisaprint +="<td width=37><a href=\"javascript:GisaFont.scaleFont(1);\"><img src=\"http://img.hankooki.com/news/2007/12/img_news_button_02.gif\" border=\"0\"></a></td>\n";
		gisaprint +="<td width=42><a href=\"javascript:GisaFont.scaleFont(-1);\"><img src=\"http://img.hankooki.com/news/2007/12/img_news_button_03.gif\" border=\"0\"></a></td>\n";
		gisaprint +="<td width=56><a href=\"javascript:GisaFont.PrintOpen('"+GSURL+"');\"><img src=\"http://img.hankooki.com/news/2007/12/img_news_button_04.gif\" border=0></a></td>\n";
		gisaprint +="<td width=96><a href=\"javascript:GisaMail('"+GSNO+"','0632');\"><img src=\"http://img.hankooki.com/news/2007/12/img_news_button_05.gif\" border=0></a></td>\n";
		gisaprint +="</tr>\n";
		gisaprint +="</table>\n";
		if(document.getElementById('LayerID')){
			document.getElementById('LayerID').innerHTML=gisaprint;
		}
}

/**************************************************************
1. ÆÄÀÏ¼öÁ¤½Ã°£ ¾ò±â
2. ÀÛ¼ºÀÚ : 2007.11.20 Append by KMS
3. »ç¿ë¹ý
	SetFileModify() //(·¹ÀÌ¾î ¾ÆÀÌµð,ÇÁ¸°Æ® ÇÒ URL,±â»ç ¹øÈ£)
**************************************************************/
function SetFileModify(){
	var ModifyTime=document.lastModified;
	mod_year =ModifyTime.substr(6,4);
	mod_month =ModifyTime.substr(0,2);
	mod_day =ModifyTime.substr(3,2);
	mod_hour =ModifyTime.substr(11,2);
	mod_minute =ModifyTime.substr(14,2);
	mod_second =ModifyTime.substr(17,2);
	mod_tot=mod_year+'/'+mod_month+'/'+mod_day+' '+mod_hour+':'+mod_minute+':'+mod_second;

	//ÆÄÀÏ»ý¼º½Ã°£ ÆÄÀÏ·ÎºÎÅÍ ¾ò±â
	var crt_temp = document.URL;
	var end_pt = crt_temp.lastIndexOf('.htm');
	crt_year = crt_temp.substr(end_pt-19,4);
	crt_month = crt_temp.substr(end_pt-15,2);
	crt_day = crt_temp.substr(end_pt-13,2);
	crt_hour = crt_temp.substr(end_pt-11,2);
	crt_minute = crt_temp.substr(end_pt-9,2);
	crt_second = crt_temp.substr(end_pt-7,2);
	crt_tot=crt_year+'/'+crt_month+'/'+crt_day+' '+crt_hour+':'+crt_minute+':'+crt_second;

	mod_make = new Date(mod_year,mod_month-1, mod_day, mod_hour,mod_minute);
	crt_make = new Date(crt_year,crt_month-1,crt_day,crt_hour,crt_minute);
	rem_min = (mod_make - crt_make) / 1000 /60;

	if(rem_min >= 3){
		mod_text="<br><font color=#333333>¼öÁ¤½Ã°£ : "+mod_tot+"</font>";
		if(document.getElementById('modify_gisa')){
			document.getElementById('modify_gisa').innerHTML=mod_text;
		}
	}
}

function Input_Time(intime){
        var Time_Data="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
        Time_Data = Time_Data +"<tr>";
        Time_Data = Time_Data +"<td height=\"30\" align=\"left\"> ";
        Time_Data = Time_Data +"<font color=\"585858\">ÀÔ·Â½Ã°£ : "+intime+" <span id=modify_gisa></span></font>";
        Time_Data = Time_Data +"</td>";
        Time_Data = Time_Data +"<td width=150 align=\"right\"><a href='http://sports.hankooki.com' target='_top'><img src=\"http://img.hankooki.com/sports/2007/12/btn_newshome.gif\" width=\"91\" height=\"19\" border=0></a><a href='#'><img src=\"http://img.hankooki.com/sports/2007/12/btn_top.gif\" width=\"59\" height=\"19\" border=0></a></td>";
        Time_Data = Time_Data +"</tr>";
        Time_Data = Time_Data +"</table>";
        if(document.getElementById('input_time')){
                input_time.innerHTML=Time_Data;
        }       
}

function ImageGoUrl(gourl){
	PhotoView.style.display="none";
	location.href=gourl;
}
function ImageClose(){
	PhotoView.style.display="none";
}

function ImageOpen(pUrl,EncPhotoSummary,clickevent){
	var PhotoSummary;
	photourl=pUrl.replace("http://", "");
	
	PhotoSummary=decodeURI(EncPhotoSummary);
	
	var newImg = new Image(); 
	newImg.src = "http://"+photourl; 
	var imgW = newImg.width; 
	var imgH = newImg.height;
	if(imgW > 600){
		imgW = 598;
		imgH = Math.ceil((newImg.height*800)/newImg.width);
	}
	var FrameH = imgH + 300;
		
	var PhotoView_Data="";
	PhotoView_Data=PhotoView_Data+"<div class=\"BigPhoto_contain\">";
	PhotoView_Data=PhotoView_Data+"<h2 class=\"BigPhoto_title01\"><img src=http://img.hankooki.com/news/2008/08/view_photo_02.jpg border=0 usemap=\"#PhotoViewTit\"></h2>";
	PhotoView_Data=PhotoView_Data+"<div class=\"BigPhoto_containBG\">";
	PhotoView_Data=PhotoView_Data+"	<iframe src='http://www.hankooki.com/common/PhotoView/PhotoList.htm' width=600 height=75 frameborder=0 scrolling=no></iframe>";
	PhotoView_Data=PhotoView_Data+" <img src=\"http://"+photourl+"\" width="+imgW+" onclick=\"ImageClose()\" border=\"0\">";
	PhotoView_Data=PhotoView_Data+"</div>";
	PhotoView_Data=PhotoView_Data+"	<div class=\"BigPhoto_description\">"+PhotoSummary+"</div>";
	PhotoView_Data=PhotoView_Data+"</div>";
	PhotoView_Data=PhotoView_Data+"<map name=\"PhotoViewTit\"><area shape=\"rect\" coords=\"571,6,593,30\" href=\"#\" onclick=\"ImageClose()\"></map>";

	PhotoView.innerHTML=PhotoView_Data;

	// PhotoView.style.top=clickevent.y+document.body.scrollTop;
	PhotoView.style.top=document.body.scrollTop+50;
        PhotoView.style.left="300px";
	PhotoView.style.display="";
}

function ImageView(PhotoUrl,PhotoID,ImageAlign,ImageSize){
	var PhotoSummary="";
	var EncPhotoSummary="";
	var photo_list="";
	var SumLay=eval("document.getElementById('Sum_"+PhotoID+"')");
	var re = /\"/g; 
	if(SumLay){
		PhotoSummary=SumLay.outerText;
		EncPhotoSummary=encodeURI(PhotoSummary);
		var re=/'/g;
		EncPhotoSummary=EncPhotoSummary.replace(re,"\\\'");
	}
	if(ImageAlign=="default"){
		ImageAlign="center";
		GS_RelPhoto.style.width="270px";
	}else if(ImageAlign=="center"){
		GS_RelPhoto.style.width="579px";
		GS_RelPhoto.style.display="block";
		GS_RelPhoto.style.float="center";
	}else{
		GS_RelPhoto.style.width="270px";
	}
	
	photo_list ="<table width=\"270\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"F0F1F0\" align=\""+ImageAlign+"\">";
	photo_list +="<tr> ";
	photo_list +=" <td >";
	photo_list +="	<table width=\"264\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"E1E1E1\">";
	photo_list +="	<tr> ";
	photo_list +="	 <td align=\"center\" bgcolor=\"#FFFFFF\">";
	photo_list +="		<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"187\">";
	photo_list +="		<tr> ";
	photo_list +="		 <td><img src=\""+PhotoUrl+"\" border=0 width="+ImageSize+" onclick=\"ImageOpen('"+PhotoUrl+"','"+EncPhotoSummary+"',event)\" style=\"cursor:hand\" alt='Å¬¸¯ÇÏ½Ã¸é ¿øº» ÀÌ¹ÌÁö¸¦ º¸½Ç¼ö ÀÖ½À´Ï´Ù'></td>";
	photo_list +="		</tr>";
	photo_list +="		<tr> ";
	photo_list +="		 <td>"+PhotoSummary+"</td>";
	photo_list +="		</tr>";
	photo_list +="		</table>";
	photo_list +="	 </td>";
	photo_list +="	</tr>";
	photo_list +="	</table>";
	photo_list +=" </td>";
	photo_list +="</tr>";
	photo_list +="</table><p style='margin-top:5px'>";
	if(ImageAlign=="center"){
		eval("document.getElementById('Sum_"+PhotoID+"')").style.width="579px";
	}
	eval("document.getElementById('Sum_"+PhotoID+"')").style.float=ImageAlign;
	document.write(photo_list);
}

function SetGisaBottomForm(cur_date){
	var data_list="";
	data_list +="<table width=\"579\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	data_list +="<tr> ";
	data_list +=" <td height=\"30\" align=\"left\"> ";
	data_list +="		<font color=\"585858\">";
	data_list +="			ÀÔ·Â½Ã°£ : "+cur_date;
	data_list +="			<span id=modify_gisa></span > ";
	data_list +="		</font>";
	data_list +=" </td>";
	data_list +=" <td width=150 align=\"right\"><a href=\"http://sports.hankooki.com\"><img src=\"http://img.hankooki.com/sports/2007/12/btn_newshome.gif\" border=0></a><a href=\"#\"><img src=\"http://img.hankooki.com/sports/2007/12/btn_top.gif\" border=0></a></td>";
	data_list +="</tr>";
	data_list +="</table>";
	document.write(data_list);
}

// ÆÄ¿ö ºñÀü ±¤°í ½ÃÀÛ
var ntom_width = 576;   	//µ¿¿µ»ó °¡·Î »çÀÌÁî
var ntom_height = 324;  	//µ¿¿µ»ó ¼¼·Î »çÀÌÁî
var ntom_top = 1050;    	//ÇÏ´Ü¿¡¼­ºÎÅÍ ÆÄ¿öºñÀü »ó´ÜÀÇ À§Ä¡
var ntom_Full_width = 280;	//È®ÀåÀü µ¿¿µ»ó °¡·Î»çÀÌÁî¿¡¼­ È®ÀåµÇ¸é¼­ ´Ã¾î³¯ »çÀÌÁî ¿¹-512->1008 °æ¿ì 496À¸·Î Àû¾îÁÖ½Ã¸é µË´Ï´Ù.

try {urls=new String(document.location);}
catch(e){urls="http://sports.hankooki.com/lpage/etc/";}
if(urls.search("/baseball/") > 0 ||urls.search("/mlb/") > 0 || urls.search("/soccer/") > 0 || urls.search("/basketball/") > 0 || urls.search("/moresports/") > 0 || urls.search("/volleyball/") > 0){
        var ntom_tag = "http://provider-cdn.ntomap.com/js.mpx/hankooki/sports@power";			//½ºÆ÷Ã÷
}else if(urls.search("/entv/") > 0 || urls.search("/music/") > 0 || urls.search("/cinet/") > 0){
        var ntom_tag = "http://provider-cdn.ntomap.com/js.mpx/hankooki/ent@power";			//¿¬¿¹
}else if(urls.search("/life/") > 0 || urls.search("/tour/") > 0 || urls.search("/culture/") > 0 || urls.search("/race/") > 0 || urls.search("/fortune/") > 0 ){
	var ntom_tag = "http://provider-cdn.ntomap.com/js.mpx/hankooki/national@power";			//»çÈ¸¹®È­
}else{
	var ntom_tag = "http://provider-cdn.ntomap.com/js.mpx/hankooki/etc@power";			//±âÅ¸
}
// ÆÄ¿ö ºñÀü ±¤°í ³¡


//¿¡·ÎÅäÅ©ÀÏ °æ¿ì ¼ºÀÎÀÎÁõ
var thisUrl = document.URL;
var secUrl=thisUrl.split("lpage/");
secUrl=secUrl[1].substr(0,secUrl[1].indexOf("/"));
if (secUrl=='errotalk'){
	var adultCookie = getCookie('mlogin_extend');
	if (!adultCookie || adultCookie==null){
		alert('¼ºÀÎÀÎÁõÀ» ÇÏ¼Å¾ß º¼¼öÀÖ½À´Ï´Ù.');
		location.href="http://member.hankooki.com/adult_auth/certify.php?path=0608&home=club.hankooki.com&url="+thisUrl;
	}else{
		adultInfo = adultCookie.split('|');
		if(adultInfo[0] <= 18 || adultInfo[4] !="1") {
			history.back(1);
		}
	}
}
