function imgerr(val)
{
	val.src = "/images/not_img.jpg";
}
function goInvite(seq){
	Login_id = '<%=gluserid%>';
	if(Login_id==''){
		location.href='http://xlogon.hanafos.com/login/Login.asp?sReturnPage='+document.URL;
	}else{
	openwin2("http://pdsclickstat.hanafos.com/hdredir.htm?hdtitle=PAG^newpds^detail_page^»ó¼¼ÆäÀÌÁö^ÃßÃµ¸ÞÀÏ&hdurl=http://pds.hanafos.com/popup/APPopInvite.asp?fileseq="+seq , 780,750 , "downPop" ,0 ) ;
//	alert("ÃÊ´ë¸ÞÀÏ º¸³»±â ¼­ºñ½º Á¡°ËÁßÀÔ´Ï´Ù.");
	}
	return;

}

function goPrintView(seq){
	openwin2("http://pdsclickstat.hanafos.com/hdredir.htm?hdtitle=PAG^newpds^detail_page^»ó¼¼ÆäÀÌÁö^ÀÎ¼âÇÏ±â&hdurl=http://pds.hanafos.com/popup/APPopInvitePreview.asp?fileseq="+seq , 780,550 , "downPop" ,1 ) ;
}

function goBug(){
	if (getCookie("hCICK") != undefined && getCookie("hCICK") != "") {
		openwin2('http://pdsclickstat.hanafos.com/hdredir.htm?hdtitle=PAG^newpds^detail_page^»ó¼¼ÆäÀÌÁö^½Å°íÇÏ±â&hdurl=http://pdsbbs.hanafos.com/write.do?bid=pds_bug&forward=/bbs/WritePdsBug.jsp&link='+escape(document.URL),'pr','scrolling=no, width=545,height=610');
	}
	else {
		alert("Á¤È®ÇÑ ½Å°íÁ¢¼ö¸¦ À§ÇØ ·Î±×ÀÎÀ» ÇÏ½Å ÈÄ ½Å°í¹Ù¶ø´Ï´Ù.");
	}
}

function isInserted(msg) {

	if(arguments.length > 1) {
		for(i=1; i<arguments.length; i++) {
			if(arguments[i] && arguments[i].value.replace(/ /g, '') == '') {
				if(msg != '') {
					alert(msg + ' ÀÔ·ÂÇÏ¼¼¿ä');
				}
				arguments[i].focus();
				return false;
			}
		}
	}
	return true;
}
function chgStarImg(num) {
   var f=document.qform;
   var i;
   var imgId=new Array();

   for(i=1; i<=10; i++) {
      imgId[i]=document.getElementById("starImg"+i);
      imgId[i].src="/images/Star_G.gif";
   }

   for(i=1; i<=num; i++) {
      imgId[i].src="/images/Star_Y.gif";
   }

   f.rank.value=num;
}
function chgStarImg1(num) {
   var f=document.qform;
   var i;
   var imgId=new Array();

   for(i=1; i<=5; i++) {
      imgId[i]=document.getElementById("starImg"+i);
      imgId[i].src="/images/star_off.gif";
   }

   for(i=1; i<=num; i++) {
      imgId[i].src="/images/starredon.gif";
   }

	f.rank.value=num;
}

function selectScode(val,name)
{
	for(var i=1;i<12;i++)
	{
		if(document.getElementById("scodelist"+i))
		document.getElementById("scodelist"+i).style.display="none";
	}
	document.getElementById("scodelist"+val).style.display="block";
	document.qform.bcodename.value = name;

}
function setSCode(name)
{
	document.qform.scodename.value = name;
}
function checkFile()
{
	var frm = document.qform;
	var filevalue = frm.ufFileName.value;
	var morelength="N";

	
	if (filevalue != "")
	{
		if(document.qform.ufFileName.value.indexOf("fakepath")>-1)
		{
			 document.qform.ufFileName.select();
			 var selectionRange = document.selection.createRange();
			 img_path = selectionRange.text.toString();
			 imageFileSize = document.fDown.GetFileLength( img_path ) ; 
	
		}
		else
		{
			imageFileSize = document.fDown.GetFileLength( qform.ufFileName.value ) ; 
		}
		FileNameOnly = qform.ufFileName.value.substr( qform.ufFileName.value.lastIndexOf("\\") + 1 , qform.ufFileName.value.length - qform.ufFileName.value.lastIndexOf("\\") ) ;
		var len=0, j;
		for (i=0, j=FileNameOnly.length;i<j;i++, len++) {
			if ( (FileNameOnly.charCodeAt(i)<0)||(FileNameOnly.charCodeAt(i)>127) ){
			len = len+1;
			}
			if (len >= 21) {
				FileNameOnly=FileNameOnly.substring(0,i);
				morelength="Y";
			}
		} 
		if (morelength=="Y")
		{
		FileNameOnly=FileNameOnly+"...";
		}
		document.all.pdsfilename.innerText = FileNameOnly;
		document.all.pdsfilesize.innerText = calculate(imageFileSize);
	}
}
function chkAllSel(){
	 for(i=0; i<document.all.kos.length; i++) {
	 document.all.kos[i].checked = true;
	 }
}
function calculate(num) {
	return Math.round(num/1024)+"KB"; 
}

function F5keydown()
{
	if(event.keyCode== 116) 
	{
		window.event.keyCode = "";
		location.reload();
		return false;
	}
}
function F5keydown()
{
	if(event.keyCode== 116) 
	{
		window.event.keyCode = "";
		location.reload();
		return false;
	}
}
document.onkeydown = F5keydown;


function divControl(t)
{
	if(document.getElementById(t).style.display=="block")
	{
		document.getElementById(t).style.display="none";
		document.getElementById("img"+t).src="/images/ico_adown.gif";
		document.getElementById("img"+t).alt="ÆîÄ§";
	}
	else
	{
		document.getElementById(t).style.display="block";
		document.getElementById("img"+t).src="/images/ico_aup.gif";
		document.getElementById("img"+t).alt="´ÝÈû";
	}
}

function set_cookie( 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 ViewNotice(gid,cdid)
{
	window.open("http://www.hanafos.com/hdredir.htm?hdtitle=MA_Ntc-x01_Nt-Notic2&hdurl=http://notice.hanafos.com/n_view_new.asp?id="+gid+"&cdid="+cdid, "Notice_Viewer", "toolbar=no,location=no,directory=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=640,height=480");
	return;
}

function ListNotice(cdid)
{
	window.open("http://www.hanafos.com/hdredir.htm?hdtitle=MA_Ntc-t01_Nt-Notic1&hdurl=http://notice.hanafos.com/n_list_new.asp?cdid="+cdid, "Notice_Viewer", "toolbar=no,location=no,directory=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=640,height=480");
	return;
}
// Online Help
 function goFAQList(inForm, nodeId, nodeName, parentNodeId, parentNodeName)  {
	inForm.nodeId.value = nodeId;
	inForm.nodeName.value = nodeName;
	inForm.parentNodeId.value = parentNodeId;
	inForm.parentNodeName.value = parentNodeName;
	inForm.submit();
 }

function F_viewSwf(width, height, wmode, url){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' id='WidgetPDS' ");
	document.write("		codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' ");
	document.write("		width='"+width+"' height='"+height+"' align='middle'>");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie'				value='"+url+"' /> ");
	document.write("	<param name='quality'			value='high' /> ");
	document.write("	<param name='wmode'				value='"+wmode+"'> ");
	document.write("	<embed id='WidgetPDS' src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' ");
	document.write("		allowScriptAccess='always' type='application/x-shockwave-flash' ");
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

function F_ScrapSwfReturn(id,width, height, wmode, url){
	var str;
	str	= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' id='WidgetPDS' "
	str	+="		codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' "
	str	+="		width='"+width+"' height='"+height+"' align='middle'>"
	str	+="	<param name='allowScriptAccess' value='always' /> "
	str	+="	<param name='movie'				value='"+url+"' /> "
	str	+="	<param name='quality'			value='high' /> "
	str	+="	<param name='wmode'				value='"+wmode+"'> "
	str	+="	<embed id='WidgetPDS' src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' "
	str	+="		allowScriptAccess='always' type='application/x-shockwave-flash' "
	str	+="		pluginspage='http://www.macromedia.com/go/getflashplayer' />"
	str	+="</object>"
		
	return str;
	
	
}

function F_ScrapSwf(id,width, height, wmode, url){
	var str;
	if(id=="ob")
	{
		str	= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' id='WidgetPDS' "
		str	+="		codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' "
		str	+="		width='"+width+"' height='"+height+"' align='middle'>"
		str	+="	<param name='allowScriptAccess' value='always' /> "
		str	+="	<param name='movie'				value='"+url+"' /> "
		str	+="	<param name='quality'			value='high' /> "
		str	+="	<param name='wmode'				value='"+wmode+"'> "
		str	+="	<embed id='WidgetPDS' src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' "
		str	+="		allowScriptAccess='always' type='application/x-shockwave-flash' "
		str	+="		pluginspage='http://www.macromedia.com/go/getflashplayer' />"
		str	+="</object>"
		
	//window.clipboardData.setData("Text", str); 
	//alert('Å¬¸³º¸µå¿¡ º¹»ç°¡ µÇ¾ú½À´Ï´Ù.Ctrl + V ¸¦ »ç¿ëÇÏ¿© ºÙ¿©³ÖÀ¸¼¼¿ä.');
	}
	else
	{
		str	= "<embed id='WidgetPDS' src='"+url+"' quality='high' width='"+width+"' height='"+height+"' align='middle' "
		str	+="		allowScriptAccess='always' type='application/x-shockwave-flash' "
		str	+="		pluginspage='http://www.macromedia.com/go/getflashplayer' />"
	}

		document.getElementById("copyObject").value = str;
}

function fcopy(id)
{
	var objImg = new Image();
	if(id=="copyObject")
	{
	objImg.src = "http://pdsclickstat.hanafos.com/hdredir.htm?hdtitle=PAG^newpds^detail_page^»ó¼¼ÆäÀÌÁö^¼Ò½ºº¹»ç&hdurl=http://pds.hanafos.com/images/blank.gif"; 
	}
	else
	{
	objImg.src = "http://pdsclickstat.hanafos.com/hdredir.htm?hdtitle=PAG^newpds^detail_page^»ó¼¼ÆäÀÌÁö^¸µÅ©º¹»ç&hdurl=http://pds.hanafos.com/images/blank.gif"; 
	}

    window.clipboardData.setData("Text", document.getElementById(id).value); 
	alert('Å¬¸³º¸µå¿¡ º¹»ç°¡ µÇ¾ú½À´Ï´Ù.Ctrl + V ¸¦ »ç¿ëÇÏ¿© ºÙ¿©³ÖÀ¸¼¼¿ä.');
}

function divGraphControl()
{
	if(document.getElementById("graphBox").style.display=="none")
	{
		document.getElementById("graphBox").style.background ="#f2f2f2";
		document.getElementById("graphBox").style.display = "block";		
		document.getElementById("graphBox").style.zindex ="999";
		document.getElementById("graphBG").style.height=330;
		document.getElementById("grahTitle").src="/images/tit_up.gif";
	}
	else
	{		
		document.getElementById("graphBG").style.height=0;
		document.getElementById("graphBox").style.display = "none";
		document.getElementById("grahTitle").src="/images/tit_down.gif";
	}
}

function divScrapMenu()
{
	var objImg = new Image();
	objImg.src = "http://pdsclickstat.hanafos.com/hdredir.htm?hdtitle=PAG^newpds^detail_page^»ó¼¼ÆäÀÌÁö^HTMLÆÛ°¡±â&hdurl=http://pds.hanafos.com/images/blank.gif"; 
	if(document.getElementById("divCopyLayer").style.display=="none")
	{
		
		document.getElementById("scrapImg").src="/images/btn_htmlclose.gif";
		document.getElementById("divCopyLayer").style.display = "block";
	}
	else
	{		
		document.getElementById("divCopyLayer").style.display = "none";
		document.getElementById("scrapImg").src="/images/btn_htmlopen.gif";
	}
}


function Fn_ActivityPoint(pt)
{
	var xmlHttp = false;
	if (window.XMLHttpRequest)
	{
		xmlHttp = new XMLHttpRequest();
	}
	else
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlHttp.open("GET","/common/iframe/ifrm_ActivityPoint_Proc.asp?pointKind=" + pt,true);
	xmlHttp.setRequestHeader('Content-Type','text/html; charset=euc-kr');
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){

			}
		}
	}
	xmlHttp.send(null);
}
