//¼ýÀÚ 3ÀÚ¸®¸¶´Ù ½°Ç¥
function chk(id){
	kk=eval("document."+id+".idchk");
	for (i=0;i<kk.length ;i++)
	{
		if(kk[i].value==""){
			alert(kk[i].alt+" ³Ö¾îÁÖ½Ê½Ã¿ä");
			kk[i].focus();
			return;
		}
	}
	return true;
}

//¿øÇÏ´Â Ã¢À¸·Î ÀÌµ¿ (¿øÇÏ´Â url, ¿øÇÏ´Â º¯¼ö°ª)
function OpenUrl(Linkurl,UserCont)
{
	location.href=Linkurl+UserCont;
}

//°æ°íÃ¢ ¶ç¿ì°í ÆäÀÌÁö ÀÌµ¿ (¿øÇÏ´Â URL)
function alertlocationhref(strMsg,strLocation)
{
	alert(strMsg);
	location.href=	 strLocation;
}

	function up_extCheck(path) {	//´ÙÁß ÆÄÀÏ¾÷·Îµå ÀÏ¶§
		
		 var src = getFileExtension(path.value);
		 src = src.toLowerCase();

		   if(((src.toLowerCase() == "js")||(src.toLowerCase() == "php")||(src.toLowerCase() == "jsp")||(src.toLowerCase() == "asp")||(src.toLowerCase() =="exe")||(src.toLowerCase() == "dat")||(src.toLowerCase() == "vbs")||(src.toLowerCase() == "vbe")||(src.toLowerCase() == "com")||(src.toLowerCase() == "sys")||(src.toLowerCase() == "dll")))
		   {
				 alert('.js, .php, .jsp, .asp, .exe ÆÄÀÏ µîÀº ¾÷·Îµå°¡ ºÒ°¡´É ÇÕ´Ï´Ù.');
				 path.select();
				 document.selection.clear(); 
				return false;
			}

	 }


function formatNumber(num) 
{
 //È­Æä3ÀÚ¸® ÄÞ¸¶
   s = num+"";
   kk=s.length-3;
   while(kk > 0) {
     s=s.substr(0,kk)+","+s.substr(kk);
     kk-=3;
   }
   return s;
} 

//¼ýÀÚÃ¼Å©
function isNumeric(checkNum){ 
	var cstr = checkNum;
	var ch = cstr.charAt(cstr.length-1);
	if(ch < "0" || ch > "9"){
		return false;
	}else{
		return true;
	}
}


//°¶·¯¸® ÆË¾÷
function open_popup(inSeq,Tb_name){
	galleryview=window.open('/gallery_popup/gallery_view.php?seq='+inSeq+'&table_name='+Tb_name,'gallery','top=0,left=0,width=630,height=280,scrollbars=no,menubar=no,toolbar=no,status=no');
	galleryview.focus();
}

//À©µµ¿ì¿ÀÇÂ
function Popup_view(url,popname,width,height,left,top,scroll){
	pop=window.open(url,popname,'width='+width+',height='+height+',left='+left+',top='+top+',scrollbars='+scroll);
	window.pop.focus();
}


//¹Ùµð »çÀÌÁî ÀÚµ¿Á¶Àý ½ÇÇà
function Init(val){
  var width	= val;
  var height	= document.body.scrollHeight;
  document.body.scroll= 'no';
  pop_resizeTo(width, height);
}

function pop_resizeTo(x, y)
{
	try
	{	
		var wx = document.body.clientWidth;
		var wy = document.body.clientHeight;
	}
	catch(e)
	{
		setTimeout('pop_resizeTo('+x+','+y+')', 200);
		return;
	}

	var sx = x - wx;
	var sy = y - wy;
	
	try
	{
		resizeBy(sx,sy);
	}
	catch(e)
	{
		setTimeout('pop_resizeTo('+x+','+y+')', 200);
		return;
	}		
}


// Ã¼Å© (Ã¢À¸·Î ³Ñ±æ º¯¼öµé) // ¾ÆÀÌµðÃ¼Å©³ª ºñ¹Ð¹øÈ£ º¯°æµî¿¡¼­ ¾²ÀÓ
function OpenWizMem(chk_value)
{
	//alert(chk_value);
	window.open('/include/Wizmem_chk.php?'+chk_value,'Memchk','menubar=0,location=0;width=400,height=100')
} 


//¼ýÀÚÃ¼Å©
function formNumCheck(in_this){ 
	var cstr = in_this.value;
	var ch = cstr.charAt(cstr.length-1);
	if(ch < "0" || ch > "9"){
		alert("¼ýÀÚ¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		in_this.value="";
		in_this.focus();
		return;
	}
}

// »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å©
function check_busino(vencod) {
	var sum = 0;
	var getlist =new Array(10);
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
	for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); }
	for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
	sum = sum + parseInt((getlist[8]*5)/10);
	sidliy = sum % 10;
	sidchk = 0;
	if(sidliy != 0) { sidchk = 10 - sidliy; }
	else { sidchk = 0; }
	if(sidchk != getlist[9]) { return false; }
	return true;
}

//³âµµ Ã¼Å©
function isYYYYMMDD(y, m, d) {
	switch (m) {
		case 2: // 2¿ùÀÇ °æ¿ì
			if (d > 29) return false;
			if (d == 29) {
			// 2¿ù 29ÀÇ °æ¿ì ´çÇØ°¡ À±³âÀÎÁö¸¦ È®ÀÎ
				if ((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0)) return false;
			}
		break;
		case 4: // ÀÛÀº ´ÞÀÇ °æ¿ì
		case 6:
		case 9:
		case 11:
		if (d == 31) return false;
	}
	// Å« ´ÞÀÇ °æ¿ì
	return true;
}


//ÁÖ¹Î¹øÈ£Ã¼Å©
function juminCheck(juminno) {
	if(juminno=="" || juminno==null || juminno.length!=13) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Àû¾îÁÖ¼¼¿ä.");
			return false;
	}
	var jumin1 = juminno.substr(0,6);
	var jumin2 = juminno.substr(6,7);
	var yy           = jumin1.substr(0,2);        // ³âµµ
	var mm     = jumin1.substr(2,2);        // ¿ù
	var dd     = jumin1.substr(4,2);        // ÀÏ
	var genda  = jumin2.substr(0,1);        // ¼ºº°
	var msg, ss, cc;

	// ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
	if (!isNumeric(jumin1)) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// ±æÀÌ°¡ 6ÀÌ ¾Æ´Ñ °æ¿ì
	if (jumin1.length != 6) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ±âº» ±¸¼º °Ë»ç
	if (yy < "00" || yy > "99" ||
			mm < "01" || mm > "12" ||
			dd < "01" || dd > "31") {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
	if (!isNumeric(jumin2)) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// ±æÀÌ°¡ 7ÀÌ ¾Æ´Ñ °æ¿ì
	if (jumin2.length != 7) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// ¼ºº°ºÎºÐÀÌ 1 ~ 4 °¡ ¾Æ´Ñ °æ¿ì
	if (genda < "1" || genda > "4") {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// ¿¬µµ °è»ê - 1 ¶Ç´Â 2: 1900³â´ë, 3 ¶Ç´Â 4: 2000³â´ë
	cc = (genda == "1" || genda == "2") ? "19" : "20";
	// Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ³¯Â¥ Çü½Ä °Ë»ç
	if (isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	// Check Digit °Ë»ç
	if (!isSSN(jumin1, jumin2)) {
			alert("ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£¸¦ °ËÅäÇÑ ÈÄ, ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
			return false;
	}
	return true;
}

//ÁÖ¹Î¹øÈ£ Ã¼Å©
function isSSN(s1, s2) {
	n = 2;
	sum = 0;
	for (i=0; i<s1.length; i++)
		sum += parseInt(s1.substr(i, 1)) * n++;
	for (i=0; i<s2.length-1; i++) {
		sum += parseInt(s2.substr(i, 1)) * n++;
		if (n == 10) n = 2;
	}
	c = 11 - sum % 11;
	if (c == 11) c = 1;
	if (c == 10) c = 0;
	if (c != parseInt(s2.substr(6, 1))) return false;
	else return true;
}



//ÀÌ¸ÞÀÏ Ã¼Å©
function validate(emailad) { 
  var exclude="/[^@-.w]|^[_@.-]|[._-]{2}|[@.]{2}|(@)[^@]*1/"; 
  var check="/@[w-]+./"; 
  var checkend="/.[a-zA-Z]{2,3}$/"; 
    if(((emailad.search(exclude) != -1) ||(emailad.search(check)) == -1)||  
         (emailad.search(checkend) == -1)){ 
      return true;
    } 
    else { 
       return false;
    } 
}

// Æû ÇÊ¼ö°ª Ã¼Å©
/*
function chk(thisform){
	formId=document.all.idEmptyChk;
	for(i=0;i<formId.length;i++){
		if(formId[i].value==""){
			alert(formId[i].chkText);
			formId[i].focus();
			return false;
		}
	}
	eval("document."+thisform).submit();
}
*/

//ÀÌ¹ÌÁö Å©°Ô º¸±â
function imgZoom(img,width,height){
	bigImg=window.open('','bigImg','width='+width+',height='+height+',left=10,top=10,scrollbars=yes');
	bigImg.document.write('<body topmargin=0 leftmargin=0 onclick=window.close()><img src='+img+'>');
}


//´ÙÀÌ³ª¹Í ¾ÆÀÌµð¸¦ ÀÌ¿ëÇÑÃ¼Å©
function formchk(formname){
	kk=eval("document."+formname+".id"+formname);
	for(i=0;i<kk.length;i++){
		if(kk[i].value==""){
			alert(kk[i].chkText);
			kk[i].focus();
			return false;
		}
	}
	//return true;
	eval("document."+formname).submit();
}


//´ÙÀÌ³ª¹Í ¾ÆÀÌµð¸¦ ÀÌ¿ëÇÑÃ¼Å©
function addsearch(formname){
window.open("/lib/zipcode/zipcode.php?form="+formname+"&zip1=Regpost01&zip2=Regpost02&firstaddress=Regadd01&secondaddress=Regadd02","ZipWin","width=490,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}

//µ¿¿µ»óÇÃ·¹ÀÌ
function mePlay(byPath,byWidth,byHeight) {
	strMove="<object classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" id=\"MediaPlayer1\" name=\"MediaPlayer1\" width=\""+byWidth+"\" height=\""+byHeight+"\">";
	strMove+="  <param name=\"AutoSize\" value=\"1\">";
	strMove+="  <!-- 0 ÀÌ¸é Å©±â°íÁ¤, 1ÀÌ¸é ÀÚµ¿À¸·Î Å©±â¸¦ Á¶ÀýÇÔ.-->";
	strMove+="  <param name=\"AutoStart\" value=\"1\">";
	strMove+="  <!--1ÀÌ¸é ÀÚµ¿À¸·Î ÇÃ·¹ÀÌ µÊ, 0ÀÌ¸é ¹öÆ°À» ´­·¯¾ß µÊ. -->";
	strMove+="  <param name=\"AutoRewind\" value=\"1\">";
	strMove+="  <!-- 1ÀÌ¸é ÀÚµ¿À¸·Î µÇ°¨±â µÊ -->";
	strMove+="  <param name=\"ClickToPlay\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é ¸¶¿ì½º Å¬¸¯ÇÏ¸é Àç»ý°ú ÀÏ½ÃÁ¤ÁöµÊ-->";
	strMove+="  <param name=\"Enabled\" value=\"1\">";
	strMove+="  <!-- 1ÀÌ¸é ±â´É¹öÆ° »ç¿ë°¡´ÉÇÏ°í, 0ÀÌ¸é »ç¿ëÀÌ ºÒ°¡´ÉÇÔ. -->";
	strMove+="  <param name=\"ShowTracker\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é Àç»ýµÇ´Â Æ®·¢ÀÇ »óÈ²À» º¸¿©ÁÜ.-->";
	strMove+="  <param name=\"EnableTracker\" value=\"0\">";
	strMove+="  <!-- 0ÀÌ¸é Æ®·¢¿¡¼­ ½½¶óÀÌµå¹Ù »ç¿ë¾ÈµÊ. -->";
	strMove+="  <param name=\"EnableContextMenu\" value=\"1\">";
	strMove+="  <!-- 1ÀÌ¸é ¸¶¿ì½º ¿À¸¥ÂÊ¹öÆ°À¸·Î ´ÜÃà¸Þ´º È£ÃâÀÌ °¡´ÉÇÔ. -->";
	strMove+="  <param name=\"ShowStatusBar\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é ÇÏ´Ü¿¡ ÀÖ´Â »óÅÂ¹Ù¸¦ º¸¿©ÁÜ -->";
	strMove+="  <param name=\"ShowControls\" value=\"1\">";
	strMove+="  <!-- 1ÀÌ¸é Àç»ý ¹× Á¤Áö µîÀÇ ÄÜÆ®·ÑÆÐ³ÎÀ» º¸¿© ÁÜ. -->";
	strMove+="  <param name=\"ShowAudioControls\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é º¼·ýÁ¶Àý±â º¸ÀÓ. -->";
	strMove+="  <param name=\"ShowCaptioning\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é Ä¸¼ÇÃ¢ÀÌ º¸ÀÎ´Ù. -->";
	strMove+="  <param name=\"Mute\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é ¼Ò¸®³ªÁö ¾ÊÀ½ -->";
	strMove+="  <param name=\"ShowDisplay\" value=\"0\">";
	strMove+="  <!-- 1ÀÌ¸é Å¬¸³, ¸¸µçÀÌ, ÀúÀÛ±ÇÀÇ Á¤º¸¸¦ º¸¿© ÁÜ. -->";
	strMove+="  <param name=\"Filename\" value=\""+byPath+"\">";
	strMove+="  <!--ValueµÚ¿¡ Àç»ýÇÒ ÆÄÀÏ¸íÀ» Àû¾î ÁØ´Ù-->";
	strMove+="</object>";
	return strMove;
}
/*
function play_movie() {
	document.all.MediaPlayer1.play();
}
function pause_movie() {
	MediaPlayer1.pause();
}
function stop_movie() {
	document.all.MediaPlayer1.stop();
}
*/

//Áñ°ÜÃ£±â
function addbookmark(bookmarkurl,bookmarktitle){
	window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

/*Ã·ºÎÆÄÀÏ Æû
Á¦ÀÛÀÚ:ÁøÃ¶
Á¦ÀÛÀÏ:2008-06-18
¼³¸í :
<input type="file" name="file_test[]">
<div id="idfile_test">
	<div id="idfile_test"></div>
</div>
<input type="button" value="add" onclick="fileadd('file_test')">
*/
function fileadd(in_name){
	tmpNum = document.all["id"+in_name].length-1;
	document.all["id"+in_name][tmpNum].innerHTML+="<input type=\"file\" name=\""+in_name+"[]\"><br><div id=\"id"+in_name+"\"></div>";
}


//TEXT È¿°ú³Ö±â
function text_over(inthis,inchk,incolor){
	if(inchk=="over"){
		inthis.style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#DDDDDD)";
		inthis.style.color=incolor;
	}else{
		inthis.style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#FFFFFF)";
		inthis.style.color="#666666";
	}
}

function f_print(){
	window.open('/lib/print.php','','width=300,height=300');
}


function setPng24(obj) { 
    obj.width=obj.height=1; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = 
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='';  
    return ''; 
}

function f_button(insrc,inname,inonclick,inbgcolor,intextcolor,inwidth,inchk) { 
	tempStr="<TABLE cellpadding=\"0\" cellspacing=\"0\" class=\"btn_img\"";
	if(inchk=="y"||inchk==inname){
		tempStr+=" style=\"border:1 solid #DDDDDD;cursor:hand;filter:alpha(opacity=100) progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr="+inbgcolor+");\"";
	}else{
		tempStr+=" style=\"border:1 solid #DDDDDD;cursor:hand;filter:alpha(opacity=70) progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr="+inbgcolor+");\"";
		tempStr+=" onmouseover=\"this.style.filter='alpha(opacity=100) progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr="+inbgcolor+")'\"";
		tempStr+=" onmouseout=\"this.style.filter='alpha(opacity=70) progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr="+inbgcolor+")';\"";
	}
	tempStr+=" onclick=\""+inonclick+"\" alt=\""+inname+"\"";
	tempStr+=" width=\""+inwidth+"\">";
	tempStr+="<TR>";
	tempStr+="<TD align=\"center\" style=\"padding-top:3px;color:"+intextcolor+";font-size:12px\">";
	if(insrc!=""){
		tempStr+="<img src=\""+insrc+"\" class=\"png24\"><br>";
	}
	tempStr+=inname+"</TD>";
	tempStr+="</TR>";
	tempStr+="</TABLE>";
	document.write(tempStr);
}

function admin_menu(overchk,inlevel,inname,inonclick){
	tempStr="<table ";
	tempStr+=" onclick=\""+inonclick+"\"";
	tempStr+=" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td ";
	if(overchk=="y"||overchk==inname){
		tempStr+=" style=\"cursor:hand;font:bold;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#666666, EndColorStr=#FFFFFF);color:#FFFFFF\"";
	}else{
		tempStr+=" style=\"cursor:hand;font:bold;color:#000000;\"";
		tempStr+=" onmouseover=\"this.style.filter='progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#666666, EndColorStr=#FFFFFF)';this.style.color='#FFFFFF'\"";
		tempStr+=" onmouseout=\"this.style.filter='';this.style.color='#000000'\"";
	}
	tempStr+=" style=\"padding-left:"+(inlevel*10)+"\">";
	tempStr+=inname+"</td></tr></table>";
	document.write(tempStr);
}

function vertical_str(instr){
	tmpStr="";
	for(s=0;s<instr.length;s++){
		tmpStr+=instr.substring(s,s+1)+"<br>";
	}
	return tmpStr;
}

String.prototype.trim = function()
{
  return this.replace(/(^\s*)|(\s*$)/gi, "");
}

String.prototype.replaceAll = function(str1, str2)
{
  var temp_str = this.trim();
  temp_str = temp_str.replace(eval("/" + str1 + "/gi"), str2);
  return temp_str;
}

//ÆäÀÌÂ¡ °ü·Ã------------>
var totalrecord=1;
var pagesize=1;
var nowpage=1;
var func="pchange";
var firstImage="";
var prevImage="/images/icon_arrow_blue_left.gif";
var nextImage="/images/icon_arrow_blue.gif";
var lastImage="";

function paging(inTotalrecord,inPagesize,inNowpage,InFirstImage,inPrevImage,inNextImage,inLastImage,infunc){
	var blockSize=10;
	var totalPage=Math.ceil(inTotalrecord/inPagesize);
	var totalBlock=Math.ceil(totalPage/blockSize);
	var nowBlock=Math.floor((inNowpage-1)/blockSize)+1;
	var tmpout=totalPage+"/"+totalBlock+"/"+nowBlock;
	var startPage=(nowBlock-1)*blockSize+1;
	var endPage=totalPage;
	if(nowBlock<totalBlock){
		endPage=startPage+blockSize-1;
	}
	tmpStr="";
	if(inPrevImage==""){
		tmpPrevImage="[ÀÌÀü]";
	}else{
		tmpPrevImage="<img src=\""+inPrevImage+"\" border=0>";
	}
	if(nowBlock!=1){
		prevPage=(nowBlock-2)*blockSize+1;
		tmpPrevImage=" <span onclick=\""+infunc+"("+prevPage+");\" style=\"cursor:hand\" onmouseover=\"this.style.color='red'\" onmouseout=\"this.style.color='#000000'\" style=\"#000000\">"+tmpPrevImage+"</span>";
	}
	for(i=startPage;i<=endPage;i++){
		var tmpBold="";
		if(inNowpage==i){
			tmpBold="bold";
		}
		tmpStr+=" <span onclick=\""+infunc+"("+i+");\" style=\"cursor:hand;font-weight:"+tmpBold+"\" onmouseover=\"this.style.color='red'\" onmouseout=\"this.style.color='#000000'\" style=\"#000000\">"+i+"</span> ";
	}
	if(inNextImage==""){
		tmpNextImage="[´ÙÀ½]";
	}else{
		tmpNextImage="<img src=\""+inNextImage+"\" border=0>";
	}
	if(nowBlock!=totalBlock){
		nextPage=nowBlock*blockSize+1;
		tmpNextImage=" <span onclick=\""+infunc+"("+nextPage+");\" style=\"cursor:hand\" onmouseover=\"this.style.color='red'\" onmouseout=\"this.style.color='#000000'\" style=\"#000000\">"+tmpNextImage+"</span>";
	}

	//var tmpOut="totalpage:"+totalPage+"/totalBlock:"+totalBlock+"/nowBlock:"+nowBlock+"/startPage:"+startPage+"/endPage:"+endPage+"/";

	return "<table cellpadding=0 cellspacing=0><tr><td>"+tmpPrevImage+" "+tmpStr+" "+tmpNextImage+"</td></tr></table>";
}
//ÆäÀÌÂ¡ °ü·Ã------------//


function attachFile(infilename,inchk,inNum,inoldfile,informname,insize){
	var strTemp="";
	var strTemp2="";
	var arrFile=inoldfile.split("||");
	
	strTemp+="<input type=\"file\" name=\""+infilename+"[]\" size=\"30\">";
	if(inchk=="add"){
		if(inoldfile!=""){
			strTemp2="<table cellpadding=0 cellspacing=0>";
			for(i=0;i<arrFile.length-1;i++){
				strTemp2+="<tr><td style=\"padding:1px\">";
				strTemp2+=arrFile[i];
				strTemp2+="</td><td style=\"padding:1px\"><input type=\"button\" value=\"X\" onclick=\"";
				strTemp2+=" if(confirm('»èÁ¦ÇÏ½Ã°Ú½À´Ï±î!')){";
				strTemp2+="document."+informname+".action='write_ok.php';";
				strTemp2+="document."+informname+".mode.value='"+infilename+"filedel';";
				strTemp2+="document."+informname+".delfile.value='"+arrFile[i]+"';";
				strTemp2+="document."+informname+".submit();";
				strTemp2+="};";
				strTemp2+="\"></td></tr>";
			}
			strTemp2+="</table>";
		}
 		strTemp=strTemp2+strTemp+"&nbsp;&nbsp;<input type=\"hidden\" name=\"imagesize\" value=\""+insize+"\">";
		strTemp+="<input type=\"hidden\" name=\"delfile\" value=\"\">";
		strTemp+="<input type=\"hidden\" name=\"oldfile\" value=\""+inoldfile+"\">";
		strTemp+="<input type=\"hidden\" name=\"filename\" value=\""+infilename+"\">";
		strTemp+="<input type=\"button\" value=\"Ãß°¡\" class=\"s_button\"";
		strTemp+=" onclick=\"document.all.id"+infilename+"[this.tnum].innerHTML=attachFile('"+infilename+"','no',this.tnum,'','','');\" tnum='1' id=\"add"+infilename+"\">";
		strTemp+="<div id=\'id"+infilename+"\'></div>";
	}else{
		inNum++;
		eval("document.all.add"+infilename).tnum=inNum;
	}
	strTemp+="<div id=\'id"+infilename+"\'></div>";
	return strTemp;
}

function attachFile2(infilename,inchk,inNum,inoldfile,informname,insize,intable){
	var strTemp="";
	var strTemp2="";
	var arrFile=inoldfile.split("||");
	
	strTemp+="<input type=\"file\" name=\""+infilename+"[]\" size=\"30\">";
	if(inchk=="add"){
		if(inoldfile!=""){
			strTemp2="<table cellpadding=0 cellspacing=0>";
			for(i=0;i<arrFile.length-1;i++){
				strTemp2+="<tr><td style=\"padding:1px\">";
				strTemp2+=arrFile[i];
				strTemp2+="</td><td style=\"padding:1px\"><input type=\"button\" value=\"X\" onclick=\"";
				strTemp2+=" if(confirm('»èÁ¦ÇÏ½Ã°Ú½À´Ï±î!')){";
				strTemp2+="document."+informname+".action='/include/write_ok.php';";
				strTemp2+="document."+informname+".mode.value='"+intable+"_file_delete';";
				strTemp2+="document."+informname+".delfile.value='"+arrFile[i]+"';";
				strTemp2+="document."+informname+".submit();";
				strTemp2+="};";
				strTemp2+="\"></td></tr>";
			}
			strTemp2+="</table>";
		}
 		strTemp=strTemp2+strTemp+"&nbsp;&nbsp;<input type=\"hidden\" name=\"imagesize\" value=\""+insize+"\">";
		strTemp+="<input type=\"hidden\" name=\"delfile\" value=\"\">";
		strTemp+="<input type=\"hidden\" name=\"oldfile\" value=\""+inoldfile+"\">";
		strTemp+="<input type=\"hidden\" name=\"filename\" value=\""+infilename+"\">";
		strTemp+="<input type=\"button\" value=\"Ãß°¡\" class=\"s_button\"";
		strTemp+=" onclick=\"document.all.id"+infilename+"[this.tnum].innerHTML=attachFile('"+infilename+"','no',this.tnum,'','','');\" tnum='1' id=\"add"+infilename+"\">";
		strTemp+="<div id=\'id"+infilename+"\'></div>";
	}else{
		inNum++;
		eval("document.all.add"+infilename).tnum=inNum;
	}
	strTemp+="<div id=\'id"+infilename+"\'></div>";
	return strTemp;
}


function str_cut(inStr,inSize){
	if(inStr.length>inSize){
		inStr=inStr.substring(0,inSize)+"...";
	}
	return inStr;
}


function returnXY(inAddress){
	var xmlXY = new ActiveXObject("Microsoft.XMLDOM")
	xmlXY.async="false";
	tmpUrl = "http://maps.naver.com/api/geocode.php?key=6c6ca4c06cfc3218e17af472d2fbb758&query="+inAddress;
	tmpUrl="http://go-pension.com/lib/xml.php?url="+encodeURIComponent(tmpUrl);
	xmlXY.load(tmpUrl);
	arrXY1 = xmlXY.selectNodes("//x").item(0).text;
	arrXY2 = xmlXY.selectNodes("//y").item(0).text;
	return {x:arrXY1,y:arrXY2};
}

function f_distance(inX1,inY1,inX2,inY2){
	dX=inX1-inX2;
	dY=inY1-inY2;
	return parseInt(Math.sqrt((dX*dX)+(dY*dY))/10)/100;
}

function hideElement(elmID, overDiv) {
    if(ie) {
        for(i = 0; i < document.all.tags(elmID).length; i++) {
            obj = document.all.tags(elmID)[i];

            if(!obj || !obj.offsetParent) {
                continue;
            }
      
            objLeft = obj.offsetLeft;
            objTop = obj.offsetTop;
            objParent = obj.offsetParent;
          
            while(objParent.tagName.toUpperCase() != "BODY") {
                objLeft += objParent.offsetLeft;
                objTop += objParent.offsetTop;
                objParent = objParent.offsetParent;
            }
      
            objHeight = obj.offsetHeight;
            objWidth = obj.offsetWidth;
      
            if((overDiv.offsetLeft + overDiv.offsetWidth) <= objLeft);
            else if((overDiv.offsetTop + overDiv.offsetHeight) <= objTop);
            else if(overDiv.offsetTop >= (objTop + objHeight));
            else if(overDiv.offsetLeft >= (objLeft + objWidth));
            else {
                obj.style.visibility = "hidden";
            }
        }

    }
}

function showElement(elmID) {
    if(ie) {
        for(i = 0; i < document.all.tags(elmID).length; i++) {
            obj = document.all.tags( elmID )[i];
          
            if(!obj || !obj.offsetParent) {
                continue;
            }
        
            obj.style.visibility = "";
        }
    }
}

	//¸ÖÆ¼ÆÄÀÏ ¾÷·Îµå
//file_init("upfile","ssss||dddsss||");
function file_init(inFileName,inFileData,inform,encodeFile){
	tempText ="<input type=\"hidden\" name=\"old_main_"+inFileName+"\" value=\""+inFileData+"\">";
	tempText +="<input type=\"hidden\" name=\"filedel_"+inFileName+"\" value=\"\">";
	tempText +="<TABLE cellpadding=\"0\" cellspacing=\"0\"><span id=\"addfile_"+inFileName+"\"></span>";
	tempText +="<TR>";
	tempText +="	<TD><span id=\"addfile_"+inFileName+"\"></span></TD>";
	tempText +="	<TD style=\"padding-left:40px\" valign=\"top\"><input type=\"button\" value=\"Ãß°¡\" class=\"button\" onclick=\"file_add('"+inFileName+"','','"+inform+"','')\"></TD>";
	tempText +="</TR>";
	tempText +="</TABLE>";

	document.write(tempText);
	arr_temp_date = inFileData.split("||");
	arr_temp_encode = encodeFile.split("||");
	if(inFileData!=""){
		for(i=0;i<arr_temp_date.length-1;i++){
			file_add(inFileName,arr_temp_date[i],inform,arr_temp_encode[i]);
		}
		file_add(inFileName,"",inform);
	}else{
		file_add(inFileName,"",inform);
	}
}

function file_add(inFileName,inFileValue,inform,inencode){
	tempFileNum = eval("document.all.addfile_"+inFileName).length;
	tempBR = "";
	tempOldFile = "";
	tempImg = "";
	if(inFileValue!=""){
		tempBR = "<br>";
		tempOldFile+="<input type=\"button\" value=\"X\" class='s_button' onclick=\"document.all.filedel_"+inFileName+".value='"+inFileValue+"';document."+inform+".submit();\">";
		tempImg = "<img src=\"/pds/"+inFileName+"/"+inencode+"\" width=\"31\" height=\"21\">";
	}
	


	eval("document.all.addfile_"+inFileName+"["+(tempFileNum-1)+"]").innerHTML="<input type=\"file\" name=\""+inFileName+"[]\">"+tempBR+tempImg+inFileValue+tempOldFile+"<br><span id=\"addfile_"+inFileName+"\"></span>";
}



//¿©·¯±ºµ¥¼­ ¾²ÀÓ.. ¹«¼ÓÀÎ ³»¿ëº¸±â
	function Comsubmit_main(formname,commentmode)
	{
		if (commentmode=="com_list")
		{
//			document.comForm.searchname.value=document.searchForm.searchname.value;
//			document.comForm.searchtext.value=document.searchForm.searchtext.value;
		}
		eval("document."+formname).submit();
	}
  




	 function fnImg_Check(value,formname){   // ÆÄÀÏ È®ÀåÀÚ Ã¼Å©ÇÏ±â.
		 var src = getFileExtension(value);
		 src = src.toLowerCase();

	   if(!((src.toLowerCase() == "avi")||(src.toLowerCase() == "mpeg")||(src.toLowerCase() == "mpg")||(src.toLowerCase() == "wma")||(src.toLowerCase() == "wmv")||(src.toLowerCase() == "asx")||(src.toLowerCase() == "asf")))
	   {
			 alert('µ¿¿µ»ó¸¸ Ã·ºÎÇØ ÁÖ¼¼¿ä');
			 return;
		}
		 formchk(formname);
	 }


   function getFileExtension(filePath){  // ÆÄÀÏÀÇ È®ÀåÀÚ¸¦ °¡Á®¿Å
     var lastIndex = -1;
     lastIndex  = filePath.lastIndexOf('.');
     var extension = "";

	   if(lastIndex != -1)
	   {
		 extension = filePath.substring( lastIndex+1, filePath.len );
	   }
	   else
	   {
		 extension = "";
	   }
		 return extension;
	 }
