function autoMove(f1,f2,len) {
		
 if (f1.value.length >= len) {
	 f2.focus(); 
 }
}
function Alt_Close()
{
	alert("eeee");
	//window.close();
}

function OpenZipcode(ROOT){
	window.open(ROOT+"/post.php?form=form&zip1=zip1&zip2=zip2&address1=address1","ZipWin","width=400,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}
function OpenZipcode2(ROOT){
	window.open(ROOT+"/post2.php?form=form&zip1=zip1&zip2=zip2&address1=address1","ZipWin","width=500,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}

function ConfirmReset(f,fvalue)
{
   var reset_ok = confirm("Ã³À½ºÎÅÍ ´Ù½Ã ÀÛ¼ºÇÏ½Ã°Ú½À´Ï±î?");
   if (reset_ok == true) {
       f.reset();
	   fvalue.focus();
   }
}

function Confirm_OK(Msg, Move)
{
   var Msg, Move
   var confirm_ok = confirm(Msg);
   if (confirm_ok == true) {
       location.href=Move;
	}
}
function Confirm_OK2(Msg, obj)
{
   var Msg
   var confirm_ok = confirm(Msg);
   if (confirm_ok == true) {
       obj.submit();
	}
}
function OpenWindow_NO(name, move, left, top, width, height) {
	window.open(move, name, 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,left='+left+',top='+top+',width='+width+',height='+height);
}

function Alert_Move(Msg, Move) 
{
	var Msg, Move;
	alert(Msg);
	location.href = Move;
}

function Alert_Opener_Move(Msg, Move){
	var Msg, Move
	alert(Msg);
	opener.location.href = Move;
	opener.focus();

}

function VideoPlayer(videoview, dir)
{
	var dir;
	var url = dir + "/video/video_player.php?" + videoview;
	if(videoview.length > 0) window.open(url, 'player_video_window', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,left=5,top=5,width=365,height=540');
}
/*bb*/
function VideoPlayer1(videoview, dir)
{
	var dir;
	var url = dir + "/video/video_player1.php?" + videoview;
	if(videoview.length > 0) window.open(url, 'player_video_window', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,left=5,top=5,width=365,height=495');
}
/*bb*/

/*function PowerPlayer(query, dir)
{
	var dir;
	var url = dir + "/power/power_player.php?" + query;
	if(query.length > 0) window.open(url, 'player_bible_window', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,left=70,top=70,width=320,height=134');
}*/

function PowerPlayer(query, dir)
{
	var dir;
	if(query.length > 0) window.open(dir + '/power/power.php?' + query,'player_bible_window','toolbar=no,scrollbars=no,status=no,resizable=no,directories=no,menubar=no,width=302,height=133'); 
}

function PowerPlayer2(query, dir)
{
	var dir;
	var url = dir + "/power/power.php?" + query;
	if(query.length > 0) window.open(url, 'player_bible_window', 'location=no,toolbar=no,scrollbars=no,status=no,resizable=no,directories=no,menubar=no,left=70,top=70,width=423,height=111');
}
function ERV_Player(query, dir)
{
	var dir;
	var url = dir + "/erv/erv_player.php?" + query;
	if(query.length > 0) window.open(url, 'erv_player_window', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,menubar=no,left=500,top=170,width=300,height=50');
}

function PowerOnAir(query, dir)
{
	var dir;
	var url = dir + "/power/power.php?" + query;
	var movedir = dir + "/power/power_content_view.php?item=body";

	if(query.length > 0) window.open(url, 'player_bible_window', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,left=70,top=70,width=320,height=134');

	parent.BCCbody.location.replace(movedir);
}

function MP3Down(kind, dir)
{
	var path;
	var url = dir + "/power/power_open_down.php?" + kind;
	if(kind.length > 0) location.href = url;
}

function ERV_MP3Down(kind, dir)
{
	var path;
	var url = dir + "/erv/erv_open_down.php?" + kind;
	if(kind.length > 0) location.href = url;
}

function Library_Down(kind, dir)
{
	var path;
	var url = dir + "/library/file_download.php?" + kind;
	if(kind.length > 0) location.href = url;
}

function TXT_Down(kind, dir)
{
	var url=dir+"/study_member/txt_down.php?"+kind;
	if(kind.length>0) location.href=url;
}

function Excel_Save(kind, dir)
{
	var path;
	var url = dir + "/study_member/sm_finishnum_excel.php?" + kind;
	if(kind.length > 0) location.href = url;
}

function MemberInfo(ROOT, Item, Cont)
{ 
	window.open(ROOT+'/conf/member_info_popup.php?try=view&item='+Item+'&cont='+Cont, 'member_info', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,width=390,height=340');
}

function maxLengthCheck(f,len) 
{
	if (f.value.length > len ) {
		alert ("¸Þ¼¼Áö ÀÔ·ÂÀº "+len+"ÀÚ ÀÌ³» ÀÔ´Ï´Ù!!   ");
		f.focus();
	}
 return;
}

function CheckAll(f) 
{
   for (var i=0;i<f.elements.length;i++) {
      if (f.allbox.checked == true) {
          f.allbox.checked = true;
          f.elements[i].checked = true;
      }
      else {
          f.allbox.checked = false;
          f.elements[i].checked = false;
      }
   }
}

function Alert_WinClose(Msg) {
  alert (Msg);
  window.close();
}

function Notice_Preview(no, width, height) {
	var url = "preview.php?no="+no;
	window.open(url,'_editor_tb','staus=no, width='+width+', height='+height+',scrollbars=no,toolbar=no,menubar=no');
}

function Banner_Play (videoview, movedir) {

   var url = "./video/video_player.php?" + videoview;

   if(videoview.length > 0) {
	   window.open(url, 'player_video_window', 'toolbar=no,scrollbars=no,directories=no,status=no,menubar=no,resizable=no,left=5,top=5,width=365,height=495');
	   parent.BCCbody.location.replace(movedir);
   }
}

function move_opener_common(url) {
    opener.location.href = url;
	self.close();
	opener.focus();
}

function openWindow(anchor, options) {

	var args = '';

	if (typeof(options) == 'undefined') { var options = new Object(); }
	if (typeof(options.name) == 'undefined') { options.name = 'win' + Math.round(Math.random()*100000); }

	if (typeof(options.height) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "height=" + options.height + ",";
	}

	if (typeof(options.width) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		args += "width=" + options.width + ",";
	}

	if (typeof(options.fullscreen) != 'undefined') {
		args += "width=" + screen.availWidth + ",";
		args += "height=" + screen.availHeight + ",";
	}

	if (typeof(options.center) == 'undefined') {
		options.x = 0;
		options.y = 0;
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.center) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
		options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2)-(screen.height-screen.availHeight);
		options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth);
		args += "screenx=" + options.x + ",";
		args += "screeny=" + options.y + ",";
		args += "left=" + options.x + ",";
		args += "top=" + options.y + ",";
	}

	if (typeof(options.scrollbars) != 'undefined') { args += "scrollbars=1,"; }
	if (typeof(options.menubar) != 'undefined') { args += "menubar=1,"; }
	if (typeof(options.locationbar) != 'undefined') { args += "location=1,"; }
	if (typeof(options.resizable) != 'undefined') { args += "resizable=1,"; }

	var win = window.open(anchor, options.name, args);
	return false;

}
function gor(argSel,argRes)
{
	formSel=eval("document.unity_reg."+argSel);
	j=formSel.length;
	for(var i=0;i<document.unity_reg.a.length;i++)
	{
		if(document.unity_reg.a.options[i].selected && document.unity_reg.a.options[i].value)
		{
			document.unity_reg.a.options[i].selected=false;
			chk_same=0;
			for(var k=0;k<formSel.length;k++)
			{
				if(document.unity_reg.a.options[i].value==formSel.options[k].value)
				{
				chk_same=1;                                
				}        
			}                        
			if(!chk_same)
			{
				formSel.options[j]=new Option(document.unity_reg.a.options[i].text,document.unity_reg.a.options[i].value);
				j++;
			}
		}
	}
	get_result(argSel,argRes)
}

function gol(argSel,argRes)
{
	formSel=eval("document.unity_reg."+argSel);
	buff=new Array();
	j=0;
	for(var i=formSel.length-1;i>=0;i--)
	{
		if(formSel.options[i].selected && formSel.options[i].value)
		{
			formSel.options[i] = null;
		}
	}
	get_result(argSel,argRes);
}

function get_result(argSel,argRes)
{
	formSel=eval("document.unity_reg."+argSel);
	formRes=eval("document.unity_reg."+argRes);
	res=new Array();
	for(var i=0;i<formSel.length;i++)
	{
		res[i]=formSel.options[i].value;
	}
	res=res.join("||");
	formRes.value=res;
}

function gou(argSel,argRes)
{
	formSel = eval("document.unity_reg."+argSel);
	if(!formSel.value)
	{
		return;
	}
	thisIndex = formSel.selectedIndex;
	if(!thisIndex)
	{
		return;
	}
	formSel.value=null;
	prevIndex=thisIndex-1;
	tempText=formSel.options[prevIndex].text;
	tempValue=formSel.options[prevIndex].value;
	formSel.options[prevIndex] = new Option(formSel.options[thisIndex].text,formSel.options[thisIndex].value);
	formSel.options[thisIndex] = new Option(tempText,tempValue);
	formSel.value=formSel.options[prevIndex].value;
	get_result(argSel,argRes);
}

function god(argSel,argRes)
{
	formSel = eval("document.unity_reg."+argSel);
	if(!formSel.value)
	{
		return;
	}
	thisIndex = formSel.selectedIndex;
	if(thisIndex+1>=formSel.length)
	{
		return;
	}
	formSel.value=null;
	prevIndex=thisIndex+1;
	tempText=formSel.options[prevIndex].text;
	tempValue=formSel.options[prevIndex].value;
	formSel.options[prevIndex] = new Option(formSel.options[thisIndex].text,formSel.options[thisIndex].value);
	formSel.options[thisIndex] = new Option(tempText,tempValue);
	formSel.value=formSel.options[prevIndex].value;
	get_result(argSel,argRes);
}

function doNothing(){}
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus
var boodschap = '';
function dgstatus()
{
window.status = boodschap;
timerID= setTimeout("dgstatus()", 30);
}
dgstatus();
// À©µµ¿ì ¸®»çÀÌÁî ½ºÅ©¸³Æ® ½ÃÀÛ
function resizeWin(maxX,maxY,speed,delay,win){
	this.obj = "resizeWin" + (resizeWin.count++);
	eval(this.obj + "=this");
	if (!win) this.win = self; else this.win = eval(win);
	if (!maxX) this.maxX = 400; else this.maxX = maxX;
	if (!maxY) this.maxY = 300; else this.maxY = maxY;
	if (!speed) this.speed = 1/2; else this.speed = 1/speed;
	if (!delay) this.delay = 0; else this.delay = delay;
	this.doResize = (document.all || document.getElementById);
	this.stayCentered = false;

	this.initWin = function(){
		if (this.doResize){
			this.resizeMe();
		}else {
			this.win.resizeTo(this.maxX + 10, this.maxY - 20);
		}
	}

	this.resizeMe = function(){
		this.win.focus();
		this.updateMe();
	}

	this.resizeTo = function(x,y){
		this.maxX = x;
		this.maxY = y;
		this.resizeMe();
	}

	this.stayCentered = function(){
		this.stayCentered = true;
	}

	this.updateMe = function(){
		this.resizing = true;
		var x = Math.ceil((this.maxX - this.getX()) * this.speed);
		var y = Math.ceil((this.maxY - this.getY()) * this.speed);
		if (x == 0 && this.getX() != this.maxX) {
			if (this.getX() > this.maxX) x = -1;
			else x = 1;
		}
		if (y == 0 && this.getY() != this.maxY){
			if (this.getY() > this.maxY) y = -1;
			else y = 1;
		}
		if (x == 0 && y == 0) {
			this.resizing = false;
		} else {
			this.win.top.resizeBy(parseInt(x),parseInt(y));
			if (this.stayCentered == true) this.win.moveTo((screen.width - this.getX()) / 2,(screen.height - this.getY()) / 2);
			setTimeout(this.obj + '.updateMe()',this.delay)
		}
	}

	this.write = function(text){
		if (document.all && this.win.document.all["coords"]) this.win.document.all["coords"].innerHTML = text;
		else if (document.getElementById && this.win.document.getElementById("coords")) this.win.document.getElementById("coords").innerHTML = text;
	}

	this.getX = function(){
		if (document.all) return (this.win.top.document.body.clientWidth + 10)
		else if (document.getElementById)
		return this.win.top.outerWidth;
		else return this.win.top.outerWidth - 12;
	}

	this.getY = function(){
		if (document.all) return (this.win.top.document.body.clientHeight + 29)
		else if (document.getElementById)
		return this.win.top.outerHeight;
		else return this.win.top.outerHeight - 31; 
	}

	this.onResize = function(){
		if (this.doResize){
			if (!this.resizing) this.resizeMe();
		}
	}
	return this;
}
resizeWin.count = 0;
// À©µµ¿ì ¸®»çÀÌÁî ½ºÅ©¸³Æ® ³¡