/*
 * WeGoNet Common Library
 * since 2008.4.7. (ytg)
 * PrototypeJS 1.6.0 or higher required.
 */

    var WGlib_common = Class.create();

    WGlib_common.prototype =
    {
        initialize: function()
        {
            this.xquaredToolbar640 = [
    			[
    				{className:"foregroundColor", title:"Foreground color", handler:"xed.handleForegroundColor()"},
    				{className:"backgroundColor", title:"Background color", handler:"xed.handleBackgroundColor()"}
    			],
    			[
    				{className:"fontFace", title:"±Û²Ã", list:[
    				    {title:"±¼¸²", handler:"xed.handleFontFace('±¼¸²')"},
                        {title:"µ¸¿ò", handler:"xed.handleFontFace('µ¸¿ò')"},
                        {title:"¹ÙÅÁ", handler:"xed.handleFontFace('¹ÙÅÁ')"},
                        {title:"±Ã¼­", handler:"xed.handleFontFace('±Ã¼­')"},
                        {title:"Arial", handler:"xed.handleFontFace('Arial')"},
                        {title:"Helvetica", handler:"xed.handleFontFace('Helvetica')"},
                        {title:"Serif", handler:"xed.handleFontFace('Serif')"},
                        {title:"Tahoma", handler:"xed.handleFontFace('Tahoma')"},
                        {title:"Verdana", handler:"xed.handleFontFace('Verdana')"}
    				]},
    				{className:"fontSize", title:"size", list:[
                        {title:"1", handler:"xed.handleFontSize('1')"},
                        {title:"2", handler:"xed.handleFontSize('2')"},
                        {title:"3", handler:"xed.handleFontSize('3')"},
                        {title:"4", handler:"xed.handleFontSize('4')"},
                        {title:"5", handler:"xed.handleFontSize('5')"},
                        {title:"6", handler:"xed.handleFontSize('6')"}
    				]}
    			],
    			[
    				{className:"link", title:"Link", handler:"xed.handleLink()"},
    				{className:"strongEmphasis", title:"Strong emphasis", handler:"xed.handleStrongEmphasis()"},
    				{className:"emphasis", title:"Emphasis", handler:"xed.handleEmphasis()"},
    				{className:"underline", title:"Underline", handler:"xed.handleUnderline()"},
    				{className:"strike", title:"Strike", handler:"xed.handleStrike()"}
    			],
    			[
    				{className:"removeFormat", title:"Remove format", handler:"xed.handleRemoveFormat()"}
    			],
    			[
    				{className:"justifyLeft", title:"Justify left", handler:"xed.handleJustify('left')"},
    				{className:"justifyCenter", title:"Justify center", handler:"xed.handleJustify('center')"},
    				{className:"justifyRight", title:"Justify right", handler:"xed.handleJustify('right')"},
    				{className:"justifyBoth", title:"Justify both", handler:"xed.handleJustify('both')"}
    			],
    			[
    				{className:"indent", title:"Indent", handler:"xed.handleIndent()"},
    				{className:"outdent", title:"Outdent", handler:"xed.handleOutdent()"},
    				{className:"unorderedList", title:"Unordered list", handler:"xed.handleList('UL')"},
    				{className:"orderedList", title:"Ordered list", handler:"xed.handleList('OL')"}
    			],
    			[
    				{className:"paragraph", title:"Paragraph", handler:"xed.handleApplyBlock('P')"}
    				/*,{className:"movie", title:"Movie", handler:"xed.handleMovie()"}
    				,{className:"html", title:"Edit source", handler:"xed.toggleSourceAndWysiwygMode()"}*/
    			]
    		];
    		
    		this.xquaredWhitelist = { "embed" : [ "pluginspage",
                                                  "src",
                                                  "width",
                                                  "height",
                                                  "type",
                                                  "showpositioncontrols",
                                                  "showtracker",
                                                  "showstatusbar",
                                                  "showcontrols",
                                                  "displaybackcolor",
                                                  "autostart",
                                                  "animationatstart" ] };
        },


        //-----------------------------------------------------------------------------
        // DOM°´Ã¼ ³»ÀÇ ÅØ½ºÆ®³ëµåÀÇ °ª ÃßÃâ
        // Element, tagName, Áßº¹¼ø¼­(À¯ÀÏÇÒ °æ¿ì »ý·«)
        // @return : String
        //-----------------------------------------------------------------------------
        getTextNode: function( domObj, strTag, seq )
    	{
    	    try
    	    {
    	        var arr = domObj.getElementsByTagName( strTag );
    	        
    	        if( arr.length <= 0 ) alert( "getTextNode ¿À·ù: Ã£À¸½Ã´Â(" + strTag + ") DOM°´Ã¼°¡ ¾ø½À´Ï´Ù." );
                else if( arr[ ( seq != null ? seq : 0 ) ].childNodes.length > 0 )
                    return arr[ ( seq != null ? seq : 0 ) ].firstChild.nodeValue;

                return "";
            }
            catch( ex )
            {
                alert( "getTextNode ¿¹¿Ü¿À·ù: " + ex.name + " (" + ex.number + ")\n\n[" + ex.message + "]\n[" + ex.description + "]" );
                return "";
            }
        },


        //-----------------------------------------------------------------------------
        // °æ°í¸Þ½ÃÁö ¶ç¿ì°í ÇØ´ç °´Ã¼¿¡ Æ÷Ä¿½Ì ÇÏ¸é¼­ ÇØ´ç °´Ã¼ÀÇ °ª ÀüÃ¼ ºí·° ¼³Á¤
        // Element, °æ°í¸Þ½ÃÁö
        // @return : void
        //-----------------------------------------------------------------------------
        alertActivate: function( obj, noticeMsg )
        {
            alert( noticeMsg );

            try
            {
                Field.activate( obj );
            }
            catch( e )
            {
            }
        },


        //-----------------------------------------------------------------------------
        // ÇØ´ç °´Ã¼ÀÇ °ª ÀüÃ¼ÀÇ whitespace Á¦°Å
        // Element
        // @return : void
        //-----------------------------------------------------------------------------
        onlyChar: function( obj )
        {
            try
            {
                obj.value = obj.value.onlyChar();
            }
            catch( e )
            {
            }
        },


        //-----------------------------------------------------------------------------
        // ÇØ´ç °´Ã¼ÀÇ °ª ¾ç ¿·ÀÇ whitespace Á¦°Å
        // Element
        // @return : void
        //-----------------------------------------------------------------------------
        trim: function( obj )
        {
            try
            {
                obj.value = obj.value.trim();
            }
            catch( e )
            {
            }
        },
        
        
        //-----------------------------------------------------------------------------
        // ÀÚµ¿ ÅÇ ( usage: INPUTÀÇ onkeyup="wgc.autoTab(this);" )
        // ¿µ¹®ÀÌ³ª ¼ýÀÚ¸¸ »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ÇÑ±ÛÀº Á¶ÇÕÀÔ·Â¹æ½Ä¶§¹®¿¡ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.
        // Element
        // @return : void
        //-----------------------------------------------------------------------------
        autoTab: function( obj, obj_next )
        {
            try
            {
                if( obj.value.length >= obj.maxLength )
                {
                    if( obj_next == null ) Field.focus( $( obj ).next( "INPUT" ) );
                    else                   Field.focus( $( obj_next )            );
                }
            }
            catch( e )
            {
            }
        },
        
        
        //-----------------------------------------------------------------------------
        // ¹ÙÀÌÆ® °è»ê°ú cropping
        // @»ç¿ë¹ý : <textarea onkeyup="wgc.cutByte(this);" maxlength="2000">......
        // Element
        // @return : void
        //-----------------------------------------------------------------------------
        cutByte: function( obj_content, obj_display, typeDisplay )
        {
            var max_bytes = parseInt( obj_content.getAttribute( "maxlength" ) != null ? obj_content.getAttribute( "maxlength" ) : 0 );
            var tmpStr = new String( obj_content.value );;
            var tcount = tmpStr.lengthByte();
            
            if( tcount > max_bytes )
            {
                var tmpSeq = 0;
                var isCapture = false;
                
                tcount = 0;
                
                for( k = 0; k < tmpStr.length; k++ )
                {
                    if( tmpStr.charCodeAt( k ) > 127 )    tcount += 2;
                    else if( tmpStr.charAt( k ) != "\r" ) tcount++;
                        
                    if( !isCapture && tcount > max_bytes )
                    {
                        tmpSeq = k;
                        isCapture = true;
                    }
                }
                tmpStr = tmpStr.rtrim().substring( 0, tmpSeq );
                obj_content.blur();
                obj_content.value = tmpStr;
                
                alert( "¸Þ½ÃÁö ³»¿ëÀº " + max_bytes + "¹ÙÀÌÆ® ÀÌ»óÀº Àü¼ÛÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.\r\nÀÔ·ÂÇÏ½Å ¸Þ¼¼Áö´Â " + ( tcount - max_bytes ) + "¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.\r\nÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù." );
    
                tcount = tmpStr.lengthByte();
            }
            
            if( obj_display != null )
            {
                if( typeDisplay != null )
                {
                    if( typeDisplay == "left_kor" )
                    {
/*
                        if( obj_display.value ) obj_display.value     = Math.ceil( ( max_bytes - tcount ) / 2 );
                        else                    obj_display.innerHTML = Math.ceil( ( max_bytes - tcount ) / 2 );
*/
                        if( obj_display.value ) obj_display.value     = ( max_bytes - tcount ) / 2;
                        else                    obj_display.innerHTML = ( max_bytes - tcount ) / 2;
                    }
                    else if( typeDisplay == "left" )
                    {
                        if( obj_display.value ) obj_display.value     = max_bytes - tcount;
                        else                    obj_display.innerHTML = max_bytes - tcount;
                    }
                }
                else
                {
                    if( obj_display.value ) obj_display.value     = tcount;
                    else                    obj_display.innerHTML = tcount;
                }
            }
            obj_content.focus();
        },
        
        
        //-----------------------------------------------------------------------------
        // ºÎµå·¯¿î ½ºÅ©·Ñ
        // @»ç¿ë¹ý : onclick="wgc.scrollToElement('id_element');return false;"
        // Element(id of Element), duration(´ÜÀ§:0.1ÃÊ)
        // @return : void
        //-----------------------------------------------------------------------------
        scrollToElement: function( obj, speed )
        {
            var pos = obj == null ? null : $( obj ).cumulativeOffset();
            var dOffsets = document.viewport.getScrollOffsets();
            
            clearInterval( this.timer_scroll );
		    this.timer_scroll = null;
		    
		    this.duration_scroll = speed == null ? 500 : speed * 100;
		    this.trans_from = dOffsets.top;
    		this.trans_to = pos == null ? 0 : pos.top - 5;
    		this.trans_time = new Date().getTime();
		    this.timer_scroll = setInterval( this.transScroll.bind(this), Math.round( 1000 / 50 ) );
        },
        
        transScroll: function()
        {
            var time = new Date().getTime();
            
    		if ( time < this.trans_time + this.duration_scroll )
    		{
    		    var t = time - this.trans_time;
    		    var b = this.trans_from;
    		    var c = this.trans_to - this.trans_from;
    		    var d = this.duration_scroll;
    		    
    		    //Fx.Transitions.sineInOut
    			this.trans_now = -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;    			
    		}
    		else
    		{
    			clearInterval( this.timer_scroll );
		        this.timer_scroll = null;
    			this.trans_now = this.trans_to;
    		}
    		window.scrollTo( 0, this.trans_now );
        },
        
        
        //-----------------------------------------------------------------------------
        // ºÎµå·¯¿î ½ºÅ©·Ñ (ÆäÀÌÁö ¸Ç À§·Î)
        // @»ç¿ë¹ý : onclick="wgc.scrollToTop();"
        // duration(´ÜÀ§:0.1ÃÊ)
        // @return : void
        //-----------------------------------------------------------------------------
        scrollToTop: function( speed )
        {
            this.scrollToElement( null, speed );
        },
        
        
        //-----------------------------------------------------------------------------
        // ÆË¾÷Ã¢ ¶ç¿ì±â
        // @»ç¿ë¹ý : wgc.openPopup( "", { width: 300, height: 500, scroll: 0, top: 100, left: 100, name: "name_popup" } );
        // °¢ ¿É¼ÇÀÇ ±âº»°ªÀº ¾Æ·¡ ÂüÁ¶
        // @return : ÆË¾÷Ã¢°´Ã¼
        //-----------------------------------------------------------------------------
        openPopup: function( url, option )
        {
            var obj_option = option == null ? {} : option;
            
            if( url               == null ) url               = "";
            if( obj_option.width  == null ) obj_option.width  = 300;
            if( obj_option.height == null ) obj_option.height = 500;
            if( obj_option.scroll == null ) obj_option.scroll = 0;
            if( obj_option.top    == null ) obj_option.top    = ( screen.availHeight - obj_option.height ) / 2;
            if( obj_option.left   == null ) obj_option.left   = ( screen.availWidth  - obj_option.width  ) / 2;
            if( obj_option.name   == null ) obj_option.name   = "";
            if( obj_option.errMsg == null ) obj_option.errMsg = "Please disable popup blocking!";
            
            var	newWindow = window.open( url, obj_option.name, "width=" + obj_option.width + ",height=" + obj_option.height + ",scrollbars=" + obj_option.scroll + ",toolbar=0,menubars=0,locationbar=0,historybar=0,statusbar=0" + ",innerWidth=" + ( obj_option.width + 10 ) + ",innerHeight=" + ( obj_option.height + 50 ) + ",resizable=0,left=" + obj_option.left + ",top=" + obj_option.top + ",channelmode=no,titlebar=no", false );
            
	        if( !newWindow )
	        {
		        alert( obj_option.errMsg );
		        return false;
	        }
	        newWindow.focus();
	        
	        return newWindow;
        },
        
        
        //-----------------------------------------------------------------------------
        // ÄíÅ°¿¡ ±âÇÑ¸¸·á °ª ¼ÂÆÃ
        // @»ç¿ë¹ý : wgc.setCookie( "name_project", "value_project", 1 );
        // String(key), String(value), Number(±âÇÑÀÏ¼ö,days)
        // @return : void
        //-----------------------------------------------------------------------------
        setCookie: function( name, value, expiredays )
	    { 
			var todayDate = new Date(); 
			todayDate.setDate( todayDate.getDate() + expiredays ); 
			document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
		},
		
		
		//-----------------------------------------------------------------------------
        // ÄíÅ° °ª ÃßÃâ
        // @»ç¿ë¹ý : wgc.getCookie( "name_project" );
        // °¢ ¿É¼ÇÀÇ ±âº»°ªÀº ¾Æ·¡ ÂüÁ¶
        // @return : String(ÀÔ·ÂµÈ key-¸¸·áµÇÁö ¾ÊÀº-¿¡ ÇØ´çÇÏ´Â °ª)
        //-----------------------------------------------------------------------------
		getCookie: function( name )
		{
			var nameOfCookie = name + "=";
			var x = 0;
			while ( x <= document.cookie.length )
			{
				var y = (x+nameOfCookie.length);
				if ( document.cookie.substring( x, y ) == nameOfCookie )
				{
					if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
						endOfCookie = document.cookie.length;
					return unescape( document.cookie.substring( y, endOfCookie ) );
				}
				x = document.cookie.indexOf( " ", x ) + 1;
				if ( x == 0 )
					break;
			}
			return "";
		}
    }

    var wgc = new WGlib_common();
    
    
    
    

	//-----------------------------------------------------------------------------
    // È°¼ºÈ­µÈ ÇÃ·¡½Ã »ðÀÔ
    //
    // @»ç¿ë¹ý
    //    var player1_bgm = new FlashObject( "/flash/playerskin.swf", 130, 36 );
    //    player1_bgm.id        = "pbgm";
	//    player1_bgm.wmode     = "transparent";
	//    player1_bgm.style_str = "margin:0px;"
	//    player1_bgm.Render();
    //-----------------------------------------------------------------------------
	function FlashObject( path, width, height )
	{
		var m_movie  = path;
		var m_width  = width;
		var m_height = height;

		this.wmode   = "";
		this.id      = "";
		this.quality = "high";
		this.loop    = "true";
		this.menu    = "true";
		this.allowScriptAccess = "sameDomain";
		this.FlashVars = "";
		this.scale     = "";
		this.salign    = "";
		this.align     = "";
		this.style_str = "";
		this.bgcolor   = "";

		this.Render = function( objSpace )
		{
			var html;

			html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='" + m_width + "' height='" + m_height + "'";
			if( this.id        != "" ) html += " id='"    + this.id        + "'";
			if( this.style_str != "" ) html += " style='" + this.style_str + "'";
			html += ">";

			html += "<param name='allowScriptAccess' value='" + this.allowScriptAccess + "' />";
			html += "<param name='movie'             value='" + m_movie                + "' />";
			html += "<param name='menu'              value='" + this.menu              + "' />";
			html += "<param name='quality'           value='" + this.quality           + "' />";
			html += "<param name='loop'              value='" + this.loop              + "' />";
			if( this.wmode     != "" ) html += "<param name='wmode'     value='" + this.wmode     + "' />";
			if( this.FlashVars != "" ) html += "<param name='FlashVars' value='" + this.FlashVars + "' />";
			if( this.scale     != "" ) html += "<param name='scale'     value='" + this.scale     + "' />";
			if( this.salign    != "" ) html += "<param name='salign'    value='" + this.salign    + "' />";

			html += "<embed src='" + m_movie + "' quality='" + this.quality + "' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + m_width + "' height='" + m_height + "'";
			html += " allowScriptAccess='" + this.allowScriptAccess + "' loop='" + this.loop + "'";
			if( this.wmode     != "" ) html += " wmode='"     + this.wmode     + "'";
			if( this.FlashVars != "" ) html += " FlashVars='" + this.FlashVars + "'";
			if( this.scale     != "" ) html += " scale='"     + this.scale     + "'";
			if( this.salign    != "" ) html += " salign='"    + this.salign    + "'";
			if( this.align     != "" ) html += " align='"     + this.align     + "'";
			if( this.style_str != "" ) html += " style='"     + this.style_str + "'";
			if( this.bgcolor   != "" ) html += " bgcolor='"   + this.bgcolor   + "'";
			html += " /></object>";

			if( objSpace == null ) document.write( html );
			else                   objSpace.innerHTML = html;
		}
	}
	
	
	
	
	//-----------------------------------------------------------------------------
    // µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
    // @»ç¿ë¹ý : var wfl1 = new WGlib_follow_layer( "id_layer", 30, 150, 10 );
    // Element(id of Element), È­¸é»ó °íÁ¤(¸ñÇ¥) À§Ä¡(top), »óÇÑ À§Ä¡(top), duration(´ÜÀ§:0.1ÃÊ)
    // @return : void
    //-----------------------------------------------------------------------------
	var WGlib_follow_layer = Class.create();

    WGlib_follow_layer.prototype =
    {
        initialize: function( obj, top_target, top_limit, speed )
        {
            this.duration   = speed == null ? 1000 : speed * 100;
            this.top_target = top_target;
            this.top_limit  = top_limit;
            this.obj_follow = $( obj );
            
            this.followingLayer();
            
            Event.observe( window, "scroll", this.followingLayer.bindAsEventListener( this ) );
        },
        
        followingLayer: function()
        {
            var pos_view = this.obj_follow.viewportOffset();
            var pos_cmlt = this.obj_follow.cumulativeOffset();
            var dOffsets = document.viewport.getScrollOffsets();
            
            if( pos_view.top != this.top_target )
            {
                clearInterval( this.timer );
    		    this.timer = null;
    		    
    		    this.from = pos_cmlt.top;
        		this.to = dOffsets.top + this.top_target < this.top_limit ? this.top_limit : dOffsets.top + this.top_target;
        		this.time = new Date().getTime();
    		    this.timer = setInterval( this.transFollow.bind(this), Math.round( 1000 / 50 ) );
            }
        },
        
        transFollow: function()
        {
            var time = new Date().getTime();
            
    		if ( time < this.time + this.duration )
    		{
    		    var t = time - this.time;
    		    var b = this.from;
    		    var c = this.to - this.from;
    		    var d = this.duration;
    		    
    		    //Fx.Transitions.sineInOut
    			this.now = -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;    			
    		}
    		else
    		{
    			clearInterval( this.timer );
		        this.timer = null;
    			this.now = this.to;
    		}
    		this.obj_follow.setStyle( { top: this.now + "px" } );
        }
    }





    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ ÀüÃ¼ÀÇ whitespace Á¦°Å
    // String
    // @return : String
    //-----------------------------------------------------------------------------
    String.prototype.onlyChar = function()
    {
        return this.replace( /\s/g, "" );
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ ¾ç ¿·ÀÇ whitespace Á¦°Å
    // String
    // @return : String
    //-----------------------------------------------------------------------------
    String.prototype.trim = function()
    {
        return this.replace( /^\s*|\s*$/g, "" );
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ ÁÂÃøÀÇ whitespace Á¦°Å
    // String
    // @return : String
    //-----------------------------------------------------------------------------
    String.prototype.ltrim = function()
    {
        return this.replace( /(^\s*)/, "" );
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ ¿ìÃøÀÇ whitespace Á¦°Å
    // String
    // @return : String
    //-----------------------------------------------------------------------------
    String.prototype.rtrim = function()
    {
        return this.replace( /(\s*$)/, "" );
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ÀÇ byte´ÜÀ§ ±æÀÌ ÃøÁ¤
    // String
    // @return : Number
    //-----------------------------------------------------------------------------
    String.prototype.lengthByte = function()
    {
        var cnt_prototype = 0;

        for( var i_i_i = 0; i_i_i < this.length; i_i_i++ )
        {
            if( this.charCodeAt( i_i_i ) > 127 )    cnt_prototype += 2;
            else if( this.charAt( i_i_i ) != "\r" ) cnt_prototype++;
        }
        return cnt_prototype;
    }


    //-----------------------------------------------------------------------------
    // Á¤¼öÇüÀ¸·Î º¯È¯
    // String
    // @return : Number
    //-----------------------------------------------------------------------------
    String.prototype.int = function()
    {
        if( !isNaN( this ) ) return parseInt( this );
        else                 return null;
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­¿¡ Æ÷ÇÔµÈ ¼ýÀÚ¸¸ ¹ÝÈ¯
    // String
    // @return : String
    //-----------------------------------------------------------------------------
    String.prototype.onlyNumber = function()
    {
        return this.trim().replace( /[^0-9]/g, "" );
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ °Ë»ç - ¼ýÀÚ¸¸
    // String
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isNumber = function( obj )
    {
        if( obj == null ) return ( /^[0-9]+$/ ).test( this ) ? true : false;
        else if( ( /^[0-9]+$/ ).test( this ) ) return true;
        {
            wgc.alertActivate( obj, "¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä." );
            return false;
        }
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ °Ë»ç - ¿µ¹®ÀÚ¸¸
    // String
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isEnglish = function( obj )
    {
        if( obj == null ) return ( /^[a-zA-Z]+$/ ).test( this ) ? true : false;
        else if( ( /^[a-zA-Z]+$/ ).test( this ) ) return true;
        {
            wgc.alertActivate( obj, "¿µ¹®ÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä." );
            return false;
        }
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ °Ë»ç - ¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚ¸¸
    // String
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isEngNum = function( obj )
    {
        if( obj == null ) return ( /^[0-9a-zA-Z]+$/ ).test( this ) ? true : false;
        else if( ( /^[0-9a-zA-Z]+$/ ).test( this ) ) return true;
        {
            wgc.alertActivate( obj, "¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä." );
            return false;
        }
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ °Ë»ç - ÇÑ±Û¸¸
    // String
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isKorean = function( obj )
    {
        if( obj == null ) return ( /^[°¡-ÆR]+$/ ).test( this ) ? true : false;
        else if( ( /^[°¡-ÆR]+$/ ).test( this ) ) return true;
        {
            wgc.alertActivate( obj, "ÇÑ±Û¸¸ ÀÔ·ÂÇÏ¼¼¿ä." );
            return false;
        }
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ °Ë»ç - ÇÑ±¹¿¡¼­ »ç¿ëµÇ´Â ÀüÈ­¹øÈ£ ¿©ºÎ
    // String
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isPhone_kor = function( obj )
    {
        if( obj == null ) return ( /^[0-9\-]{7,13}$/ ).test( this ) ? true : false;
        else if( ( /^[0-9\-]{7,13}$/ ).test( this ) ) return true;
        {
            wgc.alertActivate( obj, "ÀüÈ­¹øÈ£ Çü½Ä¿¡ ¸ÂÁö ¾Ê´Â ÀÔ·ÂÀÔ´Ï´Ù." );
            return false;
        }
    }


    //-----------------------------------------------------------------------------
    // ¹®ÀÚ¿­ °Ë»ç - ÀÌ¸ÞÀÏ ÁÖ¼Ò ¿©ºÎ
    // String
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isEmail = function( obj )
    {
        if( obj == null ) return ( /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.[a-zA-Z]{2,4}$/ ).test( this ) ? true : false;
        else if( ( /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.[a-zA-Z]{2,4}$/ ).test( this ) ) return true;
        {
            wgc.alertActivate( obj, "ÀÌ¸ÞÀÏ ÁÖ¼Ò Çü½Ä¿¡ ¸ÂÁö ¾Ê´Â ÀÔ·ÂÀÔ´Ï´Ù." );
            return false;
        }
    }


    //-----------------------------------------------------------------------------
    // ÁÖ¹Î¹øÈ£ Ã¼Å©
    // XXXXXX-XXXXXXX
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isJumin = function()
    {
        var jumin = eval( "this.match(/[0-9]{2}[01]{1}[0-9]{1}[0123]{1}[0-9]{1}-[1234]{1}[0-9]{6}$/)" );
        if( jumin == null ) return false;
        else                jumin = jumin.toString().onlyNumber().toString();

        // »ý³â¿ùÀÏ Ã¼Å©
        var birthYY = ( ( parseInt( jumin.charAt( 6 ) ) == ( 1 || 2 ) ) ? "19" : "20" ) + jumin.substr( 0, 2 );
        var birthMM = jumin.substr( 2, 2 ) - 1;
        var birthDD = jumin.substr( 4, 2 );
        var birthDay = new Date( birthYY, birthMM, birthDD );

        if( birthDay.getFullYear() % 100 != jumin.substr( 0, 2 )
         || birthDay.getMonth() != birthMM
         || birthDay.getDate() != birthDD ) return false;

        var sum = 0;
        var num = [ 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5 ];
        var last = parseInt( jumin.charAt( 12 ) );

        for( var i_i_i = 0; i_i_i < 12; i_i_i++ ) sum += parseInt( jumin.charAt( i_i_i ) ) * num[ i_i_i ];

        return ( ( 11 - sum % 11 ) % 10 == last ) ? true : false;
    }


    //-----------------------------------------------------------------------------
    // ¿Ü±¹ÀÎ µî·Ï¹øÈ£ Ã¼Å©
    // XXXXXX-XXXXXXX
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isForeigner = function()
    {
        var jumin = eval( "this.match(/[0-9]{2}[01]{1}[0-9]{1}[0123]{1}[0-9]{1}-[5678]{1}[0-9]{1}[02468]{1}[0-9]{2}[6789]{1}[0-9]{1}$/)" );
        if( jumin == null ) return false;
        else                jumin = jumin.toString().onlyNumber().toString();

        // »ý³â¿ùÀÏ Ã¼Å©
        var birthYY = ( ( parseInt( jumin.charAt( 6 ) ) == ( 5 || 6 ) ) ? "19" : "20" ) + jumin.substr( 0, 2 );
        var birthMM = jumin.substr( 2, 2 ) - 1;
        var birthDD = jumin.substr( 4, 2 );
        var birthDay = new Date( birthYY, birthMM, birthDD );

        if( birthDay.getFullYear() % 100 != jumin.substr( 0, 2 )
         || birthDay.getMonth() != birthMM
         || birthDay.getDate() != birthDD ) return false;

        if( ( parseInt( jumin.charAt( 7 ) ) * 10 + parseInt( jumin.charAt( 8 ) ) ) % 2 != 0 ) return false;

        var sum = 0;
        var num = [ 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5 ];
        var last = parseInt( jumin.charAt( 12 ) );

        for( var i_i_i = 0; i_i_i < 12; i_i_i++ ) sum += parseInt( jumin.charAt( i_i_i ) ) * num[ i_i_i ];

        return ( ( ( 11 - sum % 11 ) % 10 ) + 2 == last ) ? true : false;
    }


    //-----------------------------------------------------------------------------
    // »ç¾÷ÀÚ¹øÈ£ Ã¼Å©
    // XX-XXX-XXXXX
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isBizNumber = function()
    {
        var biznum = eval( "this.match(/[0-9]{3}-[0-9]{2}-[0-9]{5}$/)" );
        if( biznum == null ) return false;
        else                 biznum = biznum.toString().onlyNumber().toString();

        var sum = parseInt( biznum.charAt( 0 ) );
        var num = [ 0, 3, 7, 1, 3, 7, 1, 3 ];

        for( var i_i_i = 1; i_i_i < 8; i_i_i++ ) sum += ( parseInt( biznum.charAt( i_i_i ) ) * num[ i_i_i ] ) % 10;

        sum += Math.floor( parseInt( parseInt( biznum.charAt( 8 ) ) ) * 5 / 10 );
        sum += ( parseInt( biznum.charAt( 8 ) ) * 5 ) % 10 + parseInt( biznum.charAt( 9 ) );

        return ( sum % 10 == 0 ) ? true : false;
    }


    //-----------------------------------------------------------------------------
    // ¹ýÀÎ µî·Ï¹øÈ£ Ã¼Å©
    // XXXXXX-XXXXXXX
    // @return : boolean
    //-----------------------------------------------------------------------------
    String.prototype.isCorpNumber = function()
    {
        var corpnum = eval("this.match(/[0-9]{6}-[0-9]{7}$/)");
        if( corpnum == null ) return false;
        else                  corpnum = corpnum.toString().onlyNumber().toString();

        var sum = 0;
        var num = [ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 ]
        var last = parseInt( corpnum.charAt( 12 ) );

        for( var i_i_i = 0; i_i_i < 12; i_i_i++ ) sum += parseInt( corpnum.charAt( i_i_i ) ) * num[ i_i_i ];

        return ( ( 10 - sum % 10 ) % 10 == last ) ? true : false;
    }
    
    
    //-----------------------------------------------------------------------------
    // ÆÄÀÏ¸í¿¡¼­ È®ÀåÀÚ¸¸ ÃßÃâ
    // String
    // @return : String
    //-----------------------------------------------------------------------------
    String.prototype.getExt = function( isUpper )
    {
        var result;
        
        if( isUpper ) result = this.substring( this.lastIndexOf( "." ) + 1, this.length ).toUpperCase();
        else          result = this.substring( this.lastIndexOf( "." ) + 1, this.length );
        
        return result;
    }