/* ==========================
	 Browser check
	 ==========================*/
var brow = new Is(); 
function Is() { 
	var agent = navigator.userAgent.toLowerCase(); 
	this.major = parseInt(navigator.appVersion); 
	this.minor = parseFloat(navigator.appVersion); 
	this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1))); 
	this.ns2 = (this.ns && (this.major == 2)); 
	this.ns3 = (this.ns && (this.major == 3)); 
	this.ns4 = (this.ns && (this.major == 4)); 
	this.ns5 = (this.ns && (this.major > 4)); 
	this.ns6 = (this.ns && (agent.indexOf('netscape6')!=-1) ); 
	this.ns7 = (this.ns && (agent.indexOf('netscape/7')!=-1) ); 
	this.ns7pr = (this.ns && (agent.indexOf('netscape/7.0b1')!=-1) ); 
	this.ns71 = (this.ns && (agent.indexOf('netscape/7.1')!=-1) ); 
	this.ns72 = (this.ns && (agent.indexOf('netscape/7.2')!=-1) ); 
	this.ie = (agent.indexOf("msie") != -1); 
	this.ie3 = (this.ie && (this.major == 2)); 
	this.ie4 = (this.ie && (this.major >= 4)); 
	this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1)); 
	this.ie55 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1)); 
	this.ie6 = (this.ie && (agent.indexOf("msie 6.0")!=-1)); 
	this.op3 = (agent.indexOf("opera") != -1); 
	this.pc  = (agent.indexOf("win") != -1); 
	this.mac = (agent.indexOf("mac")!=-1); //Mac detect 
	this.client = ( (navigator.userAgent.indexOf('AOL')!=-1) || (navigator.userAgent.indexOf('CS 2000')!=-1) )? 1 : 0; 
	this.moz = ( this.ns && (agent.indexOf("netscape/") == -1) ); 
	if (this.moz) this.ns = 0; 
} 

if ( brow.ie ) var ie = true;
else var ie = false;

/* ==========================
	°ø¹éÁ¦°Å
	==========================*/
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/gi, "");
}

/* ==========================
	REPLACE OPTION
	»ç¿ë¹ý : ¹®ÀÚ¿­.value.replaceAll(/", ""A);  
	            -> ¹®ÀÚ¿­¿¡¼­ /¸¦ Ã£¾Æ A·Î ¹Ù²Ù¾î¶ó.
	==========================*/
String.prototype.replaceAll = function(str1, str2) {
	var temp_str = "";

	if (this.trim() != "" && str1 != str2) {
		temp_str = this.trim();
	
		while (temp_str.indexOf(str1) > -1) {
			temp_str = temp_str.replace(str1, str2);
		}
	}
	return temp_str;
}

/* ==========================
	AJAX ¹æ½ÄÀÇ µ¥ÀÌÅ¸ ºÒ·¯žª±â (IE/FF °ø¿ë) - µ¿±â½Ä
	document.getElementById("xxx").innerHTML = getHttprequest('/form/test,php?what='+what);
	test,php¿¡¼­ echo iconv("EUC-KR","UTF-8",$string); °ú °°ÀÌ ÇÊ¿äÇÒ °æ¿ì ÇÑ±Û Ã³¸®ÇØ¾ßÇÔ.
	==========================*/	
function getHttprequest(URL) { 
    var xmlhttp = null; 
    if(window.XMLHttpRequest) { 
        xmlhttp = new XMLHttpRequest(); 
    } else { 
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    xmlhttp.open('GET', URL,false); 
    xmlhttp.onreadystatechange = function() { 
	    if(xmlhttp.readyState==4 && xmlhttp.status == 200) { 
            responseText = xmlhttp.responseText; 
        } 
    } 
    xmlhttp.send(''); 
    return responseText = xmlhttp.responseText; 
} 

/* ==========================
	±Ý¾× ÀÔ·Â ºÎºÐ°ú ÀÚµ¿ ÄÞ¸¶ Ã³¸® ½ÃÀÛ
	==========================*/
function nekr_auto_comma(frm,val) {
    if (ie) {
        var keyCode = window.event.keyCode;
        if ( ((keyCode>=48) && (keyCode <= 105)) || (keyCode==8) || (keyCode==13) || (keyCode==35) || (keyCode==46) || (keyCode==190)) {
            //0(48)~¼ýÀÚÅ°ÆÐµå9(105), enter(13), bakspace(8), delete(46), end(35) key dot(.) ÀÏ ¶§¸¸ Ã³¸®ÇÑ´Ù.
            var str = "" + nekr_get_number(val.value); //¼ýÀÚ¸¸ °¡Á®¿Â´Ù
            if ( (str != null) && (str != "")  ) {
                val.value = nekr_add_comma(str); //ÄÞ¸¶»ðÀÔ
            } else {
                val.value = "0";
            }
        }
    }
    return;
}

/* ==========================
	±Ý¾× ÀÔ·Â ºÎºÐ°ú ÀÚµ¿ ÄÞ¸¶ Ã³¸® ½ÃÀÛ (¼Ò¼öÁ¡ ÀÎ½Ä)
	==========================*/
function nekr_auto_comma2(frm,val) {
    if (ie) {
        var keyCode = window.event.keyCode;
        if ( ((keyCode>=48) && (keyCode <= 105)) || (keyCode==8) || (keyCode==13) || (keyCode==35) || (keyCode==46) || (keyCode==190)) {
            //0(48)~¼ýÀÚÅ°ÆÐµå9(105), enter(13), bakspace(8), delete(46), end(35) key dot(.) ÀÏ ¶§¸¸ Ã³¸®ÇÑ´Ù.
            var str = "" + nekr_get_number(val.value); //¼ýÀÚ¸¸ °¡Á®¿Â´Ù
            if ( (str != null) && (str != "") && (str != "0") ) {
                val.value = nekr_add_comma2(str); //ÄÞ¸¶»ðÀÔ
            } else {
                val.value = "0";
            }
        }
    }
    return;
}

/* ==========================
	¼ýÀÚ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶ Âï±â, ¼Ò¼öÁ¡ºÒ°¡´É
	==========================*/
function nekr_add_comma(val) {
    var ss = val.split(".");
	if ( ss.length > 1 ) {
		var num = ""+ss[0];
		var num2 = "."+ss[1];
	} else {
	    var num = ""+val;
	}
    
	if(num.length <= 3) {
		if ( ss.length > 1 ) {
			return num+num2;
		} else {
			return num;
		}
	}
    var loop = Math.ceil(num.length / 3);
    var offset = num.length % 3;
    if(offset==0) offset = 3;
    var str = num.substring(0, offset);
    for(i=1;i<loop;i++) {
        str += "," + num.substring(offset, offset+3);
        offset += 3;
    }
   	if ( ss.length > 1 ) {
		return str+num2;
	} else {
		return str;
	}
}

/* ==========================
	¼ýÀÚ 3ÀÚ¸®¸¶´Ù ÄÞ¸¶ Âï±â, ¼Ò¼öÁ¡ÀÌÇÏ ÀÔ·Â°¡´É
	==========================*/
function nekr_add_comma2(val) {
    var ss = val.split(".");
	if ( ss.length > 1 ) {
		var num = ""+ss[0];
		var num2 = "."+ss[1];
	} else {
	    var num = ""+val;
	}
    
	if(num.length <= 3) {
		if ( ss.length > 1 ) {
			return 0;
		} else {
			return 0;
		}
	}     
	var loop = Math.ceil(num.length / 3);
    var offset = num.length % 3;
    if(offset==0) offset = 3;
    var str = num.substring(0, offset);
    for(i=1;i<loop;i++) {
        if ( (loop-1) > i ) str += "," + num.substring(offset, offset+3);
		else str += ",000";
        offset += 3;
    }
   	if ( ss.length > 1 ) {
		return str+num2;
	} else {
		return str;
	}
}

/* ==========================
	ÀÔ·ÂµÈ value¿¡¼­ ¼ýÀÚ¸¸ ¸®ÅÏ
	==========================*/
function nekr_get_number(val) {
	var ss = val.split(".");
	if ( ss.length > 1 ) {
		var str = ""+ss[0];
		var str2 = "."+ss[1];
	} else {
	    var str = ""+val;
	}
    var temp = "";
    var num = "";
    for(var i=0; i<str.length; i++) {
        temp = str.charAt(i);
        if (temp >= "0" && temp <= "9") {
            num += temp;
        }
    }
    if ( (num != null) && (num != "")  ) {
        if ( ss.length > 1 ) {
			return parseInt(num,10)+str2; //½ÊÁø¼ö·Î º¯È¯ÇÏ¿© ¸®ÅÏ
		} else {
			return parseInt(num,10); //½ÊÁø¼ö·Î º¯È¯ÇÏ¿© ¸®ÅÏ
		}
    } else {
        return "0";
    }
} 

/* ==========================
	¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â.(.)46 .ÀÔ·Â°¡´É 
	onkeyPress="nekr_num_check(event);" 
	==========================*/
function nekr_num_check(evt) {
	var keyCode = ( ie ) ? window.event.keyCode : evt.which;
	if ( (keyCode >= 48) && (keyCode <= 57) || keyCode == 45 ) {
		return;
	} else {
		if ( ie ) event.returnValue=false;
		else evt.preventDefault();
	}
}

/* ==========================
	¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â. .ÀÔ·ÂºÒ°¡´É
	==========================*/
function nekr_num_check2() {
    if (ie) {
        var keyCode = window.event.keyCode;
        if ( (keyCode >= 48) && (keyCode <= 57) || keyCode == 45 ) {
			return;
        } else {
            event.returnValue=false;
		}
    }
}

/* ==========================
	limit ÀÌ»óÀÇ ÀÔ·Â°ªÀÏ °æ¿ì ÀÔ·Â°ÅºÎ
	==========================*/
function nekr_limit(frm, val, limit, msg ) {
	va = parseInt(val.value,10);
	if ( va > limit ) {
		alert(msg);
		val.value = limit;
	}
}

/* ==========================
	¼ýÀÚÀÇ ¼¼ÀÚ¸®¸¶´Ù , »ðÀÔ
	==========================*/
function nekr_number_format(number,decimals ) {
    if ( number != "0" ) {
		var number_str = String(number);
	    var new_number_str = '';
	    number_info = number_str.split('.');
	    number_info_int = number_info[0];
	    if (decimals != null ) {
	        if (decimals > 0) new_number_str ='.' + ((decimals > 0) ?Math.round(Number('0.' +number_info[1]) * Math.pow(10, decimals)):'');
	        else if (decimals < 0) number_info_int = String(Math.round(Number(number_info[0]) / Math.pow(10, decimals *(-1))) *Math.pow(10, decimals*(-1)));
	    }
	    len = number_info_int.length;
	    for (i = len; i >= 0; i--) {
	        if ( (len - i) > 1 && (len - i) % 3 == 1)  new_number_str = ',' + new_number_str;
	        new_number_str = number_info_int.substring(i, i+1) +  new_number_str;
	    }
	    return new_number_str;
	} else return "0";
}

/* ==========================
	Javascript¿ë printf
	==========================*/
function printf(fstring) { 
	var pad = function(str,ch,len)
     { var ps='';
       for(var i=0; i<Math.abs(len); i++) ps+=ch;
       return len>0?str+ps:ps+str;
     }
   var processFlags = function(flags,width,rs,arg)
     { var pn = function(flags,arg,rs)
         { if(arg>=0)
             { if(flags.indexOf(' ')>=0) rs = ' ' + rs;
               else if(flags.indexOf('+')>=0) rs = '+' + rs;
             }
           else
               rs = '-' + rs;
           return rs;
         }
       var iWidth = parseInt(width,10);
       if(width.charAt(0) == '0')
         { var ec=0;
           if(flags.indexOf(' ')>=0 || flags.indexOf('+')>=0) ec++;
           if(rs.length<(iWidth-ec)) rs = pad(rs,'0',rs.length-(iWidth-ec));
           return pn(flags,arg,rs);
         }
       rs = pn(flags,arg,rs);
       if(rs.length<iWidth)
         { if(flags.indexOf('-')<0) rs = pad(rs,' ',rs.length-iWidth);
           else rs = pad(rs,' ',iWidth - rs.length);
         }    
       return rs;
     }
   var converters = new Array();
   converters['c'] = function(flags,width,precision,arg)
     { if(typeof(arg) == 'number') return String.fromCharCode(arg);
       if(typeof(arg) == 'string') return arg.charAt(0);
       return '';
     }
   converters['d'] = function(flags,width,precision,arg)
     { return converters['i'](flags,width,precision,arg); 
     }
   converters['u'] = function(flags,width,precision,arg)
     { return converters['i'](flags,width,precision,Math.abs(arg)); 
     }
   converters['i'] =  function(flags,width,precision,arg)
     { var iPrecision=parseInt(precision);
       var rs = ((Math.abs(arg)).toString().split('.'))[0];
       if(rs.length<iPrecision) rs=pad(rs,' ',iPrecision - rs.length);
       return processFlags(flags,width,rs,arg); 
     }
   converters['E'] = function(flags,width,precision,arg) 
     { return (converters['e'](flags,width,precision,arg)).toUpperCase();
     }
   converters['e'] =  function(flags,width,precision,arg)
     { iPrecision = parseInt(precision);
       if(isNaN(iPrecision)) iPrecision = 6;
       rs = (Math.abs(arg)).toExponential(iPrecision);
       if(rs.indexOf('.')<0 && flags.indexOf('#')>=0) rs = rs.replace(/^(.*)(e.*)$/,'$1.$2');
       return processFlags(flags,width,rs,arg);        
     }
   converters['f'] = function(flags,width,precision,arg)
     { iPrecision = parseInt(precision);
       if(isNaN(iPrecision)) iPrecision = 6;
       rs = (Math.abs(arg)).toFixed(iPrecision);
       if(rs.indexOf('.')<0 && flags.indexOf('#')>=0) rs = rs + '.';
       return processFlags(flags,width,rs,arg);
     }
   converters['G'] = function(flags,width,precision,arg)
     { return (converters['g'](flags,width,precision,arg)).toUpperCase();
     }
   converters['g'] = function(flags,width,precision,arg)
     { iPrecision = parseInt(precision);
       absArg = Math.abs(arg);
       rse = absArg.toExponential();
       rsf = absArg.toFixed(6);
       if(!isNaN(iPrecision))
         { rsep = absArg.toExponential(iPrecision);
           rse = rsep.length < rse.length ? rsep : rse;
           rsfp = absArg.toFixed(iPrecision);
           rsf = rsfp.length < rsf.length ? rsfp : rsf;
         }
       if(rse.indexOf('.')<0 && flags.indexOf('#')>=0) rse = rse.replace(/^(.*)(e.*)$/,'$1.$2');
       if(rsf.indexOf('.')<0 && flags.indexOf('#')>=0) rsf = rsf + '.';
       rs = rse.length<rsf.length ? rse : rsf;
       return processFlags(flags,width,rs,arg);        
     }  
   converters['o'] = function(flags,width,precision,arg)
     { var iPrecision=parseInt(precision);
       var rs = Math.round(Math.abs(arg)).toString(8);
       if(rs.length<iPrecision) rs=pad(rs,' ',iPrecision - rs.length);
       if(flags.indexOf('#')>=0) rs='0'+rs;
       return processFlags(flags,width,rs,arg); 
     }
   converters['X'] = function(flags,width,precision,arg)
     { return (converters['x'](flags,width,precision,arg)).toUpperCase();
     }
   converters['x'] = function(flags,width,precision,arg)
     { var iPrecision=parseInt(precision);
       arg = Math.abs(arg);
       var rs = Math.round(arg).toString(16);
       if(rs.length<iPrecision) rs=pad(rs,' ',iPrecision - rs.length);
       if(flags.indexOf('#')>=0) rs='0x'+rs;
       return processFlags(flags,width,rs,arg); 
     }
   converters['s'] = function(flags,width,precision,arg)
     { var iPrecision=parseInt(precision);
       var rs = arg;
       if(rs.length > iPrecision) rs = rs.substring(0,iPrecision);
       return processFlags(flags,width,rs,0);
     }
   farr = fstring.split('%');
   retstr = farr[0];
   fpRE = /^([-+ #]*)(\d*)\.?(\d*)([cdieEfFgGosuxX])(.*)$/;
   for(var i=1; i<farr.length; i++)
     { fps=fpRE.exec(farr[i]);
       if(!fps) continue;
       if(arguments[i]!=null) retstr+=converters[fps[4]](fps[1],fps[2],fps[3],arguments[i]);
       retstr += fps[5];
     }
   return retstr;
 }
 
/* ==========================
	°Ô½ÃÆÇÀÇ Preview ÀÌ¹ÌÁö »çÀÌÁî °­Á¦ Á¶Á¤
	==========================*/
 function getReSize_img(va) {
 	try {
		var imgs = document.getElementById('Preview_div'+va).getElementsByTagName('IMG');
		for(var i = 0; i < imgs.length; i++) {
			iwid = parseInt(imgs[i].style.width.replaceAll('px',''),10);
			ihei = parseInt(imgs[i].style.height.replaceAll('px',''),10);
			
	    	if(iwid <= 540) continue;
	
	    	imgs[i].style.height = Math.round(ihei * 540 / iwid);
		    imgs[i].style.width = 540;
		}
	} catch(e) {}
} 

/* ==========================
   ÁöÁ¤ÇÑ n millis µ¿¾È sleep
	==========================*/	
function pause(numberMillis) {
     var now = new Date();
     var exitTime = now.getTime() + numberMillis;
	
     while (true) {
          now = new Date();
          if (now.getTime() > exitTime)
              return;
     }
}

/* ==========================
   ÄÁÅÙÃ÷ÀÇ ±ÛÀÚÅ©±â Á¶Á¤
	==========================*/	
var fS=100;
function fontPlus() { 
//	zoom('body', 'in');
	if (fS < 110) {
		fS = fS + 2; 
		setFaceSize('+'); 
	} 
}

function fontMinus() { 
//	zoom('body', 'out');
	if (fS > 100) {
		fS = fS - 2; 
		setFaceSize('-'); 
	} 
}

var zoomSize = 100; 
function zoom(Obj,Method) 
{ 
    if(Method == "in") { 
        zoomSize = eval(zoomSize + 10); 
    } 
    else if(Method == "out") { 
        if(zoomSize > 90) { 
	        zoomSize = eval(zoomSize - 10); 
        } 
    } 
    else if(Method == "reset") { 
        zoomSize = 100; 
    } 
    document.body.style.zoom = zoomSize + "%"; 
} 

function setFaceSize(flag) {
	if (document.getElementById) fontObj = document.getElementById("c1") ;
 	else if (document.all) fontObj = document.all("c1") ;
	
	starti = 0;
	endi = 0;
	
	var x = document.getElementsByTagName('*');
	for ( i = 0; i < x.length; i++ ) {		
		if ( x[i].id == "c1" && starti == 0) starti = i; break;
	}
	var x = fontObj.getElementsByTagName('*');
	endi = (starti + x.length)-1;
	starti++;
	for ( j = starti; j <= endi; j++ ) x[j].style.fontSize = fS+'%';
}

/* ==========================
   ÄÁÅÙÃ÷ ½ºÅ©·¦
	==========================*/	

function ScrapContent(QueryString,Menu) {
	try {
		if(RemoteOpen==0) {
			var lv = GetCookie("MYLEVEL");
			if( lv == '6' || lv == '1'){
				top.remote.location.href="/ScrapContent2.html?q="+QueryString+"&m="+Menu;
			}else{
				top.remote.location.href="/ScrapContent.html?q="+QueryString+"&m="+Menu;
			}
			divMenu.style.display='none';
			SetCookie ("divMenu", "off");
			parent.document.body.cols="*,200";
			RemoteOpen=1;
		} else {
			SetCookie ("divMenu", "on");
			divMenu.style.display='';
			parent.document.body.cols="*, 0";
			RemoteOpen=0;
			top.remote.location.href="about:blank";
		}
	}catch(e) {}
}

function open_go( url ) {
	if ( url != "" ) {
		window.open(url);
	}
}

var RemoteOpen = 0;

function divMenuOnOff() {
	var onoff = GetCookie("divMenu");
	if(!onoff) { SetCookie ("divMenu", "on"); divMenu.style.display=''; }
	if(onoff!="off") { divMenu.style.display=''; }
}

function divBannerOnOff() {
	var onoff = GetCookie("divBanner");
	if(!onoff) { SetCookie("divBanner", "on"); document.getElementById('divBanner').style.display=''; }
	if(onoff!="off") { document.getElementById('divBanner').style.display=''; }
}

function PhotoSlideView(lo,sw) {
	if(sw=="on") {
		parent.resizeTo(1022,screen.availHeight-20);
		top.remote.location.href=lo;
		divMenu.style.display='none';
		SetCookie ("divMenu", "off");
		parent.document.body.cols="*,200";
		RemoteOpen=1;
	} else {
		divMenu.style.display='';
		SetCookie ("divMenu", "on");
		parent.document.body.cols="*, 0";
		RemoteOpen=0;
		top.remote.location.href="about:blank";
	}
}

function CheckSlideView(lo) {
	var Locate = top.remote.location.href;
	var pos = Locate.indexOf("photo_list.html");
	if(pos!=-1) {
			PhotoSlideView(lo,"on");
	}
}

function sendhelp(view) {
	//var Locate = top.remote.location.href;
	//var pos = Locate.indexOf("help.html");
	//if(pos!=-1) {
		//top.remote.help_view2.innerHTML = view;
	//}
}

function HelpView(sw) {
	if(sw=="on") {
		parent.resizeTo(1022,screen.availHeight-20);
		top.remote.location.href="/include/help.html";
		divMenu.style.display='none';
		SetCookie ("divMenu", "off");
		parent.document.body.cols="*,200";
		RemoteOpen=1;
	} else {
		divMenu.style.display='';
		SetCookie ("divMenu", "on");
		parent.document.body.cols="*, 0";
		RemoteOpen=0;
		top.remote.location.href="about:blank";
	}
}
function searchsubmit(fobj) {
	fobj.keyword.value = fobj.keyword.value.replaceAll("%","");
	if(fobj.keyword.value.length<2) {
		alert("°Ë»öÇÒ ´Ü¾î¸¦ 2ÀÚÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
		fobj.keyword.focus();
		return false;
	} else {
		fobj.submit();
	}
}

function searchset(sval, kval) {
	sform2.keyword.value = kval;
	for(i=0;i<sform2.search.length;i++) {
		if(sform2.search.options[i].value == sval) {
			sform2.search.options[i].selected = true;
			searchsubmit(sform2);
		}
	}
}
function PrintContent(QueryString,Menu) {
	win = window.open("/PrintContent.html?"+QueryString+"&m="+Menu,"Print","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,top=0,left=0,width=638,height=600");
}

function SendContent(QueryString,Menu) {
	win = window.open("/SendMailContent.html?q="+QueryString+"&m="+Menu,"SendMail","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,top=0,left=0,width=522,height=455");
}

function SendOpen(QueryString,Menu) {
	win = window.open("/run/common/SendOpen.html?q="+QueryString+"&m="+Menu,"SendMail","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,top=0,left=0,width=300,height=200");
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name)  {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)  {
	var j = i + alen;
	
	if (document.cookie.substring(i, j) == arg)
	return getCookieVal (j);i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break; 
	}
	return null;
}

function SetCookie (name, value)  {
	expireDate = new Date;
	var path = "/";
	var domain = "ipohang.org";
	document.cookie = name + "=" + escape (value) + "; expires=" + expireDate + "; path=" + path + "; domain= " + domain;
} 
 
function onFormlink(form){	// °ú »ç¾÷¼Ò À¾¸éµ¿ ¹Ù·Î°¡±â
	var list=form.selectedIndex;
		if (list == 0 || list == 1) {
		}
		else{
			top.location.href=form.options[list].value;
		}
		form.selectedIndex = 0;
}

function selectmove(url){	// °ú »ç¾÷¼Ò À¾¸éµ¿ ¹Ù·Î°¡±â
		if(url!="") {
				window.open(url);
		}
}

function selectmoveself(url){	// °ú »ç¾÷¼Ò À¾¸éµ¿ ¹Ù·Î°¡±â
		if(url!="") {
				document.location.href=url;
		}
}

function change1(form){
	var list=form.selectedIndex;
	window.open(form.options[list].value)
	//form.selectedIndex = 0;
}

					// input ¹öÆ° »ö±ò ¹Ù²Ù±â
function change_color(color){
if (event.srcElement.tagName=="INPUT")
event.srcElement.style.backgroundColor=color
}

function dzFormSelect(form){
var list=form.selectedIndex;
top.location.href=form.options[list].value;
form.selectedIndex = 0;
}

function selfSelect(form){
var list=form.selectedIndex;
	if (list == 0 || list == 1) {
	} else if (list == 2 || list == 3 || list == 4) {
		window.open(form.options[list].value)
	} else {
		self.location.href=form.options[list].value;
	}
form.selectedIndex = 0;
}

function aselfSelect(form){
var list=form.selectedIndex;
	if (list == 0 || list == 1) {
	} else if (list == 2) {
		window.open(form.options[list].value)
	} else {
		self.location.href=form.options[list].value;
	}
form.selectedIndex = 0;
}

function cselfSelect(form){
var list=form.selectedIndex;
	if (list == 0 || list == 1) {
	} else {
		window.open(form.options[list].value)
	}
form.selectedIndex = 0;
}

function bselfSelect(form){
var list=form.selectedIndex;
	self.location.href=form.options[list].value;
form.selectedIndex = 0;
}

// ÅëÇÕ°Ë»ö
function GoQuery (form) {
	if ("" != form.query.value) {
		form.submit ();
	}
}

function Button_menu(btn_border,btn_val)
{
	btn_border.style.border = btn_val
}

function sy_popup(url,popup_name,width_size,height_size) {
	win = window.open(url,popup_name,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,top=50,left=50,width=" + width_size + ",height=" + height_size);
	win.focus();
return;
}

function sn_popup(url,popup_name,width_size,height_size) {
	win = window.open(url,popup_name,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=no,top=50,left=50,width=" + width_size + ",height=" + height_size);
	win.focus();
return;
}

function org_popup(url,popup_name,width_size,height_size) {
	win = window.open(url,popup_name,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,top=50,left=50,width=" + width_size + ",height=" + height_size);
	win.focus();
return;
}

function rs_popup(url,popup_name,width_size,height_size) {
	win = window.open(url,popup_name,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,top=50,left=50,width=" + width_size + ",height=" + height_size);
	win.focus();
return;
}

function opensearchzip() {
	zipsearch = window.open("/member/zip/zipcodeb.php","view", "width=469,height=250,top=100,left=350,toolbar=no,status=no,memu=no,scrollbars=yes");
	return;
}

function organ_login() {
	alert(' ·Î±×ÀÎ ÇÏ½Å ÈÄ ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù...! ');
	return;
}

function Index() {
	location.href = '/';
}

function LogOut() {
	location.href = '/login/logout.html';
}

function Yak() {
	location.href = '/home/www/Sub_Member/contract/';
}

function gaeb() {
	location.href = '/home/tour/etc/member_join/';
}

function gaeb1() {
	location.href = '/home/tour1/etc/member_join/';
}

function dominYak() {
	location.href = '/home/domin/Sub_Member/member/';
}

function councilYak() {
	location.href = '/home/council/etc/member';
}

function healthYak() {
	location.href = '/home/health/Sub_member/contract/';
	//location.href = '#';
}

function AtecYak() {
	location.href = '/home/atec/Sub_Member/contract';
	//location.href = '#';
}

function wwwMember() {
	location.href = '/home/www/member/1/?mode=member_reg';
	//location.href = '#';
}

function councilMember() {
	location.href = '/home/council/etc/member/?mode=member_reg';
	//location.href = '#';
}

function healthMember() {
	location.href = '/home/health/etc/1/?mode=member_reg';
	//location.href = '#';
}

function AtecMember() {
	location.href = '/home/atec/etc/member/?mode=member_reg';
	//location.href = '#';
}

function ADmin() {
	location.href = '/admintool/cms.html';
	//location.href = '#';
}

function Id_Pass() {
	window.open("/member/idpass.html","view", "width=400,height=250,top=100,left=350,toolbar=no,status=no,memu=no,scrollbars=no");
}

function video() {
	window.open("/video/","video", "width=700,height=668,top=50,left=50,toolbar=no,status=no,memu=no,scrollbars=no");
}

function liab() {
	window.open("http://laib.go.kr/laib/owa/w1126?sPSiDo=46&sPSiGunGu=910","laib", "width=820,height=600,top=50,left=50,toolbar=no,status=no,memu=no,scrollbars=yes");
}

function openurl() {
	alert(' ºñ°ø°³ ±ÛÀÔ´Ï´Ù. ');
	return;
}

function resizeFrame(name){
        var oBody = document.body;
        var oFrame = parent.document.all(name);
        var min_height = 320; //iframeÀÇ ÃÖ¼Ò³ôÀÌ(³Ê¹« ÀÛ¾ÆÁö´Â °É ¸·±âÀ§ÇÔ, ÇÈ¼¿´ÜÀ§, ÆíÁý°¡´É)
        var min_width = 465; //iframeÀÇ ÃÖ¼Ò³Êºñ
        var i_height = oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight);
        var i_width = oBody.scrollWidth + (oBody.offsetWidth-oBody.clientWidth);

        if(i_height < min_height) i_height = min_height;
        if(i_width < min_width) i_width = min_width;
        oFrame.style.height = i_height;
        oFrame.style.width = i_width;

        parent.scrollTo(1,1); 
}

function flash_TagScript(width,height,file_path){
	var sTag = ''
		+ '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0" width=' + width + ' height=' + height +'>'
		+ '	<param name="movie" value=' + file_path + '>'
		+ '	<param name=quality value=high>'
		+ '	<param name=wmode value=transparent>'
		+ '	<embed src=' + file_path + ' quality=high wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width=' + width + ' height=' + height + ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'
		+ '	</object>'
		+ '';
	document.write(sTag);
}

function flash_TagScript2(width,height,file_path,loop){
	if ( !eval(loop) ) loop = 'false';
	var sTag = ''
		+ '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width=' + width + ' height=' + height +'>'
		+ '	<param name="movie" value=' + file_path + '>'
		+ '	<param name="play" value="true">'
		+ '	<param name="loop" value="'+loop+'">'
		+ '	<param name="quality" value="high">'
		+ '	<param name="bgcolor" value="#FFFFFF">'
		+ '	<param name=wmode value=transparent>'
		+ '	<embed src=' + file_path + ' quality=high wmode="transparent"  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width=' + width + ' height=' + height + '></embed>'
		+ '	</object>'
		+ '';
	document.write (sTag);
}

function address_jiga(va0,va1) {
	url = "/run/jiga_area/jiga_area.html?p0="+va0+"&p1="+va1;
	window_center(400,200,url);
}

function window_center(sw,sh,url){
	cw=screen.availWidth; //È­¸é ³Êºñ
	ch=screen.availHeight; //È­¸é ³ôÀÌ
	
	ml=(cw-sw)/2;//°¡¿îµ¥ ¶ç¿ì±âÀ§ÇÑ Ã¢ÀÇ xÀ§Ä¡
	mt=(ch-sh)/2;//°¡¿îµ¥ ¶ç¿ì±âÀ§ÇÑ Ã¢ÀÇ yÀ§Ä¡
	
	selfID =window.open(url,'win','width='+sw+',height='+sh+',top='+mt+',left='+ml+',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no');
	selfID.opener = self;
}

function window_center_scroll(sw,sh,url){
	cw=screen.availWidth; //È­¸é ³Êºñ
	ch=screen.availHeight; //È­¸é ³ôÀÌ
	
	ml=(cw-sw)/2;//°¡¿îµ¥ ¶ç¿ì±âÀ§ÇÑ Ã¢ÀÇ xÀ§Ä¡
	mt=(ch-sh)/2;//°¡¿îµ¥ ¶ç¿ì±âÀ§ÇÑ Ã¢ÀÇ yÀ§Ä¡
	
	selfID =window.open(url,'win','width='+sw+',height='+sh+',top='+mt+',left='+ml+',resizable=no,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no');
	selfID.opener = self;
}

function quest2006_step2() {
	try { document.getElementById("insert_bt").style.display = 'none'; }catch(e) { }
	return true;
}

function quest2006_step3() {
	try { document.getElementById("insert_bt").style.display = 'none'; }catch(e) { }
	return true;
}

function image_create(ssrc) {
	var lookup = "width=400,height=400,top=0,left=0,scrollbars=0,resizable=1,toolbar=0,menubar= 0,location=0,directories=0,status=0";
	var iv = window.open("/template/store_img_view.html?src="+ssrc,"IMG_VIEW",lookup);
	iv.focus();
}

function imgPopup(tableName, step, code) {
	var lookup = "width=400,height=400,top=0,left=0,scrollbars=0,resizable=1,toolbar=0,menubar= 0,location=0,directories=0,status=0";
	var iv = window.open("/run/common/sleep_img_view.html?TableName="+tableName+"&step="+step+"&code="+code,"IMG_VIEW",lookup);
	iv.focus();
}


// ½Ã¹Î ¾ÆÀÌµð¾î Á¡¼ö ºÎ¿©
function simin_idea_point_apply(){
	frm = document.getElementById("pointform");
	
	if ( frm.pointis.value.length < 1 ) {
		alert('ºÎ¿©ÇÒ Á¡¼ö¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		frm.pointis.focus();
		return false;
	} else {
		frm.submit();
	}
}

function checkJumin(str) { 
	var jumin = "/^[0-9]{2}[0|1]{1}[0-9]{1}[0-3]{1}[0-9]{1}[-| ]{1}[1|2|3|4]{1}[0-9]{6}$/";
	var jumin2 = "/^[0-9]{2}[0|1]{1}[0-9]{1}[0-3]{1}[0-9]{1}{1}[1|2|3|4]{1}[0-9]{6}$/";
	var number = "/^[0-9]*$/"; 

	var len  = str.length; 
	var a    = ""; 
	var tmp  = ""; 
	var tmp2 = ""; 
	var recontent = "";
	for(i=0; i<len; i++) { 
		a = str.substring(i,i+1); 
		tmp = str.substring(i,i+14); 
		tmp2 = str.substring(i,i+13); 

		if ( jumin.test(tmp) ) {
			recontent += str.substring(i,i+6)+"-*******";  
			i += 13;
		} else if (  jumin2.test(tmp2) ) { 
			recontent += str.substring(i,i+6)+"*******";  
			i += 12;
		} else {
			recontent += a;
		}
	} 
	return recontent;
} 

//function $(id) { return document.getElementById(id); }

//window.onerror = HandleError ;
 
function HandleError(message, url, line) {
	return true;
}

function bbs_title_color_set() {
	var cr = document.getElementById("bbs_title_color").value;
	document.getElementById("bbs_title").style.color = '#'+cr;
}

function DebugMode() {
	var frm=document.getElementById("debug_div");
	if ( frm.style.display == "block" ) frm.style.display = 'none';
	else frm.style.display = 'block';
}

function SubmenuSlide( actno ) {
	var uls = document.getElementsByTagName('ul');
	j = 0;
	for ( i = 0;  i < uls.length; i++ ) {

		if ( uls[i].className =="depth02" ) {
			j++;
			if (document.getElementById("Submenu_"+j))
			{
				if ( j == actno ) document.getElementById("Submenu_"+j).style.display = "block"; 
				else document.getElementById("Submenu_"+j).style.display = "none"; 
			}
		}
	}


	if (document.getElementById("Submenu_12")) {
		if (actno == '12'){
			document.getElementById("Submenu_12").style.display = "block"; 
		}else {
			document.getElementById("Submenu_12").style.display = "none"; 
		}
	}
}

function isAccess(e) {
	var keynum;
	var ismouseClick = 1;

	if (window.event) { //IE & Safari
		keynum = e.keyCode;
	
		//SafariÀÇ °æ¿ì ¸¶¿ì½ºÅ¬¸¯Àº keynum 0 ÀÌ ³Ñ¾î¿È
		if (event.button == 0 || keynum == 0){
			ismouseClick = 0;
		}
	} else if ( e.which ){ // Netscape/Firefox/Opera
		keynum = e.which;

		if (keynum == 1) {
			ismouseClick = 0;
		}
	}

	//¸¶¿ì½º Å¬¸¯ÀÌ°Å³ª ¿£ÅÍÅ°¸¦ ´©¸¥°æ¿ì true°ª ¹ÝÈ¯
	if ( ismouseClick == 0 || keynum == 13 ) {
		return true;
	} else {
		return false;
	}
}

function sms_cnt(agNum) {

	var fo_name = document.getElementById("smsform");
	var pattern = new RegExp('[A-Za-z0-9]', 'i'); 
	var str_tmp = "";

	str = fo_name.sms_msg.value;
	len = str.length;
	len_cnt = 0;

	cutValue = 0;
	for ( i = 0; i < len; i++ ) {
		if ( pattern.exec(str.charAt(i)) == null && str.charCodeAt(i) >= 128 ) len_cnt += 2;
		else len_cnt += 1;
		if (len_cnt <= agNum) {
			cutValue++; 
		} else {
			if ( pattern.exec(str.charAt(i)) == null && str.charCodeAt(i) >= 128 ) len_cnt -= 2;
			else len_cnt--;
			alert('±ÛÀÚ¼ö°¡'+agNum+'byte ÀÌ»óÀº »ç¿ëºÒ°¡´ÉÇÕ´Ï´Ù');

			document.getElementById("sms_msg").innerText = str.substring(0, cutValue);
			document.getElementById("sms_cnt").innerText = len_cnt;
			return;
		}
	}

			document.getElementById("sms_cnt").innerText = len_cnt;
}