//Replace (¹®ÀÚ¿­ ÀüÃ¼ Áß)
//string : ¹Ù²Ü ¹®ÀÚ¿­
//changeString : ¹Ù²ð ¹®ÀÚ¿­
String.prototype.Replace = function(string, changeString) 
{
	return this.replace(new RegExp(string,"g"), changeString);
}

//Trimming
String.prototype.Trim = function() 
{ 
	return this.replace(/^\s+|\s+$/g, '');  
}

//Insert character(s)
//index : ¹®ÀÚ¿­À» Ãß°¡ÇÒ ÀÎµ¦½º
//value : Ãß°¡ÇÒ ¹®ÀÚ¿­
String.prototype.Insert = function(index, value)
{
	if(this.length - 1 < index)
		return this;
	
	return this.substr(0, index) + value + this.substr(index - 1 + value.length);
}

//Padding Left
//length : ÃÑ ±æÀÌ
//character : Ã¤¿ï ¹®ÀÚ¿­(char)
String.prototype.PadLeft = function(length, character)
{
	var sValue = String(this);
	
	if(sValue.length >= length)
	   return sValue;
	else
	{
		while(sValue.length < length)
			sValue = character + sValue;
			
		return sValue;
	}
}

//Padding Right
//length : ÃÑ ±æÀÌ
//character : Ã¤¿ï ¹®ÀÚ¿­(char)
String.prototype.PadRight = function(length, character)
{
	var sValue = String(this);
	
	if(sValue.length >= length)
	   return sValue;
	else
	{
		while(sValue.length < length)
			sValue = sValue + character;
			
		return sValue;
	}
}

//*****************************************************************************
//Description : À¯È¿¼º Ã¼Å©
//Parameter:
//Return:
//Usage:
//*****************************************************************************
function CheckValid(String,	space)
{
	 var retvalue	=	false;
	 for (var	i=0; i<String.length;	i++)
	 {		//StringÀÌ 0(""	ÀÌ³ª null)ÀÌ¸é ¹«Á¶°Ç	false
			if (space	== true)
			{
				 if	(String.charAt(i)	== ' ')
				 {			//StringÀÌ 0ÀÌ ¾Æ´Ò¶§	space°¡	ÀÖ¾î¾ß¸¸ true(valid)
						retvalue = true;
						break;
				 }
			} else {
				 if	(String.charAt(i)	!= ' ')
				 {			//stringÀÌ 0ÀÌ ¾Æ´Ò¶§	space°¡	¾Æ´Ñ ±ÛÀÚ°¡	ÀÖ¾î¾ß¸¸ true(valid)
						retvalue = true;
						break;
				 }
			}
	 }
	 return	retvalue;
}

//*****************************************************************************
//Description : Ç×¸ñÀÌ	ºñ¾îÀÖ´ÂÁö Ã¼Å©
//Parameter: isFocus:°´Ã¼¿¡ focusing¿©ºÎ
//Return:
//Usage:
//*****************************************************************************
function isEmpty(field,	error_msg,isFocus)
{
	// error_msg°¡ ""ÀÌ¸é	alert¿Í	focusingÀ» ÇÏÁö¾Ê´Â´Ù
	if(error_msg ==	"")	{
		if(!CheckValid(field.value,	false))		{
			return true;
		}	else {
			return false;
		}
	}	else {
		if(!CheckValid(field.value,	false))	{
			alert(error_msg);
			if(isFocus!=false) field.focus()	;
			return true;
		}	else {
			return false;
		}
	}
}

//*****************************************************************************
//Description : ¸Þ¼¼Áö Ã³¸®ÈÄ focusing
//Parameter:
//Return:
//Usage:
//*****************************************************************************
function altFocus(field,error_msg,isFocus)
{
	alert(error_msg);
	if(isFocus!=false) field.focus();
	return false;
}


/**
	ÇÔ¼ö¸í : setFlash
	¼³   ¸í : ÇÃ·¡½Ã¸¦ È­¸é¿¡ Ãâ·ÂÇÑ´Ù.
	ÀÎ   ÀÚ : ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, º¯¼ö
	¸®   ÅÏ : 
	»ç¿ë¹ý : <script language="JavaScript">setFlash('src', 'w', 'h', 'id', 'vars');</script>
 */
function setFlash(src, w, h, id, vars) {
	var Flash_html = "";
	Flash_html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="'+id+'" width="'+w+'" height="'+h+'">';
	Flash_html += '<param name="movie" value="'+src+'">';
	Flash_html += '<param name="quality" value="high">';
	Flash_html += '<param name="wmode" value="transparent">';
	Flash_html += '<param name="FlashVars" value="'+vars+'">';
	Flash_html += '<param name="swliveconnect" value="true">';
	Flash_html += '<embed src="'+src+'" quality=high wmode="transparent" FlashVars="'+vars+'" width="'+w+'" height="'+h+'" swliveconnect="true" id="'+id+'" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	Flash_html += '</object>';
	document.write(Flash_html);
}