//ͽڵ̵
function focus_move(s_fm,e_fm,len)
{
	if(s_fm.value.length>=len) e_fm.focus();
}


//Űüũ
function getCookie(name) {

	var found = false;
	var start,end;

	for(i = 0; i <= document.cookie.length; i++)
	{
		start = i;
		end = start + name.length;
		if(document.cookie.substring(start,end) ==name)
		{
			found = true;
			break;
		}
	}

	if(found == true)
	{
		start = end + 1;
		end = document.cookie.indexOf(';',start);

		if(end < start)
			end = document.cookie.length;
		return document.cookie.substring(start,end);
	}
	return '';
}

function pop_show()
{

	//̽ǽ//
	if(!getCookie('Not_pop1'))
	{
		window.open('pop/pop.html','Banner_1','left=0,top=0,width=400,height=430');
	}

	//ä//
	//if(!getCookie('Not_pop4'))
	//{
		//window.open('pop/pop4.html','Banner_4','left=400,top=0,width=371,height=385');
	//}

	// ȳ//
	//if(!getCookie('Not_pop5'))
	//{
	//	window.open('pop/pop5.html','Banner_5','left=840,top=0,width=400,height=430');
	//}

	//̻ Ѹ //
	//if(!getCookie('Not_pop2'))
	//{
	//	window.open('pop/pop1.html','Banner_12','left=0,top=0,width=400,height=350');
	//}

	//ä//
	//if(!getCookie('Not_pop3'))
	//{
	//	window.open('pop/recruit_201010.html','Banner_13','left=808,top=0,width=371,height=385');
	//}

	//Ŀ//
	if(!getCookie('Not_pop3'))
	{
		window.open('pop/pop3.html','Banner_3','left=400,top=0,width=400,height=281');
	}

}

function com_number_check(com_number)
{
	//ڸȮ
	if(com_number.length==10)
	{
		//ü ʱⰪ
		var sum = 0;

		//ȣ  迭
		var com_num_ary =new Array(10);
		//üũ ڵ
		var com_code=new Array("1","3","7","1","3","7","1","3","5");

		// ϱؼ ȣ 迭ȭ
		for (rof=0;rof<10;rof++)
			com_num_ary[rof] = com_number.substring(rof,rof+1);

		// ڵ尪 (  :  ڵ带 Ѱ Ѵ ڴ ܵ)
		for (rof=0;rof<9;rof++)
			sum += com_num_ary[rof]*com_code[rof];

		//  ι°  
		sum = sum +parseInt((com_num_ary[8]*5)/10) ;

		//
		sum_ps = sum%10;
		com_chk = 0;

		//ڿ 񱳸   
		if ( sum_ps != 0 )
			com_chk = 10 - sum_ps;
		else
			com_chk = 0;

		//޽ 
		if ( com_chk != com_num_ary[9] )
			return 1;
		else
			return 0;
	}
	else
		return 2;
}

//θâ ̵ âݱ
function close_location(url)
{
	opener.location.href=url;
	self.close();
}


//̵˻â
function id_find_window(fm)
{
	if(fm.m_id.value=="")
	{
		alert("̵ Էϼ");
	}
	else if (fm.m_id.value.length<5)
	{
		alert("̵ 4ڸ̻Դϴ.");
	}
	else if (check_text_code(fm.m_id.value))
	{
		alert("̵ ѱ Ҽ ϴ.");
	}
	else
	{
		window.open('id_check.html?check_id='+fm.m_id.value,'id_window','width=400,height=150');
	}
}


//ּâ
function juso_find_window(fm)
{
	window.open('juso.html?post='+fm.m_post1.value+"-"+fm.m_post2.value,'juso_window','width=440,height=200');
}

///ּԷ
function set_addr(pos_num,add_num)
{
	opener.member_form.m_post1.value=pos_num.substr(0,3);
	opener.member_form.m_post2.value=pos_num.substr(4,3);
	opener.member_form.m_add1.value=add_num;
	self.close();
}


function check_text_code(str)
{
	check_code=0;
	for(rof=0;rof<str.length;rof++)
	{
		if(str.charCodeAt(rof)>255)	check_code=1;
	}
	if(check_code==0)
		return 0;
	else
		return 1;
}

function byte_check(fm)
{
	text_data="";
	data=fm.b_title.value;
	tot_text_len=0;
	for(rof=0;rof<data.length;rof++)
	{
		if(data.charCodeAt(rof)>255)	tot_text_len++;
		tot_text_len++;

		if(tot_text_len>50)
		{
			alert("80Byte ̻ϺҰմϴ.");
			fm.b_title.value=text_data;
			tot_text_len=tot_text_len-1;
			if(data.charCodeAt(rof)>255)	tot_text_len--;
			break;
		}
		text_data+=data.charAt(rof);
	}
	sign_size.innerHTML=tot_text_len;
}

//Ϲ ڸ  ǥ
function number_money(ibox,p_key)
{
	box_data=ibox.value;
	if(p_key<48||p_key>57)
	{
		ibox.value=box_data;
		return false;
	}
	else
	{
		key_data=String.fromCharCode(p_key);
		box_data=box_data+key_data;

		ibox.value=number_seting(box_data);
		return false;
	}
}
//ڸ 
function number_format(ibox,p_key)
{
	box_data=ibox.value;
	if(p_key<48||p_key>57)
	{
		ibox.value=box_data;
		return false;
	}
	else
	{
		key_data=String.fromCharCode(p_key);
		box_data=box_data+key_data;
		ibox.value=box_data;
		return false;
	}
}

function jumin_check(jumin)
{
	pos_num=0;
	chk_num=0;
	for(rof=2;rof<10;rof++)
	{
		chk_num=chk_num+(jumin.substr(pos_num,1)*rof);
		pos_num++;
	}
	for(rof=2;rof<6;rof++)
	{
		chk_num=chk_num+(jumin.substr(pos_num,1)*rof);
		pos_num++;
	}
	chkis=11-(chk_num%11);
	if(chkis>9)	chkis-=10;

	if(chkis==jumin.substr(12,1))
		return 1;
	else
		return 0;
}

function homepage_use_check(fm)
{
	if(fm.m_homepage_use.checked==true)
	{
		fm.m_homepage.value="";
		home_page_show_box[0].style.display='none';
		home_page_show_box[1].style.display='none';
	}
	else
	{
		home_page_show_box[0].style.display='';
		home_page_show_box[1].style.display='';
	}
}
// 
function check_consulting_phone(fm,num)
{
	if(num==1)
	{
		show_phone_box[0].style.display='';
		show_phone_box[1].style.display='none';
	}
	else if(num==2)
	{
		show_phone_box[0].style.display='none';
		show_phone_box[1].style.display='';
	}
	else
	{
		show_phone_box[0].style.display='';
		show_phone_box[1].style.display='';
	}
}

// ݾڵ
function money_shows(fm)
{
	dc_money_ary=Array(0,5,10,15);
	num=fm.b_marketing[fm.b_marketing.selectedIndex].value;

	if(num==2)
	{
		banner_money=fm.set_money[1].value;
		money_set_data=number_seting(banner_money);
		money_show_box.innerHTML=money_set_data;

		dc_money=eval(dc_money_ary[fm.b_dates.selectedIndex]);
		org_money=eval(banner_money)*eval(fm.b_dates[fm.b_dates.selectedIndex].value);

		dc_money_string=(dc_money*org_money)/100;

		money_show_box_dc.innerHTML=dc_money_ary[fm.b_dates.selectedIndex]+" %";
		dc_money_set=org_money-dc_money_string;
		money_show_box_dc_money.innerHTML=number_seting(dc_money_set.toString());
	}
	else
	{
		banner_money=fm.set_money[0].value;
		money_set_data=number_seting(banner_money);
		money_show_box.innerHTML=money_set_data;

		dc_money=eval(dc_money_ary[fm.b_dates.selectedIndex]);
		org_money=eval(banner_money)*eval(fm.b_dates[fm.b_dates.selectedIndex].value);

		dc_money_string=(dc_money*org_money)/100;

		money_show_box_dc.innerHTML=dc_money_ary[fm.b_dates.selectedIndex]+" %";
		dc_money_set=org_money-dc_money_string;
		money_show_box_dc_money.innerHTML=number_seting(dc_money_set.toString());
	}
}

// ݾڵ
function money_shows_banner(fm)
{
	dc_money_ary=Array(0,5,10,15);
	banner_money=fm.set_money.value;
	money_set_data=number_seting(banner_money);
	money_show_box.innerHTML=money_set_data;

	dc_money=eval(dc_money_ary[fm.b_dates.selectedIndex]);
	org_money=eval(banner_money)*eval(fm.b_dates[fm.b_dates.selectedIndex].value);

	dc_money_string=(dc_money*org_money)/100;

	money_show_box_dc.innerHTML=dc_money_ary[fm.b_dates.selectedIndex]+" %";
	dc_money_set=org_money-dc_money_string;
	money_show_box_dc_money.innerHTML=number_seting(dc_money_set.toString());
}

//ü üŬ
function check_shop_number(fm,num)
{
	if(fm.shop_data_chk.length)
	{
		if(fm.shop_data_chk[num].value==1)
		{
			fm.shop_data_img[num].src='/images/checkbox.gif';
			fm.shop_data_chk[num].value=0;
		}
		else
		{
			fm.shop_data_img[num].src='/images/checkbox_ok.gif';
			fm.shop_data_chk[num].value=1;
		}
	}
	else
	{
		if(fm.shop_data_chk.value==1)
		{
			fm.shop_data_img.src='/images/checkbox.gif';
			fm.shop_data_chk.value=0;
		}
		else
		{
			fm.shop_data_img.src='/images/checkbox_ok.gif';
			fm.shop_data_chk.value=1;
		}
	}
}

//ü
function check_shop_all_check(fm)
{
	if(fm.shop_data_chk)
	{
		all_count=fm.shop_data_chk.length;
		if(all_count)
		{
			for(rof=0;rof<all_count;rof++)
			{
				fm.shop_data_img[rof].src='/images/checkbox_ok.gif';
				fm.shop_data_chk[rof].value=1;
			}
		}
		else
		{
			fm.shop_data_img.src='/images/checkbox_ok.gif';
			fm.shop_data_chk.value=1;
		}
	}
	else
	{
		alert("˻ ü ϴ.");
	}
}

//ü 
function check_shop_re_check(fm)
{
	if(fm.shop_data_chk)
	{
		all_count=fm.shop_data_chk.length;
		if(all_count)
		{
			for(rof=0;rof<all_count;rof++)
			{
				fm.shop_data_img[rof].src='/images/checkbox.gif';
				fm.shop_data_chk[rof].value=0;
			}
		}
		else
		{
			fm.shop_data_img.src='/images/checkbox.gif';
			fm.shop_data_chk.value=0;
		}
	}
	else
	{
		alert("˻ ü ϴ.");
	}
}

//йȣ Էâ
function password_change_window()
{
	window.open('passwd_change.html','password_window','width=300,height=200');
}


//Ʈüũ(κ)
function byte_check_write_box(fm)
{
	text_data="";
	data=fm.sms_text.value;
	tot_text_len=0;
	for(rof=0;rof<data.length;rof++)
	{
		if(data.charCodeAt(rof)>255)	tot_text_len++;
		tot_text_len++;

		if(tot_text_len>80)
		{
			alert("80Byte ̻ϺҰմϴ.");
			fm.sms_text.value=text_data;
			tot_text_len=tot_text_len-1;
			if(data.charCodeAt(rof)>255)	tot_text_len--;
			break;
		}
		text_data+=data.charAt(rof);
	}
}

//Ʈüũ(κ)
function byte_check(fm)
{
	text_data="";
	data=fm.b_title.value;
	tot_text_len=0;
	for(rof=0;rof<data.length;rof++)
	{
		if(data.charCodeAt(rof)>255)	tot_text_len++;
		tot_text_len++;

		if(tot_text_len>80)
		{
			alert("80Byte ̻ϺҰմϴ.");
			fm.b_title.value=text_data;
			tot_text_len=tot_text_len-1;
			if(data.charCodeAt(rof)>255)	tot_text_len--;
			break;
		}
		text_data+=data.charAt(rof);
	}
	sign_size.innerHTML=tot_text_len;
}



//ڵũ
var delay_time=250;
var timer_stat=0;
var mouse_over=0;
var box_height=24
var user_mouse_over=0;
var move_up_time=4;
function auto_scroll_move(base_height)
{
	if(!user_mouse_over)
	{
		now_scroll_pos=parseInt(movie_box.style.top,10);



		if(now_scroll_pos%box_height==0&&mouse_over==0)
		{
			mouse_over=1;
			timer_stat=0;
		}

		if(mouse_over==0)	movie_box.style.top=now_scroll_pos-1;
		if(mouse_over==1)	timer_stat++;

		if(delay_time==timer_stat)
		{
			mouse_over=0;
			movie_box.style.top=now_scroll_pos-1;
		}

		if((base_height*-1)==now_scroll_pos)
		{
			movie_box.style.top=box_height-1;

			timer_stat=0;
			mouse_over=0;
		}
	}
	setTimeout("auto_scroll_move("+base_height+")",move_up_time);
}













//ڵũ
var delay_time_10=200;
var timer_stat_10=0;
var mouse_over_10=0;
var box_height_10=84;
var user_mouse_over_10=0;
var move_up_time_10=1;
function auto_scroll_move_10(base_height)
{
	if(!user_mouse_over_10)
	{
		now_scroll_pos=parseInt(movie_box_10.style.top,10);


		if(now_scroll_pos%box_height_10==0&&mouse_over_10==0)
		{
			mouse_over_10=1;
			timer_stat_10=0;
		}

		if(mouse_over_10==0)	movie_box_10.style.top=now_scroll_pos-1;
		if(mouse_over_10==1)	timer_stat_10++;

		if(delay_time_10==timer_stat_10)
		{
			mouse_over_10=0;
			movie_box_10.style.top=now_scroll_pos-1;
		}

		if((base_height*-1)==now_scroll_pos)
		{
			movie_box_10.style.top=box_height_10-1;

			timer_stat_10=0;
			mouse_over_10=0;
		}
	}
	setTimeout("auto_scroll_move_10("+base_height+")",move_up_time_10);
}










//ڸ ,  
function number_seting(numbers_text)
{
	if(numbers_text=="") return 0;
	count=1;
	set_num="";

	numbers=pro_replace(numbers_text,",","");

	numbers=eval(numbers);
	numbers=numbers.toString();

	all_len=numbers.length;
	for(rof=all_len-1;rof>-1;rof--)
	{
		set_num=numbers.substr(rof,1)+set_num;
//		if(count%3==0&&rof!=0) set_num=","+set_num;
		count++;
	}
	return set_num;
}
// 
function pro_replace(str,org,cop)
{
	str_data="";
	if(str!="")
	{
		str_len=str.length;
		for(rof=0;rof<str_len;rof++)
		{
			if(str.substr(rof,1)==org) str_data=str_data+cop;
			else str_data=str_data+str.substr(rof,1);
		}
	}
	return str_data;
}


function login_page_now_movie()
{
	window.open("/member/login.html","_top");
}






//  /Ͻ Ȯ
var move_state=0;
//
function Move_ctl_play()
{
	moves.Play();
	mouction=0;
}
//Ͻ
function Move_ctl_pause()
{
	if(move_state==0){	moves.Pause();	move_state=1;	mouction=1;	}
	else{ moves.Play();	move_state=0;	mouction=0;	}
}
//ٽý
function Move_ctl_restart()
{
	moves.Stop();
	moves.Play();
}
//
function Move_ctl_stop()
{
	moves.Stop();
	moves.Play();
	moves.Stop();
}

function Couple_home_open(homepy_id,user_id)
{
	window.open("/mini_home/index.html?homepy_id="+homepy_id+"&user_id="+user_id, "_blank", "width=700,height=724");
}

function Wedding_card_show(num)
{
	window.open("/wedding_card.html?num="+num,"Wedding_card","width=400,height=340");
}























//Ÿ
var start_filter=14;
var end_filter=14;

var image_num=-1;
var show_style;

var show_slide;
var set_move_pos=1;

show_style=start_filter;
//̹
function chang_img(image_file_name)
{
	obj_names=document.images.image_box_obj;

	obj_names.filters.revealTrans.Transition=show_style;
	obj_names.filters.revealTrans.apply();
	obj_names.src = image_file_name;
	obj_names.filters.revealTrans.play();
}

//̹ 
function show_image_exe(sel,seting)
{
	images_count=image_list.length;
	if(sel==0)
	{
		image_num--;
		if(image_num<0)	image_num=images_count-1;
		show_style=end_filter;
	}
	else
	{
		image_num++;
		if(image_num>=images_count)	image_num=0;
		show_style=start_filter;
	}
	image_file_name_str=image_list[image_num].src;
	chang_img(image_file_name_str);

	if(seting==1)
	{
		show_slide=setTimeout("start_image_show()",5000);
	}
}
//̹εϷüũ
function loading_complute()
{
	if(document.image_list)
	{
		images_count=image_list.length;
		if(images_count)
		{
			check_loading=0;
			for(rof=0;rof<images_count;rof++)
			{
				if(image_list[rof].complete==false)	check_loading++;

				ps_data=(100*check_loading)/images_count;

				text_show.innerHTML="";
			}
			if(check_loading==0)
			{
				image_tables.style.display='';
				image_tables_loading.style.display='none';
				start_image_show();
				return false;
			}
			setTimeout("loading_complute()",1);
		}
	}
}
function start_image_show()
{
	text_show.innerHTML="";
	show_image_exe(set_move_pos,0);
	show_slide=setTimeout("start_image_show()",5000);
}
function image_show_use_move(sel)
{
	if(sel==0)
	{
		set_move_pos=0;
		clearTimeout(show_slide);
		show_image_exe(set_move_pos,1);
	}
	else
	{
		set_move_pos=1;
		clearTimeout(show_slide);
		show_image_exe(set_move_pos,1);
	}
}

function set_point_up_now(fm,jumsu)
{
	if(jumsu)
	{
		if(confirm(jumsu+'  ߰ Ͻðڽϳ?'))
			fm.submit();
		else
			fm.reset();
	}
}


function hit_date_check(fm)
{
	today = new Date();

	year=fm.date_y.value;
	month=fm.date_m.value;
	day=fm.date_d.value;

	if( month == 1 ) 	strmonth = "January" ;
	else if( month == 2 ) 	strmonth = "February" ;
	else if( month == 3 ) 	strmonth = "March" ;
	else if( month == 4 ) 	strmonth = "April" ;
	else if( month == 5 ) 	strmonth = "May" ;
	else if( month == 6 ) 	strmonth = "June" ;
	else if( month == 7 ) 	strmonth = "July" ;
	else if( month == 8 ) 	strmonth = "August" ;
	else if( month == 9 ) 	strmonth = "September" ;
	else if( month == 10 ) 	strmonth = "October" ;
	else if( month == 11 ) 	strmonth = "November" ;
	else 	strmonth = "December" ;

	mdate = strmonth + " " + day + " " + year ;

	date_org = new Date(mdate);
	date_sum= date_org.getTime() - today.getTime();
	days = Math.floor(date_sum/(1000*60*60*24));

	days=(days+1)*-1;
	date_count_first.innerHTML=days;
}

function day_date_check(fm)
{
	if(fm.date_end.value=="")	fm.date_end.value=0;

	year=fm.date_y.value;
	month=fm.date_m.value;
	day=fm.date_d.value;

	if( month == 1 ) 	strmonth = "January" ;
	else if( month == 2 ) 	strmonth = "February" ;
	else if( month == 3 ) 	strmonth = "March" ;
	else if( month == 4 ) 	strmonth = "April" ;
	else if( month == 5 ) 	strmonth = "May" ;
	else if( month == 6 ) 	strmonth = "June" ;
	else if( month == 7 ) 	strmonth = "July" ;
	else if( month == 8 ) 	strmonth = "August" ;
	else if( month == 9 ) 	strmonth = "September" ;
	else if( month == 10 ) 	strmonth = "October" ;
	else if( month == 11 ) 	strmonth = "November" ;
	else 	strmonth = "December" ;

	mdate = strmonth + " " + day + " " + year ;

	date_org = new Date(mdate);

	days=date_org.getDate() + eval(fm.date_end.value)*1;
	date_org.setDate(days);

	show_y.innerHTML=date_org.getYear();
	show_m.innerHTML=date_org.getMonth()+1;
	show_d.innerHTML=date_org.getDate();
}

function show_consulting_page(sel_num)
{
	link_urls="";
	switch(sel_num)
	{
		case "1":	link_urls="request.html";	break;
		case "2":	link_urls="request_hall.html";	break;
		case "3":	link_urls="request_trip.html";	break;
		case "4":	link_urls="request_honsu.html";	break;
		case "5":	link_urls="request_photo.html";	break;
	}
	if(link_urls)
		location.href=link_urls;
}


//ɼǹڽ ġ
var top_value=20;
var move_top_value=30;

//ɼ ڽ ڵũ
function auto_scrolling()
{
	y_pos=document.body.scrollTop+move_top_value;
	box_pos=parseInt(box_info.style.top, 10);
	if(document.body.scrollTop>top_value)
	{
		if(y_pos!=box_pos)
		{
			sc=document.body.scrollTop+move_top_value;
			up_val_step=(sc-box_pos)/10;
			up_val=up_val_step;
			if(y_pos>box_pos) up_val=up_val_step;
			box_info.style.top=box_pos+up_val;
		}
	}
	else
	{
		box_info.style.top=top_value;
	}

	setTimeout('auto_scrolling()',1);
}


















function sen_byte_check(fm)
{
	text_data="";
	data=fm.m_datas.value;
	tot_text_len=0;
	for(rof=0;rof<data.length;rof++)
	{
		if(data.charCodeAt(rof)>255)	tot_text_len++;
		tot_text_len++;

		if(tot_text_len>80)
		{
			alert("80Byte ̻ϺҰմϴ.");
			fm.m_datas.value=text_data;
			tot_text_len=tot_text_len-1;
			if(data.charCodeAt(rof)>255)	tot_text_len--;
			break;
		}
		text_data+=data.charAt(rof);
	}
	sign_size.innerHTML=tot_text_len;
}

