////////////// Link /////////////////////////
function GoLink(u)
{
	var win = '';//»õÃ¢¿­±â
	var set = '';
	var url = '';

	if(u =="pay")					url = "/member.html?view=pay";
	if(u =="pay_01")                url = "/member.html?view=pay_01";
	if(u =="pay_02")                url = "/member.html?view=pay_02";
	if(u =="pay_03")                url = "/member.html?view=pay_03";
	if(u =="pay_end")               url = "/member.html?view=pay_end";
	if(u =="pay_list")              url = "/member.html?view=pay_list";
	if(u =="reg_01")                url = "/member.html?view=reg_01";
	if(u =="reg_02")                url = "/member.html?view=reg_02";
	if(u =="reg_03")                url = "/member.html?view=reg_03";
	if(u =="my")					url = "/my.html";
	if(u =="myreport")              url = "/my.html?view=grStatDiff&act=myTotal";
	if(u =="gameregist")            url = "/my.html?view=gameregist";
	if(u =="news")					url = "/news.html";
	if(u =="help")					url = "/help.html";
	//if(u =="agreement")				url = "/help.html?view=main_agreement";
	if(u =="member")				url = "/member.html";
	if(u =="terms")					url = "/help.html?view=terms";
	if(u =="sitemap")				url = "/sitemap.html";
	if(u =="open")					url = "/news.html?view=open";
	if(u =="close")					url = "/news.html?view=close";
	if(u =="grStatRank")			url = "/grStat.html?view=grStatRank&act=trGame"; //Å¾¸Þ´º->Á¾ÇÕ¼øÀ§
	if(u =="grStatGame")			url = "/grStat.html?view=grStatGame&act=gmDate&GID=117"; //Å¾¸Þ´º->°ÔÀÓ
	if(u =="grStatGenre")			url = "/grStat.html?view=grStatGenre&act=gnGenre"; //Å¾¸Þ´º->Àå¸£
	if(u =="grStatArea")			url = "/grStat.html?view=grStatArea&act=arArea"; //Å¾¸Þ´º->Áö¿ª
	if(u =="grStatTime")			url = "/grStat.html?view=grStatTime&act=tiTime"; //Å¾¸Þ´º->½Ã°£
	if(u =="grStatComp")			url = "/grStat.html?view=grStatStock&act=cpStock"; //Å¾¸Þ´º->°ÔÀÓ»ç
	if(u =="grStatTrend")			url = "/grStat.html?view=grStatGmTrend&act=tnGender"; //Å¾¸Þ´º->¼ºÇâ


	if(u =="privacy") {
		grWin('privacy2'); 
		return;
	}

	if(u =="agreement") {
		grWin('privacy1'); 
		return;
	}


	if(u == "nospam") {//ÀÌ¸ÞÀÏ ¹«´Ü ¼öÁý °ÅºÎ
		url = "http://www.netimo.net/_template/notice/main_nospam.html";
		win = "new";
		set = "width=520, height=213, menubar=no, statusbar=no, scrollbars=no";
	}
	if(u =="login")					url = "/member.html?view=login";
	//if(u =="logout")				url = "http://www.netimo.net/Netimo_Logoff.html?Mode=Logout&PreURL=http://gamereport.netimo.net";//·Î±×¾Æ¿ô
	if(u=="logout") 				url = "http://www.netimo.net/_ssl/login/proc_logout.php?PreURL=http://gamereport.netimo.net";

	BoardAry = u.split(".");
	if(BoardAry[0] == "board") {
		if(BoardAry.length > 2){	//°Ô½Ã¹° ¸µÅ© u = 'board.°Ô½ÃÆÇ¾ÆÀÌµð.°Ô½Ã¹°no'
			url = "/board.html?Mode=read&boardid="+BoardAry[1]+"&no="+BoardAry[2];
		}else{						//°Ô½ÃÆÇ ¸µÅ© u = 'board.°Ô½ÃÆÇ¾ÆÀÌµð'
			url = "/board.html?Mode=list&boardid="+BoardAry[1];
		}
	}

	if(u =="aaa")	{
		url = "/help.html?view=main_nospam";
		win = "new";
		set = "Top=100,Left=100,Width=500,Height=590,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	}

	if(u =="mypage") {//¸¶ÀÌÆäÀÌÁö
		//url = "http://www.baroga.net/MyPage3/index.html?HostURL=gamereport&name=m_09";
		url =	"http://my.netimo.net/modules/public205/index.php";
		win = "new";
	}

	if(u =="join") {//È¸¿ø°¡ÀÔ
		url = "http://my.netimo.net/regist/?PreURL=http://gamereport.netimo.net";
		//url = "http://www.baroga.net/member/member_m.html?HostURL=gamereport";
		//win = "new";
		//set = "Top=100,Left=100,Width=688,Height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0";
	}

	if(u =="findid") {//idÃ£±â
		url = "http://www.baroga.net/Login_Find_ID.html?HostURL=gamereport";
		win = "new";
		set = "Top=100,Left=100,Width=400,Height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	}

	if(u =="infomember") {//È¸¿øÁ¤º¸¼öÁ¤
		//url = "http://www.baroga.net/MyPage3/index.html?HostURL=gamereport&&name=m_09";
		url =	"http://my.netimo.net/modules/public205/index.php";
		win = "new";
	}

	if(u =="minichart") {//idÃ£±â
		url = "/minichart.html";
		win = "new";
		set = "Top=100,Left=100,Width=500,Height=640,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	}

	if(win == "new"){
		var newWin = window.open(url,u,set);
		newWin.focus();
		return;
	} else {
		location.href=url;
	}

}

function grWin( f )
{
	if(f=="privacy2")
	{
		var URL='http://www.netimo.net/popup/privacy2.html';
		var w='750';
		var h='600';
		var scb='yes';
	}
	
	if(f=="privacy1")
	{
		var URL='http://www.netimo.net/popup/privacy1.html';
		var w='750';
		var h='600';
		var scb='yes';
	}	
	
	sx = (screen.width - w)/2;
	sy = (screen.height - h)/2 ;
	sub = window.open(URL, "gmnOpenWin" , 'toolbar=no,status=no,menubar=no,copyhistory=yes,scrollbars='+scb+',resizable=no,status=no,width='+w+',height='+h+',top='+sy+',left='+sx);	
	
}


// 3ÀÚ¸®¼ö ÄÞ¸¶ ³Ö´Â ÇÔ¼ö
function addCommas( strValue ){
	var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
	while(objRegExp.test(strValue)) {
		strValue = strValue.replace(objRegExp, '$1,$2');
	}
	return strValue;
}

////////////// ÄíÆù ¸µÅ© /////////////////////////
function CouponLink()
{
	var msg = "°ÔÀÓ¸®Æ÷Æ® ÀÌ¿ë±ÇÀ» ±¸¸ÅÇÏ½ÅÈÄ ¸¶ÀÌ°ÔÀÓ µî·ÏÀ» ÇÏ¼Å¾ß ¿­¶÷ °¡´ÉÇÏ½Ê´Ï´Ù.\n\n ÀÌ¿ë±Ç ±¸¸Å => ¸¶ÀÌ¸®Æ÷Æ® => ¸¶ÀÌ°ÔÀÓ µî·Ï \n\nÀÌ¿ë±ÇÀ» ±¸¸Å ÇÏ½Ã°Ú½À´Ï±î?";

	if(confirm(msg) == true){
		location.href="/member.html?view=pay";
	}else return;
}

function CouponLinkNew( )
{
	var msg = "°ÔÀÓ¸®Æ÷Æ® ÀÌ¿ë±ÇÀ» ±¸¸ÅÇÏ½ÅÈÄ ¸¶ÀÌ°ÔÀÓ µî·ÏÀ» ÇÏ¼Å¾ß ¿­¶÷ °¡´ÉÇÏ½Ê´Ï´Ù.\n\n °ÔÀÓ¸®Æ÷Æ®(http://www.gamereport.co.kr) => ÀÌ¿ë±Ç ±¸¸Å => ¸¶ÀÌ¸®Æ÷Æ® => ¸¶ÀÌ°ÔÀÓ µî·Ï \n\nÀÌ¿ë±ÇÀ» ±¸¸Å ÇÏ½Ã°Ú½À´Ï±î?";

	if(confirm(msg) == true){
		window.open("/member.html?view=pay");
	}else return;	
}

function pwCoupon()
{
	var msg = "ÆÄ¿ö ÀÌ¿ë±ÇÀ» ±¸¸ÅÇÏ½Ã¸é ´Ù¾çÇÑ °ÔÀÓ Á¤º¸¸¦ º¸½Ç ¼ö ÀÖ½À´Ï´Ù.\n\nÀÌ¿ë±ÇÀ» ±¸¸Å ÇÏ½Ã°Ú½À´Ï±î?";

	if(confirm(msg) == true){
		location.href="/member.html?view=pay";
	}else return;
}

////////////// °Ë»ö¾î ¿¹Á¦ ³Ö±â(GSLEE) /////////////////////////
function Search_Init()
{
	var f = document.all;
	f.TserStr.value="°ÔÀÓ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä!";
	f.TserStr.style.color="#A4A4A4";
}

function clearToStr()
{
	var f = document.all;
	f.TserStr.value="";
	f.TserStr.style.color="#000000";
}

////////////// °Ë»ö(GSLEE) /////////////////////////
function SendIt( val ){

	var f = document.grForm;
	var wDate = new Date();
	var pDate = new Date( wDate.getFullYear(),wDate.getMonth(),wDate.getDate()-1 );

	var sYmd = getTimeStamp(f.start_ymd.value);
	var eYmd = getTimeStamp(f.end_ymd.value);
	var wYmd = wDate.getTime();

	if( !val ) return;

	if( sYmd  > pDate ) {
		alert("¿À´Ãº¸´Ù ÀÛ°Ô ¼±ÅÃ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù!");
		f.start_ymd.focus();
		f.start_ymd.select();
		return;
	}

	if( eYmd > pDate ) {
		alert("¿À´Ãº¸´Ù ÀÛ°Ô ¼±ÅÃ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù!");
		f.end_ymd.focus();
		f.end_ymd.select();
		return;
	}

	if(f.start_ymd.value > f.end_ymd.value) {
		alert("½ÃÀÛÀÏÀ» Á¾·áÀÏº¸´Ù ÀÛ°Ô ¼±ÅÃ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù!");
		f.start_ymd.focus();
		f.start_ymd.select();
		return;
	}
	f.act.value = val
	f.mode.value="search";
	f.submit();
}

function getTimeStamp( val ){

	var sArr = val.split("-");
	var wDate = new Date(sArr[0], sArr[1]-1, sArr[2]);

	return wDate.getTime();
}

////////////// °ÔÀÓ/Àå¸£/È¸»ç °Ë»ö(GSLEE) /////////////////////////
function Main_Search_OnClick(  ) {

	var f = document.all;
	var fs = document.all.Tserwin;
	var para;
	var rect = f.TserStr.getBoundingClientRect();

	if(f.TserStr.value=="") {
		alert("°Ë»öÇÒ °ÔÀÓ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä!");
		f.TserStr.focus();
		f.TserStr.select();
		return;
	}

	if(f.Tkind.value=="Genre")
		para = "&view=grStatGenreSub&act=gnGame";
	else if(f.Tkind.value=="Company")
		para = "&view=grStatCpSub&act=cpGmDate";
	else
		para = "&view=grStatGame&act=gmDate";

		fs.src = "/web/iframe/grMainSer.html?var=" + f.TserStr.value + "&Tkind="+ f.Tkind.value + para;

	fs.style.top = 114;
	fs.style.left = rect.left + document.body.scrollLeft-1;

	if(fs.style.visibility == 'visible')
	  fs.style.visibility = 'hidden';
	else
	  fs.style.visibility = 'visible';
}

////////////// °ÔÀÓ °Ë»ö(GSLEE) /////////////////////////
function View_Search_OnClick( act, view  ) {

	var f = document.all;
	var fs = document.all.serwin;
	var rect = f.GameSearch.getBoundingClientRect();

	var str =f.GameSearch.value;

	if(f.GameSearch.value=="") {
		alert("°Ë»öÇÒ °ÔÀÓ¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä!");
		f.GameSearch.focus();
		f.GameSearch.select();
		return;
	}

	fs.src = "/web/iframe/grEachSer.html?var=" + str + "&view=" + view + "&act=" + act;

	fs.style.top = 639;
	fs.style.left = rect.left + document.body.scrollLeft-2;

	if(fs.style.visibility == 'visible')
	  fs.style.visibility = 'hidden';
	else
	  fs.style.visibility = 'visible';
}

function View_Search_Select( ) {

	document.all.serwin.style.visibility = "hidden";
}

function f_close(f) {

	if(f ==	"serwin"){
		document.all.serwin.style.visibility = "hidden";
		document.all.serwin.src="";
	}
		document.all.Tserwin.style.visibility = "hidden";
		document.all.Tserwin.src="";
}

function DateType_change( ) {
	var f = document.grForm;
	f.coltype.disabled=false;
}

function ColtypeInActive( ) {
	var f = document.grForm;
	f.coltype.disabled=true;
}

function ColtypeActive( ) {
	var f = document.grForm;
	f.coltype.disabled=false;
}

function ColType_change( val ){
	var f	= document.grForm;
	if( val )
	{
		for(i=0; i < f.date_type.length; i++) {
			f.date_type[i].disabled=false;
		}
		f.date_type[0].checked=true;
	}
	else
	{
		f.date_type[1].disabled=true;
		f.date_type[2].disabled=true;
		f.date_type[0].checked=true;
		f.date_type[1].checked=false;
		f.date_type[2].checked=false;
	}
}

function trim(str){
	var tmp1="";
	var tmp_space="";
	var final="";

	for (i=0 ; i < str.length ; i++){
		tmp1=str.substr(i,1);
		if (tmp1==" "){
			if (final!=""){
				tmp_space=tmp_space + tmp1;
			}
		}
		else{
			if (tmp_space!=""){
				final=final+tmp_space+tmp1;
				tmp_space="";
			}
			else{
				final=final+tmp1;
			}
		}
	}
	return final;
}

///////////// ÁÖ¹Î¹øÈ£ Ã¼Å©ÇÏ´Â ÇÔ¼ö /////////////////////////
function JuminCheck(){
	var frm = document.all;
	if(!CheckJumin2(frm.jumin1,frm.jumin2,frm.jumin1.value,frm.jumin2.value)) return false;
}

function MFocus(){
	var frm = document.all;
	if(frm.jumin1.value.length==6) frm.jumin2.focus();
}

////////// JavaScript·Î ÄíÅ°»ý¼º ÇÔ¼ö name:ÄíÅ°ÀÌ¸§ value:ÄíÅ°°ª expiredays:ÄíÅ°À¯Áö½Ã°£(ÀÏ) //////////
function setCookie(name,value,expiredays){
	if(expiredays){   // ÄíÅ°À¯Áö½Ã°£(ÀÏ)ÀÌ ÀÖÀ¸¸é
		var todayDate = new Date();
		todayDate.setDate(todayDate.getDate() + expiredays);
		document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";";
		//document.write(todayDate.toGMTString());
	}else{            // ÄíÅ°À¯Áö½Ã°£(ÀÏ)ÀÌ ¾øÀ¸¸é À¯Áö½Ã°£ ¼³Á¤ÇÏÁö ¾ÊÀ½ (ÇöÀçºê¶ó¿ìÀú ³»¿¡¼­¸¸ À¯Áö)
		document.cookie = name + "=" + escape(value) + "; path=/;";
	}
}

////////// JavaScript·Î ÄíÅ°°ª ºÒ·¯¿À´Â ÇÔ¼ö name:ÄíÅ°ÀÌ¸§ //////////
function getCookie(name){
	var Found = false;
	var start, end, i;
	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 unescape(document.cookie.substring(start,end));   // JavaScript°¡ ÀÐÀ»¶§´Â unescape°¡ ÇÊ¿ä, PHP³ª ASP°¡ ÀÐÀ»¶§´Â ±×³É ÀÐÀ¸¸é µÊ
	}else{
		return "";
	}
}

////////// login submitÀÌÀüÀÇ ÇÔ¼ö //////////
function beforelogin(frm){
	if(!frm.id.value){ alert('ID(¾ÆÀÌµð)¸¦ ÀÔ·ÂÇÏ¼¼¿ä!');    frm.id.focus(); return false;}
	if(!frm.pw.value){ alert('P/W(ºñ¹Ð¹øÈ£)¸¦ ÀÔ·ÂÇÏ¼¼¿ä!'); frm.pw.focus(); return false;}
	if(frm.idmemchk.checked) {
		setCookie('mem_id',document.frm.id.value);
	}
	//document.cookie = 'previous_url=' + escape('$REQUEST_URI') + '; path=/';   // ÀÌÀü ÁÖ¼Ò¸¦ ÄíÅ°·Î ±â¾ï
}

////////// ·Î±×ÀÎ ¹öÆ°À» ´©¸¦ °æ¿ìÀÇ ÇÔ¼ö //////////
function login_onclick(){
	setCookie('previous_url',location.href);
	location = '/webmanager/weblogin.html';
}

////////// POPUPÃ¢À» ¶ç¿ì´Â ÇÔ¼ö //////////
function MM_openBrWindow(theURL,winName,features){
	window.open(theURL,winName,features);
}

////////// ·Î±×ÀÎ submitÀÌÀüÀÇ ÇÔ¼ö //////////
function BeforeSubmit_login(frm){
	//alert('·Î±×ÀÎ submitÀÌÀüÀÇ ÇÔ¼ö');
	if(frm.id){   // ¾ÆÀÌµðÀÔ·Â¶õÀÌ ÀÖÀ¸¸é ¾ÆÀÌµð Ã¼Å©
		str = frm.id.value;
		if(isNull(str)){                 alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!');                    frm.id.focus(); return false;}
		if(!isAlphaNum(str,'AlphaNum')){ alert('¾ÆÀÌµð¸¦ ¿µ¹®ÀÚ³ª ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä !!');    frm.id.focus(); return false;}
		if(!isLengthOk(str,4,20)){       alert('¾ÆÀÌµð¸¦ 4ÀÚÀÌ»ó 20ÀÚÀÌÇÏ·Î ÀÔ·ÂÇÏ¼¼¿ä !!'); frm.id.focus(); return false;}
	}
	if(frm.pw){   // ºñ¹Ð¹øÈ£ÀÔ·Â¶õÀÌ ÀÖÀ¸¸é ºñ¹Ð¹øÈ£ Ã¼Å©
		str = frm.pw.value;
		if(isNull(str)){                  alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!');                     frm.pw.focus(); return false;}
		if(!isLengthOk(str,4,20)){        alert('ºñ¹Ð¹øÈ£¸¦ 4ÀÚÀÌ»ó 20ÀÚÀÌÇÏ·Î ÀÔ·ÂÇÏ¼¼¿ä !!');  frm.pw.focus(); return false;}
	}
	//setCookie('previous_url',location.href);   // ÀÌÀü ÁÖ¼Ò¸¦ ÄíÅ°·Î ±â¾ï, ASP¿¡¼­ ÄíÅ°¸¦ ÀÌ¹Ì ¸¸µç °æ¿ì º¯°æ¾ÈµÊ
	return true;
}

////////// Null Ã¼Å© ÇÔ¼ö //////////
function isNull(str){
	if(str!=null && str.length!=0) return false;
	else                           return true;
}

////////// Alphabet, Number, AlphaNum, PhoneNum Ã¼Å© ÇÔ¼ö //////////
function isAlphaNum(str,div){
							//checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$^*()_\+-=||{}[]:;<>?/\\";
	if(div=="Alphabet") checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	if(div=="Number")   checkOK = "0123456789";
	if(div=="AlphaNum") checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	if(div=="PhoneNum") checkOK = "0123456789-";
	for(i=0; i<str.length; i++){
		ch = str.charAt(i);
		for(j=0; j<checkOK.length; j++){
			if(ch==checkOK.charAt(j)) break;
		}
		if(j==checkOK.length){
			return false;
			break;
		}
	}
	return true;
}

////////// Æ¯Á¤¹®ÀÚ Á¸Àç Ã¼Å© ÇÔ¼ö //////////
function isExistChr(str,div){
							  //checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$^*()_\+-=||{}[]:;<>?/\\";
	if(div=="FolderName") checkOK = "`~!@#$^*()_\+-=||{}[]:;<>?/\\\"";
	for(i=0; i<str.length; i++){
		ch = str.charAt(i);
		for(j=0; j<checkOK.length; j++){
			if(ch==checkOK.charAt(j)){
				return true;
				break;
			}
		}
	}
	return false;
}

////////// ¹®ÀÚ±æÀÌ Ã¼Å© ÇÔ¼ö //////////
function isLengthOk(str,min,max){
	if(str.length<min || str.length>max) return false;
	else                                 return true;
}

////////// ÁÂ¿ì °ø¹éÁ¦°ÅÇÔ¼ö //////////
function trim(strSource){
	re = /^\s+|\s+$/g;
	return strSource.replace(re,'');
}
////////// ÁÂ °ø¹éÁ¦°ÅÇÔ¼ö //////////
function ltrim(strSource){
	re = /^\s+/g;
	return strSource.replace(re,'');
}
////////// ¿ì °ø¹éÁ¦°ÅÇÔ¼ö //////////
function rtrim(strSource){
	re = /\s+$/g;
	return strSource.replace(re,'');
}

////////// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿ Ã¼Å© ÇÔ¼ö //////////
function CheckJumin(obj_jumin1,obj_jumin2,val_jumin1,val_jumin2){
	if(!val_jumin1){ alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!'); obj_jumin1.focus(); return false;}
	if(!val_jumin2){ alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!'); obj_jumin2.focus(); return false;}
	ju = [0,0,0,0,0,0,0,0,0,0,0,0,0];   // ÁÖ¹Î¹øÈ£ Ã¼Å© ¹è¿­¼±¾ð
	for(i=0; i<6; i++) ju[i] = val_jumin1.substring(i,i+1);
	for(i=0; i<7; i++) ju[i+6] = val_jumin2.substring(i,i+1);
	for(sum=0,i=0; i<=11; i++) sum+= ju[i] * ((i>7)?(i-6):(i+2));
	mod = 11 - (sum % 11);
	if(mod>=10) mod-= 10;
	if(mod!=ju[12]){
		alert('ÁÖ¹Îµî·Ï¹øÈ£ ¿À·ùÀÔ´Ï´Ù !!\n\nÁÖ¹Îµî·Ï¹øÈ£ È®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		obj_jumin1.select();
		obj_jumin2.value = '';
		return false;
	}

	//alert('Á¤È®ÇÑ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù.!!')
	return true;
}

////////// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿ Ã¼Å© ÇÔ¼ö //////////
function CheckJumin2(obj_jumin1,obj_jumin2,val_jumin1,val_jumin2){
	if(!val_jumin1){ alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!'); obj_jumin1.focus(); return false;}
	if(!val_jumin2){ alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!'); obj_jumin2.focus(); return false;}
	ju = [0,0,0,0,0,0,0,0,0,0,0,0,0];   // ÁÖ¹Î¹øÈ£ Ã¼Å© ¹è¿­¼±¾ð
	for(i=0; i<6; i++) ju[i] = val_jumin1.substring(i,i+1);
	for(i=0; i<7; i++) ju[i+6] = val_jumin2.substring(i,i+1);
	for(sum=0,i=0; i<=11; i++) sum+= ju[i] * ((i>7)?(i-6):(i+2));
	mod = 11 - (sum % 11);
	if(mod>=10) mod-= 10;
	if(mod==ju[12]){
		alert('Á¤È®ÇÑ ÁÖ¹Î¹øÈ£ ÀÔ´Ï´Ù.!!')
		return true;
	}
	alert('ÁÖ¹Îµî·Ï¹øÈ£ ¿À·ùÀÔ´Ï´Ù !!\n\nÁÖ¹Îµî·Ï¹øÈ£ È®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇØÁÖ¼¼¿ä.');
	obj_jumin1.select();
	obj_jumin2.value = '';
	return false;

}

////////// FromFormControlÀÔ·Â¶õ¿¡ ±ÛÀÚ¼ö°¡ StringLength°³ÀÌ¸é ToFormControl·Î Æ÷Ä¿½º ÀÌµ¿ÇÔ¼ö //////////
////////// onkeyup='MoveFocus(6,this,this.form.jumin2)' //////////
function MoveFocus(StringLength,FromFormControl,ToFormControl){
	if(FromFormControl.value.length==StringLength) ToFormControl.focus();
}


////////// ÆË¾÷Ã¢ Ã³¸® //////////
function popup(theURL,winName,features){
	window.open(theURL,winName,features);
}

////////// ÆäÀÌÁö ²¿¸´¸» Ã¼Å© //////////
function checktail(form){
	if (!trim(form.irum.value))   { alert("¼º¸íÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä..");      form.irum.focus();   return false;}
	if (!trim(form.body.value))   { alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä..");     form.body.focus();   return false;}
	if (!trim(form.pwtail.value)) { alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.."); form.pwtail.focus(); return false;}

	return true
}

////////// ²¿¸®¸» »èÁ¦ submitÀÌÀüÀÇ ÇÔ¼ö //////////
function BeforeSubmit_pagetail_del(frm,delno){
	frm.tail_no.value = delno;
	// ·Î±×ÀÎ ¹æ½ÄÀÌ ¾Æ´Ï¸é ºñ¹Ð¹øÈ£ ¹°¾îº¸±â

		PopWidth = 300 + 6;   // Å×ÀÌºí³ÐÀÌ + Ã¢Å×µÎ¸®
		PopHeight = 120;
		MoArr = window.showModalDialog('/common/pagetail_pw.html', '', 'dialogWidth='+PopWidth+'px; dialogHeight='+PopHeight+'px; center:yes; help:no; status:no; resizable:no;');
		if(MoArr!=null){
			frm.tail_passwd.value = MoArr['tail_passwd'];
			frm.submit();
		}else{
			return false;
		}
		// ºñ¹Ð¹øÈ£ ÀÔ·Â ÀçÈ®ÀÎ
		if(!frm.tail_passwd.value){ alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä !!'); return false;}

	frm.submit();
}

////////// ¿ìÆí¹øÈ£ ¹× ÁÖ¼Ò ÀÚµ¿ÀÔ·Â popupÃ¢ ÇÔ¼ö //////////
function zipauto(frm,zip1,zip2,addr1,addr2){
	PopWidth = 470;
	PopHeight = 350;
	PopLeft = (screen.width-PopWidth)/2;
	PopTop = (screen.height-PopHeight)/2;
	Pop_zip = open('/common/zipauto.html?frm='+frm+'&zip1='+zip1+'&zip2='+zip2+'&addr1='+addr1+'&addr2='+addr2, 'Pop_zip', 'width='+PopWidth+',height='+PopHeight+',scrollbars=no,status=no,left='+PopLeft+',top='+PopTop);
	Pop_zip.focus();
}

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()

function chng(ImgName,ImgSrc){

	if ((screen.colorDepth >= 24) && (is.ie4)){
		eval('document.images.'+ImgName+'.src = '+ImgSrc+'.src;');
	}else{
		eval(ImgName + '.filters.blendTrans.stop();');
		eval(ImgName + '.filters.blendTrans.Apply();');
		eval(ImgName + '.src=' + ImgSrc + '.src;');
		eval(ImgName + '.filters.blendTrans.Play();');
	}
}

function chng2(ImgName,ImgSrc){
	eval('document.images.'+ImgName+'.src = '+ImgSrc+'.src;');
}

///////// S_Public ÄíÅ° »ý¼º //////////////////
function S_Public(key, val){
	url = "http://www.netimo.net/common/S_Public.html?key="+key+"&value="+val;
	document.write("<iframe name=S_Public scrolling=no width=0 height=0 frameborder=0 style='position:absolute; left:0; top:0; visibility:hidden;' src='"+url+"'></iframe>");
}

////////// WebManual ³»¿ëº¸±â POPUPÃ¢ ÇÔ¼ö //////////
function WebManual_pop(){
	PopWidth = 800;
	PopHeight = 640;
	PopLeft = (window.screen.width-(PopWidth+10)) / 2;         // Å×µÎ¸®(10)
	PopTop = (window.screen.height-(PopHeight+60)) / 2 - 20;   // toolbar(60)
	Pop_WebManual = window.open('http://www.netimo.net/WebManual_03/', 'Pop_WebManual', 'left='+PopLeft+',top='+PopTop+',width='+PopWidth+',height='+PopHeight+',menubar=no,toolbar=yes,scrollbars=no,status=no,resizable=yes');
	try{Pop_WebManual.focus()}catch(e){}
}

// ÆË¾÷ ·Î±×ÀÎ Ã¢
function openLogin(HostURL){
	var newWin = window.open('http://www.baroga.net/Login.html?HostURL=' + HostURL,'MyanywareLogIn','Top=100,Left=100,Width=400,Height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	newWin.focus();
}

// ¾Æµðµð/ÆÐ½º¿öµå È®ÀÎÃ¢ Ã¢
function openFindID(HostURL){
	var newWin = window.open('http://www.baroga.net/Login_Find_ID.html?HostURL=' + HostURL,'BarogaFindID','Top=100,Left=100,Width=400,Height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	newWin.focus();
}

// ÆË¾÷ È¸¿ø°¡ÀÔ Ã¢
function openRegMember(HostURL){
	var newWin = window.open('http://www.baroga.net/member/member_m.html?HostURL=' + HostURL,'MyanywareMemReg','Top=100,Left=100,Width=688,Height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');
	newWin.focus();
}

// È¸¿ø¼öÁ¤ Ã¢
function openInfoMember(HostURL){
//	location.href = 'http://www.baroga.net/MyPage3/index.html?HostURL=' + HostURL + '&name=m_09';
	var newWin = window.open('http://www.baroga.net/MyPage3/index.html?HostURL=' + HostURL + '&name=m_09','MyanywareMemInfo','');
//	var newWin = window.open('http://www.baroga.net/member/membership.html?sel=mod&HostURL=' + HostURL,'MyanywareMemInfo','Top=100,Left=100,Width=688,Height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');
	newWin.focus();
}

// ÆË¾÷ ·Î±×¾Æ¿ô Ã¢
function openLogout(HostURL){
	location.href = "http://www.netimo.net/Netimo_Logoff.html?PreURL=http://www.netimo.net";
//	var newWin = window.open('http://www.baroga.net/Logout.html?HostURL=' + HostURL,'MyanywareLogOut','Top=100,Left=100,Width=100,Height=100,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
//	newWin.focus();
}

// ÆË¾÷ MyPage Ã¢
function openMyPage(HostURL){
//	var newWin = window.open('http://www.baroga.net/MyPage/index.html?HostURL=' + HostURL,'MyPage','Top=100,Left=100,Width=600,Height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	var newWin = window.open('http://www.baroga.net/MyPage3/index.html?HostURL=' + HostURL + '&name=m_09','MyanywareMemInfo','');
	//location.href = 'http://www.baroga.net/MyPage3/index.html?HostURL=' + HostURL + '&name=m_08';
}

//ÆË¾÷ MyPage > SMS Ã¢
function openSMS(HostURL){
	location.href = 'http://www.baroga.net/MyPage3/index.html?HostURL=' + HostURL + '&name=m_06';
//	var newWin = window.open('http://www.baroga.net/MyPage/SMS_Send.html','MyPage','Top=100,Left=100,Width=600,Height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
//	newWin.focus();
}

//ÆË¾÷ °øÁö»çÇ× Ã¢
function openNotice(){
	var newWin = window.open('/Pupup/index.html','Notice','Top=100,Left=100,Width=300,Height=380,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	newWin.focus();
}

//ºÒ·® °Ô½Ã¹° °æ°í
function warning(table, div, no){
	var newWin = window.open('/board/warning.html?table='+table+'&div='+div+'&no='+no,'warning','Top=100,Left=100,Width=400,Height=200,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	newWin.focus();
}

//ºÒ·® °Ô½Ã¹° °æ°í ÃÊ±âÈ­
function warning_reset(id){
	var newWin = window.open('/board/warning_act.html?id='+id,'warning_reset','Top=100,Left=100,Width=400,Height=200,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
}

/**********************************
**  ¼³¹®Á¶»ç Å¬¸¯½Ã          *
***********************************/
function check(form){   // ¼±ÅÃÇ×¸ñÀÌ ÀÖ´ÂÁö¸¦ °Ë»çÇØ¼­ ÆË¾÷À» ¶ç¿î´Ù.
	var j;
	for(var i = 0 ; i < form.recommend.length; i++ ){
		if(form.recommend[i].checked == true){
			form.submit();
			j=1;
		}
	}
	if(j!=1) alert("¼±ÅÃÇÏ½Å Ç×¸ñÀÌ ¾øÀ¾´Ï´Ù!!");
}

function ListView(Div){
	GoPoll(Div);
}

var TopMenuId = '';//ÀÌ¹ÌÁö ¹Ù²ÙÁö ¾ÊÀ» id¸í


/// ¸¶¿ì½º ¿À¹ö,¾Æ¿ô½Ã ÀÌ¹ÌÁö ¹Ù²Ù±â ///
function EventMouseOverOut(obj,isOver,dir){
	ImgName = obj.id
	if(isOver=="Y") obj.src = "/img/" + dir + "/" + ImgName + "_r.gif";
	else            obj.src = "/img/" + dir + "/" + ImgName + ".gif";
}


/// ¸¶¿ì½º ¿À¹ö,¾Æ¿ô½Ã ÀÌ¹ÌÁö ¹Ù²Ù±â2 ///
function EventMouseOverOut2(obj,isOver,dir){
	ImgName = obj.id
	if(isOver=="Y") obj.src = "/img/" + dir + "/" + ImgName + "_r.gif";
	else            obj.src = "/img/" + dir + "/" + ImgName + ".gif";
}

/// ÆÐ¹Ð¸® »çÀÌÆ® »õÃ¢ ¶ç¿ì±â ///
function GoFamilySite(url){
	//alert(url);
	if(url!='') window.open(url,"","");
}

///// ¿ìÃø ¿òÁ÷ÀÌ´Ï ¹è³Ê ½ºÅ©¸³Æ® /////
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

var isNS = navigator.appName == "Netscape";

function moveRightEdge() {

	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 58;

	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 58;
	}

	timeoutNextCheck = 500;


	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}

	setTimeout ("moveRightEdge()", timeoutNextCheck);
}

//// ¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù. ////
function not_service(){ alert("°ð ¼­ºñ½º ÇÏ°Ú½À´Ï´Ù.");  }

function GoBoard(table,div,section)
{

	var table;
	var div;
	var section;

	//url = "http://www.netimo.net/board/list.html?table="+table+"&div="+div+"&section="+section;

	if(div == '')//div°¡ ¾øÀ¸¸é boardid·Î ÀÎ½Ä
		url = "http://www.netimo.net/board/list.html?boardid="+table;
	else
		//url = "http://www.netimo.net/board/init_cookie.html?table="+table+"&div="+div+"&section="+section;
		url = "http://www.netimo.net/board/list.html?table="+table+"&div="+div+"&section="+section;

	//document.go_board.location.href(url);
	//document.go_board.location.href=url;
	location.href=url;
}

function GoPoll(div)
{
	var div;

	//url = "http://www.netimo.net/board/list.html?table="+table+"&div="+div+"&section="+section;
	//url = "http://www.netimo.net/home/onlinepoll/history.html?Div="+div+"&poll=1";
	url = "http://www.netimo.net/poll/history.html?Div="+div+"&poll=1";

	//location.href(url);
	location.href=url;
}

//Ä«Æä ¹Ù·Î°¡±â
function cafe_go(dir_code)
{
	var win_url = 'http://cafe.netimo.net/' + dir_code  + '/';
	location.href=win_url;
	return;
}


function GoMakeCafeNotice()
{
	window.open("http://www.netimo.net/popup/user_check.php","usercheck","width=640,height=660,top=10,left=10,toolbar=no,scrollbars=yes,resizable=no");
}






//¶ó¿îµåÅ×ÀÌºí
function roundTable(objID) {
       var obj = document.getElementById(objID);
       var Parent, objTmp, Table, TBody, TR, TD;
       var bdcolor, bgcolor, Space;
       var trIDX, tdIDX, MAX;
       var styleWidth, styleHeight;

       // get parent node
       Parent = obj.parentNode;
       objTmp = document.createElement('SPAN');
       Parent.insertBefore(objTmp, obj);
       Parent.removeChild(obj);

       // get attribute
       bdcolor = obj.getAttribute('rborder');
       bgcolor = obj.getAttribute('rbgcolor');
       radius = parseInt(obj.getAttribute('radius'));
       if (radius == null || radius < 1) radius = 1;
       else if (radius > 6) radius = 6;

       MAX = radius * 2 + 1;
       
       /*
              create table {{
       */
       Table = document.createElement('TABLE');
       TBody = document.createElement('TBODY');

       Table.cellSpacing = 0;
       Table.cellPadding = 0;

       for (trIDX=0; trIDX < MAX; trIDX++) {
              TR = document.createElement('TR');
              Space = Math.abs(trIDX - parseInt(radius));
              for (tdIDX=0; tdIDX < MAX; tdIDX++) {
                     TD = document.createElement('TD');
                     
                     styleWidth = '1px'; styleHeight = '1px';
                     if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
                     else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
                     else if (radius > 2) {
                            if (Math.abs(tdIDX - radius) == 1) styleWidth = '1px';
                            if (Math.abs(trIDX - radius) == 1) styleHeight = '1px';
                     }

                     if (styleWidth != null) TD.style.width = styleWidth;
                     if (styleHeight != null) TD.style.height = styleHeight;

                     if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
                     else if (tdIDX > Space && Space < MAX - tdIDX - 1)  TD.style.backgroundColor = bgcolor;
                     
                     if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
                     TR.appendChild(TD);
              }
              TBody.appendChild(TR);
       }

       /*
              }}
       */

       Table.appendChild(TBody);
       
       // insert table and remove original table
       Parent.insertBefore(Table, objTmp);
}
