// À¯Æ¿¸®Æ¼ ÇÔ¼ö
if(typeof config_home_root_url == "undefined"){
	var config_home_root_url = "/";
} // config_home_root_url º¯¼ö°ªÀÌ Á¸Àç ÇÏ´Â°¡ ÆÇ´Ü

function openWin(url,width,height) {
	var argv = openWin.arguments;
	var argc = openWin.arguments.length;
	var scl=(argc>3)?"yes":"no";
	var str,top,left;
	top = parseInt(screen.height/3 - height/2);
	left = parseInt(screen.width/3 - width/2);
	if(top<0) top=0;
	if(left<0) left=0;
	str="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scl+",resizable=no,copyhistory=no,";
	str=str+"width="+width+",height="+height;
	str=str+",top="+top;
	str=str+",left="+left;
	var st = window.open(url,"",str);
	st.focus();
	}
function openWinS(url,width,height,pname) {
	var argv = openWinS.arguments;
	var argc = openWinS.arguments.length;
	var scl=(argc>4)?"yes":"no";
	var str,top,left;
	top = parseInt(screen.height/3 - height/2);
	left = parseInt(screen.width/3 - width/2);
	if(top<0) top=0;
	if(left<0) left=0;
	str="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scl+",resizable=no,copyhistory=no,";
	str=str+"width="+width+",height="+height;
	str=str+",top="+top;
	str=str+",left="+left;
	var st = window.open(url,pname,str);
	st.resizeTo(width,(height+30))
	st.focus();
	}
function openWinSr(url,width,height,pname) {
	var argv = openWinSr.arguments;
	var argc = openWinSr.arguments.length;
	var scl=(argc>4)?"yes":"no";
	var str,top,left;
	top = parseInt(screen.height/3 - height/2);
	left = parseInt(screen.width/3 - width/2);
	if(top<0) top=0;
	if(left<0) left=0;
	str="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scl+",resizable=yes,copyhistory=no,";
	str=str+"width="+width+",height="+height;
	str=str+",top="+top;
	str=str+",left="+left;
	var st = window.open(url,pname,str);
	st.resizeTo(width,(height+30))
	st.focus();
	}
function openWinStop(url,width,height,pname){
	var argv = openWinStop.arguments;
	var argc = openWinStop.arguments.length;
	var scl=(argc>4)?"yes":"no";
	str="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scl+",resizable=yes,copyhistory=no,";
	str=str+"width="+width+",height="+height;
	str=str+",top=0,left=0";
	var st = window.open(url,pname,str);
	st.focus();
}
function readdoc(st){
	var width=780,height=570;
	var str,top,left;
	top = parseInt(screen.height/3 - height/2);
	if(top<0) top=0;
	left = parseInt(screen.width/3 - width/2);
	str="toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,";
	str=str+"width="+width+",height="+height;
	str=str+",top="+top;
	str=str+",left="+left;
	var st = window.open(st,"readDocSrc",str);
	st.focus();
	}

function PicPrevWin(st){
	var str,top,left, width, height;
	width=200;
	height=200;
	top = parseInt((screen.availHeight / 3) - (height / 2));
	left = parseInt((screen.availWidth / 3) - (width / 2));
	str="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,";
	str=str+"width=" + width + ",height=" + height;
	str=str+",top=" + top;
	str=str+",left="+left;
	ff = window.open(config_home_root_url + "usr/imgview.php?p="+st,"Flist_image_view_win",str);
	ff.focus();
}
function checkemail(st){
	if(st=="") return true;
	var email=/^([A-Za-z0-9_\.\-]{1,15})(@{1})([A-Za-z0-9_\-]{1,15})(.{1})([A-Za-z0-9_\-]{2,10})(.{1}[A-Za-z]{2,10})?(.{1}[A-Za-z\-]{2,10})?$/;
	if (!email.test(st))
	{
		alert("eMail Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.\n\nÀÔ·ÂÇÏÁö ¾ÊÀ»°æ¿ì »èÁ¦ ÇÏ½Ê½Ã¿À");
		return false;
	}
	return true;
}
function checkTelNum(st){
	var telF = /^0[0-9]{1,2}[\-\) ]{0,1}[0-9]{3,4}[\- ]{0,1}[0-9]{4}$/;
	if(st=="") return true
	if(!telF.test(st)){
		alert("ÀüÈ­¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.\n\n033)1234-5678 ÇüÅÂ·Î ÀÔ·ÂÇÏ½Ê½Ã¿À\n\nÀÔ·ÂÇÏÁö ¾ÊÀ»°æ¿ì »èÁ¦ ÇÏ½Ê½Ã¿À");
		return false;
	}
	return true;
}
function chkresno(resno) {
	if(resno=="") return true;
	var fmt = /^\d{6}-[1234]\d{6}$/;
	if (!fmt.test(resno)) {
		alert("ÁÖ¹Îµî·Ï ¹øÈ£ Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.\n\n¼ýÀÚ6ÀÚ¸®-¼ýÀÚ7ÀÚ¸®");
		return false;
	}
	var buf = new Array(13);
	for (i = 0; i < 6; i++) buf[i] = parseInt(resno.charAt(i));
	for (i = 6; i < 13; i++) buf[i] = parseInt(resno.charAt(i + 1));
	multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
	for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);
	if ((11 - (sum % 11)) % 10 != buf[12]) {
		alert("¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï ¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
	return true;
}
function go(st){
	location.href = st;
}
function getByte(message){
	var nbytes = 0;
	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
		nbytes += 4;
		} else {
		nbytes += 1;
		}
	}
	return nbytes;
}
function trim(strSource) { 
	re = /^ +| +$/g; 
	return strSource.replace(re, ''); 
} 

/*==========================================================================================
		ÄíÅ° À¯Æ¿¸®Æ¼
------------------------------------------------------------------------------------------*/
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) {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
      ((expires == null) ? "" : 
         ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
} 

