
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function body_print(){
	window.open('/comm/inc/print_page.asp', 'print', 'width=730, height=700, top=0, left=0, status=no, resize=no, scrollbars=yes');
}	
	
function checkChr(code){
    	if(((code<48) || (code > 57)) && code != 8){
    		if ((code < 37 || code > 40) && code != 46)
    			if ((code < 96) || (code > 105))
        				event.returnValue = false;
    	}
}
function BadNameCheck(v){
	var checkname = new Array("¿î¿µÀÚ","ÃÖÀçÃµ","°ü¸®ÀÚ","admin");
	var i
	for (i=0;i<checkname.length;i++)
		if (v == checkname[i]) return false;
	return true;
}

/* 1´Ü¸Þ´º ÇÃ·¡½Ã ³×ºñ°ÔÀÌ¼Ç ÁÖ¼Ò*/
function m_menu(menuName){
	if(menuName=="menu_01"){
		location.href="/blog/blog_view.asp";
	}
	if(menuName=="menu_02"){
		location.href="/board/board_list.asp?B_KIND=4";
	}
	if(menuName=="menu_03"){
		location.href="/board/board_list.asp?B_KIND=0";
	}
	if(menuName=="menu_04"){
		location.href="/board/board_list.asp?B_KIND=2";
	}
	if(menuName=="menu_05"){
		location.href="/support/support_01.asp";
	}
}

function hu(menuName){
	if(menuName=="hu"){
		location.href="/support/support_01.asp";
	}
}

/*2´Ü¸Þ´º ÇÃ·¡½Ã ³×ºñ°ÔÀÌ¼Ç ÁÖ¼Ò*/
//ÃÖÀçÃµ 
function sub_1(menuName){
	if(menuName=="menu_1_1"){
		location.href="/main_1.asp";
	}else if(menuName=="menu_1"){
		location.href="/profile/profile.asp";
	}else if(menuName=="menu_2"){
		location.href="/board/photo_list.asp?B_KIND=11";
	}else if(menuName=="menu_3"){
		location.href="/board/board_list.asp?B_KIND=24";
	}else if(menuName=="menu_4"){
		location.href="/board/board_list.asp?b_kind=22";
	}
}

//Áö±Ý ÃÖÀçÃµÀº
function sub_2(menuName){
	if(menuName=="menu_1"){
		location.href="/board/board_diary.asp";
	}else if(menuName=="menu_1_1"){
		location.href="/blog/blog_view.asp";
	}else if(menuName=="menu_2"){
		location.href="/blog/blog_view.asp";
	}else if(menuName=="menu_3"){
		location.href="/board/board_list.asp?B_KIND=0&INPUTCATE=11";
	}else if(menuName=="menu_4"){
		location.href="/board/photo_list.asp?B_KIND=5";
	}else if(menuName=="menu_5"){
		location.href="/board/photo_list.asp?B_KIND=6&SCHFIELD=CATE&INPUTCATE=";
	}else if(menuName=="menu_6"){
		location.href="/ca/ca.asp";
	}else if(menuName=="menu_7"){
		location.href="/board/board_list.asp?B_KIND=0&INPUTCATE=9";
	}
}

//¼ºµ¿ÀÎ ÃÖÀçÃµ
function sub_3(menuName){
	if(menuName=="menu_1_1"){
		location.href="/main_2.asp";
	}else if(menuName=="menu_1"){
		location.href="/person/person17.asp";
	}else if(menuName=="menu_2"){
		location.href="/person/person18.asp";
	}else if(menuName=="menu_3"){
		location.href="/board/board_list.asp?B_KIND=2";
	}else if(menuName=="menu_4"){
		location.href="/person/forum.asp";
	}
}

//ÃÖÀçÃµ°ú ¸»ÇÏ´Ù
function sub_4(menuName){
	if(menuName=="menu_1"){
		location.href="/board/board_list.asp?B_KIND=4";
	}else if(menuName=="menu_2"){
		location.href="/board/board_list.asp?B_KIND=20";
	}else if(menuName=="menu_3"){
		location.href="/board/board_list.asp?B_KIND=9";
	}
}

//ÀÇÁ¤È°µ¿
function sub_5(menuName){
	if(menuName=="menu_1"){
		location.href="/board/board_list.asp?B_KIND=17";
	}else if(menuName=="menu_2"){
		location.href="/board/photo_list.asp?B_KIND=13";
	}else if(menuName=="menu_3"){
		location.href="/board/board_list.asp?B_KIND=23";
	}else if(menuName=="menu_4"){
		location.href="/report/report_2006_1.asp";
	}else if(menuName=="menu_5"){
		location.href="/board/board_list.asp?B_KIND=16";
	}else if(menuName=="menu_6"){
		location.href="/board/board_list.asp?B_KIND=19";
	}
}

//ÈÄ¿øÇÏ±â
function sub_6(menuName){
	if(menuName=="menu_1_1"){
		location.href="/support/support.asp";
	}else if(menuName=="menu_1"){
		location.href="/support/support_02.asp";
	}else if(menuName=="menu_2"){
		location.href="/support/support_04.asp";
	}else if(menuName=="menu_3"){
		location.href="/support/support_05.asp";
	}else if(menuName=="menu_4"){
		location.href="/board/board_list.asp?B_KIND=9";
	}else if(menuName=="menu_5"){
		location.href="/support/support_01.asp";
	}
}


//¹Ù·Î°¡±â

function sub_go(menuName){
	if(menuName=="menu_1"){
		location.href="/blog/blog_view.asp";
	}else if(menuName=="menu_2"){
		location.href="#";
	}else if(menuName=="menu_3"){
		location.href="#";
	}
}


//Win Media Player
function showPlayer(){
	var mediaPlayer;

	mediaPlayer = "<object id='MPlayer' name='MPlayer' width=320 height=280  classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>";
	mediaPlayer = mediaPlayer + "<param name='ANIMATIONATSTART' value=0>";
	mediaPlayer = mediaPlayer + "<param name='AUTOSTART' value=1>";
	mediaPlayer = mediaPlayer + "<param name='BALANCE' value='0'>";
	mediaPlayer = mediaPlayer + "<param name='CURRENTMARKER' value='0'>";
	mediaPlayer = mediaPlayer + "<param name='CURRENTPOSITION' value='0'>"; 
	mediaPlayer = mediaPlayer + "<param name='DISPLAYMODE' value='4'>";
	mediaPlayer = mediaPlayer + "<param name='ENABLECONTEXTMENU' value='0'>";
	mediaPlayer = mediaPlayer + "<param name='ENABLED' value='1'>";
	mediaPlayer = mediaPlayer + "<param name='FULLSCREEN' value='0'>";
	mediaPlayer = mediaPlayer + "<param name='INVOKEURLS' value='1'>";
	mediaPlayer = mediaPlayer + "<param name='PLAYCOUNT' value='1'> ";
	mediaPlayer = mediaPlayer + "<param name='RATE' value='1'>";
	mediaPlayer = mediaPlayer + "<param name='SHOWCONTROLS' value='1'>";
	mediaPlayer = mediaPlayer + "<param name='SHOWSTATUSBAR' value='-1'>";
	mediaPlayer = mediaPlayer + "<param name='STRETCHTOFIT' value='0'>";
	mediaPlayer = mediaPlayer + "<param name='TRANSPARENTATSTART' value='1'>";
	mediaPlayer = mediaPlayer + "<param name='UIMODE' value='FULL'>";
	mediaPlayer = mediaPlayer + "<param name='displaybackcolor' value='0'>";
	mediaPlayer = mediaPlayer + "</object>";
	
	document.write (mediaPlayer);
}

//ÇÃ·¡½Ã 
function playflash(File, width, height){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='" + width + "' height='"+ height +"'>");
 	document.write("<param name='movie' value='" + File + "'>");
 	document.write("<param name='quality' value='high'>");
 	document.write("<param name='wmode' value='transparent'> ");
 	document.write("<embed src='" + File + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='"+ height +"'></embed> ");
 	document.write("</object>");
}

function subflash(File,width,height,n,m){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='" + width + "' height='"+ height +"'>");
 	document.write("<param name='movie' value='" + File + "?pageNum="+ n +"&sub="+ m +"'>");
 	document.write("<param name='quality' value='high'>");
 	document.write("<param name='wmode' value='transparent'> ");
 	document.write("<embed src='" + File + "?pageNum="+ n +"&sub="+ m +"'' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='"+ height +"'></embed> ");
 	document.write("</object>");
}

function pop_login(){
	window.open('/member/pop_login.asp','login_pop','left=0,top=0,width=320,height=189');
}
	
function pop_hu(sno){
	window.open('/support/pop_hu.asp?SNO='+sno, 'ÈÄ¿ø³»¿ªÁ¶È¸', 'left=0,top=0,width=646,height=377');
}
	
	
/* ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© */
function Jumin_chk(it) {
	IDtot = 0;
	IDAdd = "234567892345";
	for(i=0; i<12; i++) IDtot = IDtot + parseInt(it.substring(i, i+1)) * parseInt(IDAdd.substring(i, i+1));
	IDtot = 11 - (IDtot%11);
	if (IDtot == 10) IDtot = 0;
	else if (IDtot == 11) IDtot = 1;
	if(parseInt(it.substring(12, 13)) != IDtot) return true;
	else return false
} 

/* ¾ÆÀÌµð Áßº¹ Ã¼Å© */
function id_check(fmvalue){
	window.open('/member/join_id_check.asp?M_ID='+fmvalue,'ID_CHECK','width=352,height=210,scrollbars=0,resizable=0,status=0');
	return;
}

/* ´Ð³×ÀÓ Ã¼Å© */
function nick_check(fm,fmvalue){
    	window.open('/member/join_nick_check.asp?M_NICKNAME='+fmvalue,'NICK_CHECK','width=365,height=240,scrollbars=0,resizable=0,status=0');
}

/* ¿ìÆí¹øÈ£ Ã£±â */
function post_check(){
    	window.open('/member/post_check.asp','POST1_SEARCH','width=352,height=260,scrollbars=0,status=0,resizable=0');
}

function NumberCheck(v){
	for(var i=0;i <v.length;i++){
		var c = v.charAt(i);
		if((c < '0' || c > '9')){
			return false;
		}
	}
	return true
}

function mail_change(ch){
	var form = document.member;

	if(ch.value == "etc"){
		form.mmaildomain.readOnly = false;
		form.mmaildomain.value = "";
		form.mmaildomain.focus();
	}
	else{
		form.mmaildomain.readOnly = true;
		form.mmaildomain.value = ch.value;
	}
}

/* °ø¹éÁ¦°Å ½ºÅ©¸³Æ® */
function trim(str){
    	return ltrim(rtrim(str));
}

function ltrim(str){
	var s = new String(str);
    	
    	if (s.substr(0,1) == " " || s.substr(0,1) == "¡¡"){
    		return ltrim(s.substr(1));
    	}
    	else{return s;}
}

function rtrim(str){
	var s = new String(str);
	
	if(s.substr(s.length-1,1) == " " || s.substr(s.length-1,1) == "¡¡"){
		return rtrim(s.substring(0, s.length-1));
	}
	else{return s;}
}

var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;
ie = document.all ? true : false	
function zoomBox(evt,zlink,maxw,maxh){
	if (arguments.length > 2){
		zNew=1;
	}
	tox = evt.x;
	toy = evt.y;
	scrollH = (window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
	maxW = maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
	maxH = maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
	toX = tox?tox:0;
	toY = (toy?toy:0)+scrollH;
	fromX = evt.pageX?evt.pageX:evt.clientX;
	fromY = (evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
	adjX = toX+evt.screenX-fromX;
	adjY = toY+evt.screenY-fromY;
	
	if (document.createElement && document.body.appendChild && !zBox){
		zBox=document.createElement("div");
		zBox.style.position = "absolute";
		document.body.appendChild(zBox);
	}
	else if (document.all && !zBox) {
		document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
		zBox=document.all.zBoxDiv;
	}
	else if (document.layers && !zBox){
		zBox = new Layer(maxW);
		zBox.style=zBox;
	}
	
	zLink = zlink;
	doZoom();
}	
	
function doZoom() {
	zStep+=1;
	zPct=(10-zStep)/10
	if (document.layers){
		zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
		zBox.document.open();
		zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
		zBox.document.close();
	}
	else {
		zBox.style.border = "1px solid #FFFFFF"; // Å×µÎ¸® ±½±âpx solid Å×µÎ¸® »ö 
		zBox.style.left = toX+zPct*(fromX-toX);
		zBox.style.top = toY+zPct*(fromY-toY);
		zBox.style.width = maxW*(1-zPct);
		zBox.style.height = maxH*(1-zPct);
	}

	zBox.style.visibility = "visible";
	
	if (zStep < 10){
		setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",20);
	}
	else{
		zBox.style.visibility='hidden';
		zStep=0;
		if (zLink && !zNew){
			location.href=zLink.href;
		}
		else if (zLink && zNew){	 // À©µµ ÀÌ¸§ ÁÖ½Ã¸é 1°³¹Û¿¡ »ç¿ëÇÏÁú ¸øÇÕ´Ï´Ù. »õÃ¢¿¡ ½ºÅ©·Ñ¹Ù¸¦ ³ÖÀ¸·Á¸é scrollbars=yes ·Î..
			var w=window.open(zLink,'','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY+',scrollbars=no');
			zNew=null;
		}
	}
}

/*  ·¹ÀÌ¾î¿¡ ÇÁ·¹ÀÓÀ» ³Ö¾î º¸¿©ÁÖ±â */	
var frameStep,frameBox;
function div_show_frame(x,y,page,w,h,titlebg,btoption) {
	var tabel;
	if (btoption == "" || btoption == undefined) btoption = false;
	if (btoption == false)
		table = '<table width="100%" height="100%" border=0 cellspacing=0><tr><td align="right" height="5%" bgcolor='+titlebg+'><a href="javascript:div_hidden_frame();">´Ý±â</a></td></tr><tr><td height="95%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';
	else
		table = '<table width="100%" height="100%" border=0 cellspacing=0><tr><td height="100%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';

	if (document.createElement && document.body.appendChild && !frameBox){
		frameBox=document.createElement("div");
		frameBox.style.position = "absolute";
		frameBox.innerHTML = table;
		document.body.appendChild(frameBox);
	}
	else if (document.all && !frameBox) {
		document.all[document.all.length-1].outerHTML+='<div id="frameBoxDiv" style="position:absolute">'+ table +'</div>';
		frameBox=document.all.frameBoxDiv;
	}
	else if (document.layers && !frameBox){
		frameBox = new Layer(w);
		frameBox.style=frameBox;
	}
	frameStep = 0;
	show_atcion_frame(x,y,page,w,h,titlebg,btoption);
}
	
function show_atcion_frame(x,y,page,w,h,titlebg,btoption){
	frameStep+=1;
	zPct=(10-frameStep)/10
	if (btoption == false)
		table = '<table width='+w*(1-zPct)+' height='+h*(1-zPct)+' border=0 cellspacing=0><tr><td align="right" height="5%" bgcolor='+titlebg+'><a href="javascript:div_hidden_frame();">´Ý±â</a></td></tr><tr><td height="95%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';
	else
		table = '<table width='+w*(1-zPct)+' height='+h*(1-zPct)+' border=0 cellspacing=0><tr><td height="100%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';
	if (document.layers){
		frameBox.moveTo(x,y);
		frameBox.document.open();
		frameBox.document.write(table);
		frameBox.document.close();
	}
	else {
		frameBox.style.border = "1px solid #000000"; // Å×µÎ¸® ±½±âpx solid Å×µÎ¸® »ö 
		frameBox.style.left = x;
		frameBox.style.top = y;
		frameBox.style.width = w*(1-zPct);
		frameBox.style.height = h*(1-zPct);
	}
	if (frameStep < 10){
		setTimeout("show_atcion_frame("+x+","+y+",'"+page+"',"+w+","+h+","+btoption+")",20);
	}else{
		DIV_frame.location.href = page;
	}
	frameBox.style.visibility = "visible";
}
	
function div_hidden_frame(){
	frameBox.style.visibility = "hidden";
	DIV_frame.location.href = "/bg.html";
	frameBox = undefined;
}	

var thisImgIndex = 1;	
// ÀÌ¹ÌÁö »çÀÌÁî ÃøÁ¤
function Imagesize(Obj,_width,_height, iname){
	var img = new Image();
	img.src = Obj.value;
	
	if (img.height != _height || img.width != _width){
		alert(iname +" ÀÌ¹ÌÁöÀÇ Å©±â´Â "+ _width +" ¡¿ "+ _height +" ÀÌ¿©¾ß ÇÕ´Ï´Ù. \n\n ÇöÀç ÀÌ¹ÌÁö Å©±â´Â "+ img.width +" ¡¿ "+ img.height +" ÀÔ´Ï´Ù.");
		Obj.focus();
		return false;
	}
	
	return true;
}
function imgReSize(obj,w,h){
	var this_w, this_h;
	var img = new Image();
	img.src = obj.src
	var this_w = img.width;
	var this_h = img.height;
	if (this_w > this_h){
		if (w < this_w)	obj.width = w
		if (h < this_h)	obj.height =w * (this_h / this_w);
	}else{
		if (w < this_w) obj.height = h
		if (h < this_h) obj.width =h * (this_w / this_h); 
	}
}
function getImageWidth(Obj){
	var img = new Image();
	img.src = Obj.value
	return img.width;
}

function getImageHeight(Obj){
	var img = new Image();
	img.src = Obj.value
	return img.height;
}

/** ÀÌ¹ÌÁö °æ·Î¸¦ ¹Þ¾Æ¼­ ÇöÀçÀ§Ä¡¿¡ º¸¿©Áø´Ù */
function getImage(temp,w,h) {
	var selectedRange = document.selection.createRange();
	selectedRange.pasteHTML("<img src=" + temp + " border=0 width=" + w + " height=" + h + " style=cursor:hand><br>");
}

/* ¼¿·ºÆ®¹Ú½º ÀÌ¹ÌÁö »èÁ¦ */
function Board_Select2(selectedIndex){
	selectedOptIndex = selectedIndex;
	document.writeForm.img_list[selectedIndex].selected = true;
}

/*±Û»óÀÚ¾ÈÀÇ Ã·ºÎ ÀÌ¹ÌÁö »èÁ¦ */
function img_del2() {
	if ( (document.writeForm.img_list.selectedIndex == -1) || (document.writeForm.img_list.options[document.writeForm.img_list.selectedIndex].value == -1) ){
		alert("ÀÌ¹ÌÁö¸¦ ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		return;
	}
	
	var img_op = document.writeForm.img_list.selectedIndex;
	var img_op1 = document.writeForm.img_list.options[img_op].value;
	document.writeForm.img_list.remove(document.writeForm.img_list.selectedIndex);
	i_frame.document.location.href = "/comm/inc/img_del.asp?seq=" + img_op1;
}	

function select_del2(fSize){
   	var lenlist = document.writeForm.img_list.length;

	document.writeForm.img_size.value = parseInt(document.writeForm.img_size.value) - parseInt(fSize);
	
	for (var i=lenlist-1; i>=0; i--) {
		if (document.writeForm.img_list[i].selected == true) {
			document.writeForm.img_list[i] = null;
		}
	}
}

function UploadStart(This_Form,theUniqueID){
	strAppVersion = navigator.appVersion;
	
	if (strAppVersion.indexOf('MSIE')!=-1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) {
	          winstyle = "dialogWidth=480px; dialogHeight:140px; center:yes";
	          window.showModelessDialog("/Comm/inc/progressbar.asp?nav=ie&ID=" + theUniqueID, "probarwindow", winstyle);
	} 
	else {
		winpos = "left=" + ((window.screen.width-380)/2)+",top=" + ((window.screen.height-110)/2);
	         winstyle = "width=480,height=110,status=no,toolbar=no,menubar=no," + "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos;
		window.open("/Comm/inc/progressbar.asp?ID=" + theUniqueID ,"probarwindow",winstyle);
	}
	
	This_Form.action = This_Form.action +"?progressid="+theUniqueID;
}

/*------------------------------ »èÁ¦·¹ÀÌ¾î -----------------------------*/
function MM_findObj(n, d) {     //v4.0
  	var p,i,x;  
  	
  	if(!d) {d=document;} 
  	
  	if((p=n.indexOf("?"))>0&&parent.frames.length) {
    		d=parent.frames[n.substring()(p+1)].document; 
    		n=n.substring()(0,p);
    	}
  	
  	if(!(x=d[n])&&d.all) {x=d.all[n];} 
  	
  	for (i=0;!x&&i<d.forms.length;i++) {x=d.forms[i][n];}
  	
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) {x=MM_findObj(n,d.layers[i].document);}
  	
  	if(!x && document.getElementById) {x=document.getElementById(n);} 
  	
  	return x;
}

function Layers_open() { //v3.0
  	var i,p,v,obj,args = Layers_open.arguments;
  	
  	for(i=0; i<(args.length-2); i+=3){
   		if((obj=MM_findObj(args[i]))!=null){ 
			v=args[i+2];
  			if(obj.style){obj=obj.style; v=(v=='show')?'visible':v;}
			obj.visibility=v; 
   		}
   	}
}

function Layers_close() { //v3.0
  	var i,p,v,obj,args = Layers_close.arguments;
  	
  	for(i=0; i<(args.length-2); i+=3){
   		if((obj=MM_findObj(args[i]))!=null){ 
   			v=args[i+2];
      			if(obj.style){
      				obj=obj.style; 
      				v=(v=='hide')?'hidden':v;
      			}
   			obj.visibility=v; 
   		}
   	}
}

function Layers_Del(a,b,c,e) {     //v3.0
    	document.all[a].style.pixelLeft = document.body.scrollLeft + e.x - 300;
    	document.all[a].style.pixelTop = document.body.scrollTop + e.y - 100;

  	var i,p,v,obj,args = Layers_Del.arguments;
  	
  	for(i=0; i<(args.length-2); i+=3){
   		if((obj=MM_findObj(args[i]))!=null){ 
   			v=args[i+2];
      			if(obj.style){
      				obj=obj.style; 
      				v=(v=='show')?'visible':v;
      			}
   			obj.visibility=v; 
   		}
   	}
   	document.localDel.B_PWD.focus();
}

function Layers_Del2(a,b,c,e) {     //v3.0
    	document.all[a].style.pixelLeft = document.body.scrollLeft + e.x + 10;
    	document.all[a].style.pixelTop = document.body.scrollTop + e.y - 100;

  	var i,p,v,obj,args = Layers_Del2.arguments;
  	
  	for(i=0; i<(args.length-2); i+=3){
   		if((obj=MM_findObj(args[i]))!=null){
			v=args[i+2];
  			if(obj.style){obj=obj.style; v=(v=='show')?'visible':v;}
			obj.visibility=v;    			 
   		}
   	}
   	
   	document.addDel.A_ANUMBER.value = b;
   	document.addDel.A_PWD.focus();
}

function Layers_Del3(a,b,c,e) {     //v3.0
    	document.all[a].style.pixelLeft = document.body.scrollLeft + e.x + 10;
    	document.all[a].style.pixelTop = document.body.scrollTop + e.y - 100;

  	var i,p,v,obj,args = Layers_Del3.arguments;
  	
  	for(i=0; i<(args.length-2); i+=3){
   		if((obj=MM_findObj(args[i]))!=null){
			v=args[i+2];
  			if(obj.style){obj=obj.style; v=(v=='show')?'visible':v;}
			obj.visibility=v;    			 
   		}
   	}
   	
   	document.localDel.B_BNUMBER.value = b;
   	document.localDel.B_PWD.focus();
}

/*  ÀÌ¹ÌÁö º¸¿©ÁÖ´Â ·¹ÀÌ¾î */				
var ImgStep,ImgBox;
function div_show_img(x,y,Imgsrc,w,h) {
	if (document.createElement && document.body.appendChild && !ImgBox){
		ImgBox=document.createElement("div");
		ImgBox.style.position = "absolute";
		ImgBox.innerHTML = '<IMG SRC="" ID="DIV_IMG" WIDTH="0" height="0" onclick="javascript:div_hidden_img();">';
		document.body.appendChild(ImgBox);
	}
	else if (document.all && !ImgBox) {
		document.all[document.all.length-1].outerHTML+='<div id="ImgBoxDiv" style="position:absolute"><IMG SRC="" ID="DIV_IMG" WIDTH="0" height="0" onclick="javascript:div_hidden_img();"></div>';
		ImgBox=document.all.ImgBoxDiv;
	}
	else if (document.layers && !ImgBox){
		ImgBox = new Layer(w);
		ImgBox.style=ImgBox;
	}
	ImgStep = 0;
	show_atcion(x,y,Imgsrc,w,h);
}
	
function show_atcion(x,y,Imgsrc,w,h){
	ImgStep+=1;
	zPct=(10-ImgStep)/10
	if (document.layers){
		ImgBox.moveTo(x,y);
		ImgBox.document.open();
//			ImgBox.document.write("<table width='"+w*(1-zPct)+"' height="+h+" border=2 cellspacing=0><tr><td><IMG SRC='' ID='DIV_IMG' WIDTH=0 height=0 onclick='javascript:div_hidden_img();'></td></tr></table>");
		ImgBox.document.write("<table width='"+w*(1-zPct)+"' height="+h*(1-zPct)+" border=2 cellspacing=0><tr><td><IMG SRC='' ID='DIV_IMG' WIDTH=0 height=0 onclick='javascript:div_hidden_img();'></td></tr></table>");
		ImgBox.document.close();
	}
	else {
		ImgBox.style.border = "1px solid #000000"; // Å×µÎ¸® ±½±âpx solid Å×µÎ¸® »ö 
		ImgBox.style.left = x;
		ImgBox.style.top = y;
		ImgBox.style.width = w*(1-zPct);
		ImgBox.style.height = h*(1-zPct);
	}
	ImgBox.style.visibility = "visible";
	DIV_IMG.src = Imgsrc;
	DIV_IMG.width = w*(1-zPct);
	DIV_IMG.height = h * (1-zPct);

	if (ImgStep < 10){
		setTimeout("show_atcion("+x+","+y+",'"+Imgsrc+"',"+w+","+h+")",20);
	}
}
	
function div_hidden_img(){
	ImgBox.style.visibility = "hidden";
}
	
/*  ·¹ÀÌ¾î¿¡ ÇÁ·¹ÀÓÀº ³Ö¾î º¸¿©ÁÖ±â */	
var frameStep,frameBox;
function div_show_frame(x,y,page,w,h,titlebg,btoption) {
	var tabel;
	if (btoption == "" || btoption == undefined) btoption = false;
	if (btoption == false)
		table = '<table width="100%" height="100%" border=0 cellspacing=0><tr><td align="right" height="5%" bgcolor='+titlebg+'><a href="javascript:div_hidden_frame();">´Ý±â</a></td></tr><tr><td height="95%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';
	else
		table = '<table width="100%" height="100%" border=0 cellspacing=0><tr><td height="100%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';

	if (document.createElement && document.body.appendChild && !frameBox){
		frameBox=document.createElement("div");
		frameBox.style.position = "absolute";
		frameBox.innerHTML = table;
		document.body.appendChild(frameBox);
	}
	else if (document.all && !frameBox) {
		document.all[document.all.length-1].outerHTML+='<div id="frameBoxDiv" style="position:absolute">'+ table +'</div>';
		frameBox=document.all.frameBoxDiv;
	}
	else if (document.layers && !frameBox){
		frameBox = new Layer(w);
		frameBox.style=frameBox;
	}
	frameStep = 0;
	show_atcion_frame(x,y,page,w,h,titlebg,btoption);
}
	
function show_atcion_frame(x,y,page,w,h,titlebg,btoption){
	frameStep+=1;
	zPct=(10-frameStep)/10
	if (btoption == false)
		table = '<table width='+w*(1-zPct)+' height='+h*(1-zPct)+' border=0 cellspacing=0><tr><td align="right" height="5%" bgcolor='+titlebg+'><a href="javascript:div_hidden_frame();">´Ý±â</a></td></tr><tr><td height="95%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';
	else
		table = '<table width='+w*(1-zPct)+' height='+h*(1-zPct)+' border=0 cellspacing=0><tr><td height="100%"><iframe name="DIV_frame" src="" width="100%" height="100%" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe></td></tr></table>';
	if (document.layers){
		frameBox.moveTo(x,y);
		frameBox.document.open();
		frameBox.document.write(table);
		frameBox.document.close();
	}
	else {
		frameBox.style.border = "1px solid #000000"; // Å×µÎ¸® ±½±âpx solid Å×µÎ¸® »ö 
		frameBox.style.left = x;
		frameBox.style.top = y;
		frameBox.style.width = w*(1-zPct);
		frameBox.style.height = h*(1-zPct);
	}
	if (frameStep < 10){
		setTimeout("show_atcion_frame("+x+","+y+",'"+page+"',"+w+","+h+","+btoption+")",20);
	}else{
		DIV_frame.location.href = page;
	}
	frameBox.style.visibility = "visible";
}
	
function div_hidden_frame(){
	frameBox.style.visibility = "hidden";
	DIV_frame.location.href = "/bg.html";
	frameBox = undefined;
}

var SubWindow;
var CreatWindow = false;
function ShowProgressbar(){
	SubWindow = window.open("/comm/inc/InsertProgressbar.asp","INSERT", "top=50,left=50,width=500,height=150");
}

//--------------- UMS °ü·Ã -------------------//
 function GroupSH(flag){
//	showModalDialog("Group_Choice.asp",window,"dialogWidth:500px; dialogHeight:380px;dialogTop: 10px; dialogLeft: 300px; center=yes; screenTop=yes; scroll=no; status=no; help=no;"); 	
	window.open("Group_Choice.asp?flag=" + flag, "GROUPCHOICE", "top=50,left=50,width=500,height=350");
}
	
function _totalcnt(){
	TOTAL.innerHTML = document.forms[0].sendlist.length;
}

function memberSH(flag){
	window.open("Member_Choice.asp?flag=" + flag, "MEMBERSH", "top=50,left=50,width=600,height=450");
}

function _excel(){
	window.open("excel_form.asp","EXCEL", "top=50,left=50,width=500,height=150");
}

function emoticon(){
	showModalDialog("emoticon_frm.asp",window,"dialogWidth:550px; dialogHeight:625px;dialogTop: 10px; dialogLeft: 300px; center=yes; screenTop=yes; scroll=no; status=no; help=no;"); 	
		
//	window.open("emoticon_frm.asp","GROUPCHOICE", "top=50,left=50,width=550,height=625");
}

function SendType(kind){
	var frm = document.UMS;	
	if (kind == 0){
		frm.SYEAR.disabled = true;
		frm.SMONTH.disabled = true;
		frm.SDAY.disabled = true;
		frm.SHOUR.disabled = true;
		frm.SLIMT.disabled = true;
	}
	else{
		frm.SYEAR.disabled = false;
		frm.SMONTH.disabled = false;
		frm.SDAY.disabled = false;
		frm.SHOUR.disabled = false;
		frm.SLIMT.disabled = false;
	}
}

//////////////////////////////////////////////////////////////////////////////////////
var longMsgStatus		= false;
var hangulStatus		= false;

function msgByteLength(Obj){
	var str,msg;
	var len = 0;
	var temp;
	var count = 0;

	msg = Obj.value;
	str = new String(msg);
	len = str.length;

	for (k=0 ; k<len ; k++){
		temp = str.charAt(k);

		if (escape(temp).length > 4) {
			count += 2;
		}
		else if (temp == '\r' && str.charAt(k+1) == '\n') {
			count += 2;
		}
		else if (temp != '\n') {
			count++;
		}
	}

	return count;
}

function fc_chk_byte(aro_name,ari_max){
	var count	= msgByteLength(aro_name);
	if(count > ari_max) {
		aro_name.blur();
		aro_name.focus();		
//		alert("¸Þ½ÃÁö ³»¿ëÀº 80¹ÙÀÌÆ®±îÁö¸¸ Àü¼ÛÀÌ °¡´ÉÇÕ´Ï´Ù."); 
		CutChar(aro_name,ari_max);
		return ;
	}
	
	if (aro_name.name == "SMSMSG"){
		SMS.innerHTML = count;		
	}
	else{
		TTS.innerHTML = count;
		document.UMS.TTSMSGLENGTH.value = count;
	}	
}

/* ÁöÁ¤µÈ ¹ÙÀÌÆ®°¡ ÃÊ°ú°æ¿ì ¹®ÀÚ¸¦ »èÁ¦ÇÑ´Ù. */

function CutChar(Obj,ari_max) {
	var str,msg;
	var len=0;
	var temp;
	var count;
	count = 0;
 
	msg = Obj.value;
	str = new String(msg);
	len = str.length;

	for(k=0 ; k<len ; k++) {
		temp = str.charAt(k);

		if(escape(temp).length > 4) {
			count += 2;
		}
		else if(temp == '\r' && str.charAt(k+1) == '\n') { 
			count += 2;
		}		
		else if(temp != '\n') {
			count++;
		}

		if(count > ari_max) {
			str = str.substring(0,k);
			break;
		}
	}
	
	Obj.value = str;
}
function CutChar2(Obj,ari_max) {
	var str,msg;
	var len=0;
	var temp,temp_str;
	var count;
	count = 0;
 	temp_str = "";
	msg = Obj.value;
	str = new String(msg);
	len = str.length;

	for(k=0 ; k<len ; k++) {
		temp = str.charAt(k);

		if(escape(temp).length > 4) {
			count += 2;
		}
		else if(temp == '\r' && str.charAt(k+1) == '\n') { 
			count += 2;
		}		
		else if(temp != '\n') {
			count++;
		}
		
		if(count > ari_max)	break;
		
		temp_str += temp;
	}
	
	return temp_str;
}
function delCode(p_idx){
	if (p_idx > -1){
		with(document.forms[0]){
			newItem = document.createElement("OPTION");

			newItem.text = sendlist.options[p_idx].text;
			newItem.value = sendlist.options[p_idx].value;

			sendlist.options.remove(p_idx);
		}
		_totalcnt();
	}
	else{	
		alert("Á¤È®È÷ ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}
}

function checkemail(Obj){
	var testresults;
	var str = Obj;
	var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	
	if (filter.test(str)){testresults = true;}
	else{testresults=false;}
	
	return (testresults);
}
		
function addItem(){	
	var frm = document.forms[0];							
	var parentObj = frm.sendlist;
	var	exist = true;
	newItem = document.createElement("OPTION");
	if (frm.addname.value == "¼º¸í" || frm.addnumber.value =="ÀÌ¸ÞÀÏÁÖ¼Ò"){
		alert("¼º¸í°ú ÀÌ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return;
	}
	if (frm.addname.value == "" || frm.addnumber.value ==""){
		alert("¼º¸í°ú ÀÌ¸ÞÀÏÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return;
	}		
	if (!checkemail(frm.addnumber.value)){
		alert("¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return;
	}		
	for (var i=0;i < parentObj.length;i++)
		if (frm.addname.value +":"+frm.addnumber.value == parentObj[i].value) exist = false;
		
	if (exist){
		SelectOptionInput(parentObj, frm.addnumber.value, frm.addname.value +"("+frm.addnumber.value+")");
	}
	
	frm.addname.value = "¼º¸í";
	frm.addnumber.value = "ÀüÈ­¹øÈ£";
	_totalcnt();
}

function SelectOptionInput(Obj,value,text){
	var cnt = Obj.length;
	var ck = true;
	for (i=0;i < Obj.length;i++){
		if (value == Obj[i].value) ck = false;
	}
	if (ck){
		Obj.length = cnt+1;
		Obj[cnt].text = text;	
		Obj[cnt].value = value;
	}
}

function AddItem(){	
	var frm = document.UMS;							
	var parentObj = frm.sendlist;
	var	exist = true;
	newItem = document.createElement("OPTION");
	if (frm.addname.value == "¼º¸í" || frm.addnumber.value =="ÀüÈ­¹øÈ£"){
		alert("¼º¸í°ú ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return;
	}
	if (frm.addname.value == "" || frm.addnumber.value ==""){
		alert("¼º¸í°ú ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return;
	}		
	if (frm.addnumber.value.substring(0,2) != "01"){
		alert("ÇÚµåÆù ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
		return;
	}		
	for (i=0;i < parentObj.length;i++)
		if (frm.addname.value +":"+frm.addnumber.value == parentObj[i].value) exist = false;
		
	if (exist){
		SelectOptionInput(parentObj,frm.addname.value +":"+frm.addnumber.value,frm.addname.value +"("+frm.addnumber.value+")");
	}
	frm.addname.value = "¼º¸í";
	frm.addnumber.value = "ÀüÈ­¹øÈ£";
	_totalcnt();
}
	
function allDel(){
	document.forms[0].sendlist.length = 0;
	_totalcnt();
}

function ItemPush(InObj,OutObj){
	var cnt = InObj.length;
	var outcnt = OutObj.length;
	for (i=0;i<OutObj.length;i++){
		if (OutObj[i].selected == true){
			cnt++;
			InObj.length = cnt;
			InObj[cnt-1].text = OutObj[i].text;
			InObj[cnt-1].value = OutObj[i].value

		}
	}
	for (i=0;i<outcnt;i++){
		if (OutObj[i].selected == true){
			OutObj.remove(i);
			i--;
			outcnt--;
		}
	}
}		

var nowZoom = 100;

function ZoomIn(Chk){
	if(Chk == 'In'){
		if (nowZoom < 150)
			nowZoom += 10;
		else
			alert("´õ ÀÌ»ó È®´ë´Â ¾ÈµË´Ï´Ù.  ")
	}else{
		if (nowZoom > 100)
			nowZoom -= 10;
		else
			alert("´õ ÀÌ»ó Ãà¼Ò´Â ¾ÈµË´Ï´Ù.  ")
	}

	document.body.style.zoom = nowZoom + "%";
}


// ºÒ°¡´ÉÇÑ ³»¿ëÀÏ °æ¿ì return true, °¡´É return false - °Ô½ÃÆÇ ´ñ±Û¿¡ »ç¿ë
function chkContent(STR){		
	var filter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; // ÇÊÅÍ¹®ÀÚ
	var EngCnt=0; // ³»¿ëÁß¿¡ ÇÊÅÍ¿¡ °ÉÄ£ ¹®ÀÚ °¹¼ö
	var MaxCnt=100; // ÇÊÅÍ ¹®ÀÚ ÃÖ´ë ÇÑ°èÄ¡
	for(str_i=0; str_i<STR.length; str_i++){
	  if(filter.indexOf(STR.substr(str_i,1))>-1 ) EngCnt++;
	  if(EngCnt>=MaxCnt)	return true;
	}
	return false;
}


// ÆË¾÷ ÀÌ¹ÌÁö »õÃ¢ ¶ç¿ì±â
 function imgPopUp( imgUrl ){
  // ÀÌ¹ÌÁö °´Ã¼ »ý¼º
  var image = new Image();
  image.src = imgUrl;
  // ÀÌ¹ÌÁö Å©±â overFlow
  var isBigImg = image.width > 1024?true:false;
  // È­¸é Áß¾Ó¿¡ À§Ä¡
  var screenWidth  = screen.width;
  var screenHeight = screen.height;

  var scrollBar = isBigImg?",scrollbars=yes":""; 
  var width = isBigImg?1024:image.width;
  var height = isBigImg?(900*(image.height/image.width)):image.height;
  
  var screenX = ( screenWidth  - width  ) / 2;   
  var screenY = ( screenHeight - height ) / 2;    
  var imgWin = window.open("","imgPopUp","width="+width+",height="+height+",left="+screenX+",top="+screenY+",toolbar=no,menubar=no,status=no"+scrollBar)
  imgWin.document.write ("<body topmargin=0 leftmargin=0>");
  imgWin.document.write ("<img src='" +imgUrl+ "' alt='¸¶¿ì½º Å¬¸¯ÇÏ¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.' style='cursor:hand' onclick='window.close()'>");
  imgWin.document.write ("</body>");
  imgWin.focus();
 }

// 0,1,2,3,4,5,6,7,8,9 (¼ýÀÚ¸¸ ÀÔ·Â¹ÞÀ» °æ¿ì)
function onlyNumber()
{
    event.returnValue=false;
    if (event.keyCode == 8) event.returnValue=true;             // ¹é½ºÆäÀÌ½ºÀÏ °æ¿ì Çã°¡
    
    if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue=true;
}

// 0,1,2,3,4,5,6,7,8,9 - (¼ýÀÚ¸¸ ÀÔ·Â¹ÞÀ» °æ¿ì)
function onlyPhoneNumber()
{
    event.returnValue=false;
    if (event.keyCode == 8) event.returnValue=true;             // ¹é½ºÆäÀÌ½ºÀÏ °æ¿ì Çã°¡
    if (event.keyCode == 45) event.returnValue=true;             // -ÀÏ °æ¿ì Çã°¡
    
    if(event.keyCode >= 48 && event.keyCode <= 57) event.returnValue=true;
}

// ½ºÆäÀÌ½º »ç¿ëºÒ°¡
function disableSpace()
{
    event.returnValue=false;
    if (event.keyCode != 32) event.returnValue=true;         
}

// == Å°º¸µå ´­·ÈÀ»¶§ Enter Ã¼Å©
function isEnter(){
    if (event.keyCode == 13)
        return true;
 else
  return false;
}
 