//Àü¿ªº¯¼ö
//var callid, s_top;

// Á¤±Ô Ç¥Çö½ÄÀ» »ç¿ëÇÏ¿© È­ÀÌÆ®½ºÆäÀÌ½º¸¦ ºó¹®ÀÚ·Î ÀüÈ¯
function trim(str) {
   str = str.replace(/^\s*/,'').replace(/\s*$/, ''); 
   return str;
}

function replace(msrc,sstr,rstr) {
	var idx,sleft,sright;
	
	msrc+="";
	sstr+="";
	rstr+="";
	
	idx=msrc.indexOf(sstr);
	
	if (idx > -1) {
		sleft = msrc.substring(0,idx) + rstr;
		sright = msrc.substring(idx+sstr.length);
		return sleft + replace(sright,sstr,rstr);
	} else {
		return msrc;
	}
}

function left(str, n){
if (n <= 0)
    return "";
else if (n > String(str).length)
    return str;
else
    return String(str).substring(0,n);
}


function right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function inputNumber(e) {
	if(e >= 48 && e <= 57)
		return true;
	else
		return false;
}

function inputPhone(e) {
	if((e >= 48 && e <= 57) || e == 41 || e == 45 || e == 126)
		return true;
	else
		return false;
}

function urlencode(str)
{
	str = escape(str);
	
	str = str.replace(/\+/g, "%2B");
	
	return str;
}

function toDateString(date) { //formatDate(date)
   var year  = date.getFullYear();
   var month = date.getMonth() + 1; // 1¿ù=0,12¿ù=11ÀÌ¹Ç·Î 1 ´õÇÔ
   var day   = date.getDate();

   if (("" + month).length == 1) { month = "0" + month; }
   if (("" + day).length   == 1) { day   = "0" + day;   }

   return ("" + year + "/" + month + "/" + day);
}

function toTimeString(date) { //formatTime(date)
   var hour  = date.getHours();
   var minute   = date.getMinutes();
   var second   = date.getSeconds();

   if (("" + hour).length  == 1) { hour  = "0" + hour;  }
   if (("" + minute).length   == 1) { minute   = "0" + minute;   }
   if (("" + second).length   == 1) { second   = "0" + second;   }

   return ("" + hour + ":" + minute + ":" + second);
}

function commonOpener(where_go,w_width,w_height,f_target,window_name)
{
	size_value = "width="+w_width+",height="+w_height+",scrollbars=no,menubar=no,toolbar=no,top=150,left=150";
	remote1 = window.open("",window_name,size_value);
	remote1.location.href = where_go;
	if(remote1.opener == null)
		remote1.opener = window;
	remote1.opener.name = f_target;
	remote1.focus();
}

function commonOpener2(where_go,w_width,w_height,w_left,w_top,f_target,window_name)
{
	size_value = "width="+w_width+",height="+w_height+",scrollbars=no,menubar=no,toolbar=no,status=yes,top="+w_top+",left="+w_left;
	remote1 = window.open("",window_name,size_value);
	remote1.location.href = where_go;
	if(remote1.opener == null)
		remote1.opener = window;
	remote1.opener.name = f_target;
	remote1.focus();
}

function commonModal(where_go,w_width,w_height,w_left,w_top,f_target,window_name)
{
	var remote1 = null;
	
	size_value = "dialogWidth:"+(w_width+10)+"px;dialogHeight:"+w_height+"px;dialogTop:"+w_top+"px;dialogLeft:"+w_left+"px;scroll:0;status:0;";
	remote1 = window.showModalDialog(where_go,window,size_value);
}

function abspos() {  // Å¬¸¯ ÀÌº¥Æ®°¡ ¹ß»ýÇÑ ¹Ù·Î ±× À§Ä¡
	this.x = event.screenX - window.screenLeft - document.body.clientLeft + document.body.scrollLeft  - event.offsetX;
	this.y = event.screenY - window.screenTop - document.body.clientTop + document.body.scrollTop  - event.offsetY;
	return this;
	this.x = event.screenX - window.screenLeft - document.body.leftMargin + document.body.scrollLeft  - event.offsetX;
	this.y = event.screenY - window.screenTop - document.body.topMargin + document.body.scrollTop  - event.offsetY;
	return this;
}

function checkLeftMenu()
{
	if(parent.s_top.leftmenu.checked)
	{
		parent.s_main.cols = "184,*";
		//parent.s_cont.workspace.width = "820";
		//parent.s_bottom.cstitle.width = "840";
	}
	else
	{
		parent.s_main.cols = "0,*";
		//parent.s_cont.workspace.width = "1004";
		//parent.s_bottom.cstitle.width = "1024";
	}
}

function __ws__(id)
{
	document.write(id.text);
	id.id = "";
}
