
// ¿øÇÏ´Â ¹®ÀÚ¿­ ÀÌ¿ÜÀÇ ±ÛÀÚ´Â ¿¡·¯¸¦ ¹ß»ýÇÑ´Ù

function j_onlystr (type, str)
{
	for(i=0;i<str.length;i++)
	{
		if(type.indexOf(str.substring(i, i+1))=="-1")
		{
			return false;
		}
	}
}


// ---------------------------------------------------------------------------------------------------- //
//
//		¹øÈ£ :	no.5
//	
//		Á¤º¸ :	ÀÏ¹ÝÀûÀÎ ÆË¾÷Ã¢À» ¶ç¿öÁØ´Ù
//	
//		ÇÔ¼ö :	j_windowopen (ppath, pname, pkind, pleft, ptop, pwidth, pheight, ptool, pmenu, pscrollbar, pstate);
//	
//		¼³¸í :	j_windowopen (ÆË¾÷Ã¢°æ·Î, ÆË¾÷Ã¢ÀÌ¸§(»ý·«ÇÏ¸é ´Ù¸¥ »õÃ¢ÀÌ ¿­¸°´Ù), ÁÂÇ¥¹æ½Ä, ÆË¾÷Ã¢°¡·ÎÁ¤·Ä/ÆË¾÷Ã¢°¡·ÎÁÂÇ¥, ÆË¾÷Ã¢¼¼·ÎÁ¤·Ä/ÆË¾÷Ã¢¼¼·ÎÁÂÇ¥, ÆË¾÷Ã¢Å©±â°¡·Î, ÆË¾÷Ã¢Å©±â¼¼·Î, µµ±¸º¸ÀÌ±â, ¸Þ´ºº¸ÀÌ±â, ½ºÅ©·Ñº¸ÀÌ±â, »óÅÂÁÙº¸ÀÌ±â);
//	
//		¿¹Á¦ :	j_windowopen ("./popup.php", "name", "Á¤·Ä", "center", "middle", 200, 300, "no", "no", "yes", "no");
//					j_windowopen ("./popup.php", "name", "ÁÂÇ¥", "0", "0", 200, 300, "no", "no", "yes", "no");
//
//		Âü°í :	º¸ÅëÀÇ ÆË¾÷Ã¢ÀÌ¸ç, "ÇÏ·íµ¿¾È ¿­Áö ¾ÊÀ½" µîÀÇ ±â´ÉÀº Æ÷ÇÔµÇ¾î ÀÖÁö ¾Ê´Ù.
//					ÁÂÇ¥¹æ½ÄÀº "Á¤·Ä" °ú "ÁÂÇ¥" ·Î ±¸ºÐµÇ¾î ÀÖÀ¸¸ç "Á¤·Ä" ÀÇ °æ¿ì¿¡´Â ¸ð´ÏÅÍ ÇØ»óµµ¿¡ µû¶ó »ó´ëÀûÀ¸·Î ÆË¾÷Ã¢ À§Ä¡¸¦ ¸ÂÃß¸ç "ÁÂÇ¥" ´Â Àý´ë°ªÀÎ ÁÂÇ¥·Î ÆË¾÷Ã¢À» Ãâ·ÂÇÑ´Ù.
//
// ---------------------------------------------------------------------------------------------------- //

function j_windowopen (ppath, pname, pkind, pleft, ptop, pwidth, pheight, ptool, pmenu, pscrollbar, pstate)
{
	if(pkind=="Á¤·Ä")
	{
		var winalign=0;
		var winvalign=0;

		switch(pleft)
		{
			case "left"		:	winalign=0;
									break;
			case "center"	:	winalign=(window.screen.width-pwidth)/2;
									break;
			case "right"	:	winalign=window.screen.width-pwidth;
									break;
		}

		switch(ptop)
		{
			case "top"		:	winvalign=0;
									break;
			case "middle"	:	winvalign=(window.screen.height-pheight)/2;
									break;
			case "bottom"	:	winvalign=window.screen.height-pheight;
									break;
		}

		window.open(ppath, pname, "left="+winalign+", top="+winvalign+", width="+pwidth+", height="+pheight+", toolbar="+ptool+", menubar="+pmenu+", scrollbars="+pscrollbar+", status="+pstate);
	}
	else if(pkind=="ÁÂÇ¥")
	{
		window.open(ppath, pname, "left="+pleft+", top="+ptop+", width="+pwidth+", height="+pheight+", toolbar="+ptool+", menubar="+pmenu+", scrollbars="+pscrollbar+", status="+pstate);
	}
}





/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		¹øÈ£ ¡å
//				no.4
//	
//		Á¤º¸ ¡å
//				ÇöÀç ÆäÀÌÁö¿¡ ÀÔ·ÂÆûÀÌ µü ÇÑ°³¸¸ ÀÖÀ¸¸é ¿£ÅÍÅ°°¡ Á¦¸Ú´ë·Î ÀÔ·ÂµÇ´Â ¹®Á¦¸¦ Á¦¾îÇÑ´Ù.
//	
//		ÇÔ¼ö ¡å
//				j_formcheck ();
//	
//		¼³¸í ¡å
//				j_formcheck ();
//	
//		¿¹Á¦ ¡å
//				<form name="formname" method="post" action="test.php" onSubmit="return j_formcheck();">
//
//		Âü°í ¡å
//				form ÅÂ±×°¡ µé¾î°¡´Â °÷¿¡´Â Ç×»ó ÀÔ·ÂÇÏµµ·Ï ÇÑ´Ù.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function j_formcheck ()
{
	return false;
}





/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		¹øÈ£ ¡å
//				no.3
//	
//		Á¤º¸ ¡å
//				ÀÔ·ÂÆû¿¡ Æ÷Ä¿½º°¡ µé¾î¿ÔÀ»¶§, °³Ã¼ÀÇ Å×µÎ¸®»öÀ» ¹Ù²ãÁØ´Ù.
//	
//		ÇÔ¼ö ¡å
//				j_formline (kindif, nowthis, targetcolor);
//	
//		¼³¸í ¡å
//				j_formline (Æ÷Ä¿½º°¡ µé¾î¿Ô°Å³ª ºüÁ®³ª°¬À»¶§, Å×µÎ¸®»öÀ» ¹Ù²Ü °³Ã¼, ±³Ã¼ÇÒ Å×µÎ¸®»ö±ò);
//	
//		¿¹Á¦ ¡å
//				<input type="text" name="test" onFocus="j_formline ('in', this, '#000000');" onblur="j_formline ('out', this, '');">
//
//		Âü°í ¡å
//				kindif ´Â 'in' ¶Ç´Â 'out' ÀÇ °ªÀÌ µé¾î°¡¸ç, 'in' Àº Æ÷Ä¿½º°¡ µé¾î¿ÔÀ»¶§ 'out' ´Â Æ÷Ä¿½º°¡ ºüÁ®³ª°¬À»¶§ ÀÌ´Ù.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function j_formline (kindif, nowthis, targetcolor)
{
	// Æ÷Ä¿½º°¡ µé¾î¿ÔÀ» °æ¿ì
	if(kindif=="in")
	{
		nowthis.style.borderColor=targetcolor;
	}
	// Æ÷Ä¿½º°¡ ºüÁ®³ª°¬À» °æ¿ì
	else if(kindif=="out")
	{
		nowthis.style.borderColor="";
	}
}





/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		¹øÈ£ ¡å
//				no.6
//	
//		Á¤º¸ ¡å
//				ÀÔ·ÂµÈ ÁÖ¼Ò·Î ÆäÀÌÁö¸¦ ÀÌµ¿ÇÑ´Ù.
//	
//		ÇÔ¼ö ¡å
//				j_moveurl ( url );
//	
//		¼³¸í ¡å
//				j_moveurl ("ÀÌµ¿ÇÒ °æ·Î");
//	
//		¿¹Á¦ ¡å
//				j_moveurl ("./index.php");
//
//		Âü°í ¡å
//				ÀÔ·ÂµÈ ÁÖ¼Ò·Î ÆäÀÌÁö¸¦ ÀÌµ¿ÇÑ´Ù.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function j_moveurl (url)
{
	location.href=url;
}

// ---------------------------------------------------------------------------------------------------- //
//
//		¹øÈ£ :	no.1
//	
//		Á¤º¸ :	ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ÁøÂ¥ÀÎ°¡ °¡Â¥ÀÎÁö¸¦ ÆÇ´ÜÇÑ´Ù.
//	
//		ÇÔ¼ö :	j_registration (number_f, number_r);
//	
//		¼³¸í :	j_registration (ÁÖ¹Îµî·Ï¹øÈ£ÀÇ ¾ÕÀÚ¸® 6ÀÚ¸®, ÁÖ¹Îµî·Ï¹øÈ£ÀÇ µÞÀÚ¸® 7ÀÚ¸®);
//	
//		¿¹Á¦ :	$str = j_registration ("123456", "1234567");
//					if($str==true)
//					{
//						alert("¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù!");
//					}
//
//		Âü°í :	ÁÖ¹Îµî·Ï¹øÈ£°¡ ÁøÂ¥ÀÌ¸é true, °¡Â¥ÀÌ¸é false ÀÌ ¹ÝÈ¯µÈ´Ù.
//
// ---------------------------------------------------------------------------------------------------- //

function j_registration (number_f, number_r)
{
	var numbervalue="234567892345";
	var peoplenumber=number_f+number_r;
	var totalnumber=0;

	for(i=0;i<12;i++)
	{
		totalnumber+=peoplenumber.substr(i,1)*numbervalue.substr(i,1);
	}

	totalnumber=totalnumber%11;
	totalnumber=11-totalnumber;

	if(totalnumber==10)
	{
		totalnumber=0;
	}

	if(totalnumber==11)
	{
		totalnumber=1;
	}

	if(totalnumber==peoplenumber.substr(12,1))
	{
		if(peoplenumber.substr(6,1)<1 && peoplenumber.substr(6,1)>4)
		{
			return false;
		}
	}
	else
	{
		return false;
	}

	return true;
}

