
//Flash
function ieFlash(basicElement, src, trans, param, embed){
	if(!param)param="";
	if(!embed)embed="";
	html = '\
		<object '+basicElement+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">\
			<param name="movie" value="'+src+'" />\
			<param name="quality" value="best" />\
			<param name="wmode" value="'+trans+'" />\
			'+param+'\
			<embed '+basicElement+' src="'+src+'" wmode="'+trans+'" '+embed+' quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>\
		</object>\
	';
	
	document.write(html);
}
/************************************************************************************
	Internet Explorer¿¡¼­¸¸ º¸ÀÌ°Ô ÇÏ´Â ÇÔ¼ö
**************************************************************************************/
//if(navigator.userAgent.match("MSIE")==null)location.href="/etc/ie.html";
/**************************************************
	»çÁø ¸®»çÀÌÂ¡ ½ÃÅ°´Â ÇÔ¼ö 1
	»ç¿ë¹ý
		<img src="" onload="photoResize(100,100)">
****************************************************/
function photoResize(w, h){
	if(event.srcElement){
		var Owidth = w;
		var Oheight = h;
		var Oratio = Owidth/Oheight;
		
		var Pwidth = event.srcElement.width;
		var Pheight = event.srcElement.height;
		var Pratio = Pwidth/Pheight;
		
		if(Pwidth <= Owidth && Pheight <=Oheight){
		}else if(Oratio > Pratio){
			event.srcElement.height = Oheight;
		}else{
			event.srcElement.width = Owidth;
		}
	}
}
/***********************************************************************
	»çÁø ¸®»çÀÌÂ¡ ½ÃÅ°´Â ÇÔ¼ö 2 (ÃâÃ³ : Á¤¼ö¿µ¾¾?)
	»ç¿ë¹ý
		<img src="" onload="galleryResize(100,100, '/images/test.gif')">
************************************************************************/
function galleryResize(w, h, imgSrc){
	var Oratio=w/h;
	var imgObj=new Image();
	imgObj.src=imgSrc;
	var imgID=event.srcElement;
	imgObj.onload=function(){
		imgWidth=imgObj.width;
		imgHeight=imgObj.height;
		imgRatio=imgWidth/imgHeight;
		if(imgWidth<w&&imgHeight<h){
			imgID.parentElement.innerHTML='<img src="'+imgObj.src+'">';
		}else{
			if(Oratio>imgRatio){
				imgID.parentElement.innerHTML='<img src="'+imgObj.src+'" height="'+h+'">';
			}else{
				imgID.parentElement.innerHTML='<img src="'+imgObj.src+'" width="'+w+'">';
			}
		}
	}
}
//·Î±×ÀÎ ¹Ú½º ¾ÆÀÌÇÁ·¹ÀÓ ³ôÀÌ ¼³Á¤
// iframe resize Function
function parent_reSize()
{
	try{
	    var objBody	    =	login_lnfo.document.body;
	    var objFrame	=	document.all["login_lnfo"];

	    objFrame.style.height = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
		if(objFrame.style.height == "0px"){
			objFrame.style.height = "130px";
		}
	    objFrame.style.width = '208'
	}
	//An error is raised if the IFrame domain != its container's domain
	catch(e)
	{
	    //err_handle(e);
	}
}

// iframe initialize Function
function frame_init()
{
	parent.parent_reSize();
}
/**
 * checkbox¿¡¼­ ÀüÃ¼ ¼±ÅÃÇÏ´Â check box ´­·¶À» ¶§ È£ÃâµÇ´Â ÇÔ¼ö
 * @author : ÇãÁ¤¼ö
 * @date : 2004.01.15
 */
function chk_change_all( frm_name, c_all_box_name )
{
	// ÀüÃ¼ Ã¼Å©ÇÏ´Â Ã¼Å© ¹Ú½ºÀÇ ÇöÀç »óÅÂ
	var temp = eval( "document.forms." + frm_name + "." + c_all_box_name );
	
	var to_state ;
	// °³º° Ã¼Å© ¹Ú½ºÀÇ »óÅÂ¸¦ °áÁ¤
	if( temp.checked == true )
	{
		to_state = true ;
	}
	else
	{
		to_state = false ;
	}
	
	temp = eval( "document." + frm_name ) ;

	// °³º° Ã¼Å© ¹Ú½ºÀÇ »óÅÂ¸¦ º¯È­ ½ÃÅ°±â
	for( var i = 0 ; i < temp.length ; ++i )
	{
		if( temp[i].disabled == false ) 
			temp[i].checked = to_state ;
	}
} // end of change_all()

/**
 * formÀÇ checkbox¿¡ check ¾È µÈ °ÍÀÌ ÀÖ´ÂÁö °Ë»ç
 * ÇÏ³ª¶óµµ Ã¼Å©°¡ µÇ¾î ÀÖÀ¸¸é, true ¸®ÅÏ. ¾Æ´Ï¸é, false ¸®ÅÏ
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004. 01. 17
 */
function is_chk_checked( frm_name )
{
	var temp_frm = eval( "document." + frm_name ) ;

	var cnt = 0 ;

	var checked = false ;

	// loop¸¦ µ¹¸é¼­ checkµÈ °ÍÀÌ ÀÖ´ÂÁö °Ë»ç.
	for( ; cnt < temp_frm.length; ++cnt )
	{
		if( temp_frm[cnt].checked == true )
		{
			return true ;
		}
	} // end of for()

	return false ;

} // end of is_checked()

function window_open( page, name, top, left, width, height, scroll, resize )
{
	window.open( page, name,
	'toolbar=no, location=no, directories=no, status=no, ' +
	'menubar=no, scrollbars='+ scroll +', resizable='+ resize + ', width=' +
	width + ', height=' + height +
	', top=' + top + ', left=' + left );
}

function is_ssn_check( ssn1, ssn2 )
{
	check_arr = new Array( 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5 )
	buff = new Array()

	ssn_len = 13
	ssn = ssn1 + ssn2

	for( i = 0; i < ssn_len; i++ )
	{
		buff[i] = ssn.substr( i, 1 )
	}

	for( i = sum = 0; i < 12; i++ )
	{
		sum += ( buff[i] *= check_arr[i] );
	}

	if( ( ( 11 - ( sum % 11 ) ) % 10 ) != buff[12] )
		return false

	return true
}

/**
 * ¾ç/À½·Â º¯È¯ Ã¢ ¿­±â
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.02.04
 */
function open_trans()
{
	window_open( "/ro/sched/trans_sm.php", "cal", 100, 100, 500, 419 ) ;
} // end of open_trans()

/**
 * ³¯Â¥ °è»ê±â Ã¢ ¿­±â
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.02.04
 */
function open_cal()
{
	window_open( "/ro/sched/day_cal_f.php", "cal", 100, 100, 500, 417, 'toolbars=no,scrollbars=no' ) ;

} // end of open_cal()

/**
 * ÆÄÀÏ È®ÀåÀÚ ±¸ÇÏ±â
 * @author : ÇãÁ¤¼ö <wertyu@ufamiy.co.kr>
 * @date : 2004.03.27
 */
function get_file_ext( file_name )
{
	var re = /\.[a-z]*$/i ;

	var ret_val = new String(file_name.match( re ) ) ;

	return ret_val.toLowerCase() ;
} // end of get_file_ext()

/**
 * ¾Ù¹ü ÄÚ¸àÆ®¸¦ Ãâ·ÂÇÏ´Â iframeÀ» È£ÃâÇØ¼­, div id=cmt¿¡
 * ±× ³»¿ëÀ» Ãâ·ÂÇÏ±â
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.03.23
 */
function al_print_cmt( uf_no, no_type, img_no )
{
        document.all.cmt.innerHTML = 'ÄÚ¸àÆ® ³»¿ëÀ» ÀÐ¾î¿À°í ÀÖ½À´Ï´Ù.' ;
        document.all.al_hidden_frame.src = '/cm/album/al_print_cmt.php?uf_no=' + uf_no + '&no_type=' + no_type + '&img_no=' + img_no ;
} // end of al_print_cmt()

/**
 * ºê¶ó¿ìÁ® ¹öÀü ¾Ë¾Æ ¿À±â
 * ¾îÂ÷ÇÇ ¿ì¸® ºê¶ó¿ìÀú´Â IE¸¸ Áö¿øÇÏ´Ï±ñ, ºê¶ó¿ìÁ®°¡ IE¶ó´Â °¡Á¤ÇÏ¿¡ 
 * ºê¶ó¿ìÁ® ¹öÀü °¡Á®¿À±â
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.04.14
 */
function get_version()
{
	var msiestart, msieend, msiestring, msiearray, platform, msieversion ;

	msiestart = (navigator.appVersion.indexOf('(') + 1);
	msieend = navigator.appVersion.indexOf(')');
	msiestring = navigator.appVersion.substring(msiestart, msieend);
	msiearray = msiestring.split(";");
	platform = msiearray[2];
	msieversion = msiearray[1].split(" ");

	version = msieversion[2];

	return version ;

} // end of get_version()

// SELECT¿¡¼­ OnFocus() ÀÌº¥Æ® ½Ã¿¡, ¿ø·¡ °ªÀ» ÀúÀåÇØ µÐ´Ù.
var old_seled_val ;

// selectÀÇ value°¡ "12:1" ÀÏ ¶§, ':'·Î ÀÚ¸¥ µÚ µÚÀÇ ¼ýÀÚ¸¦ ¸®ÅÏ
function get_sel_val( sel )
{
        var temp = sel.options[ sel.selectedIndex].value ;
 //      var temp_arr ;

  //      temp_arr = temp.split( ":", 2 ) ;

        return parseInt( temp ) ;

}
// FocusµÉ ¶§, Focus()µÈ changeµÇ±â Àü ¿ø·¡ °ªÀ» ÀúÀå
function set_old_seled_val( focused_sel )
{
        old_seled_val = get_sel_val( focused_sel ) ;

} // end of set_old_seled_val()

function re_order_select_box( frm, seled_sel )
{
        // ¼Ò½º ÄÚµå´Â º¹ÀâÇÏÁö¸¸,
        // ±âº» °³³äÀº °£´Ü.
	// ³»°¡ ÄÚµùÀ» ¸øÇØ¼­.

        // 1.2.3.4.5. ¿¡¼­ 5¸¦ 1·Î º¯°æÇÏ¸é => 2.3.4.5.1. ÀÌ µÈ´Ù.
        // 1.2.3.4.5. ¿¡¼­ 3À» 1·Î º¯°æÇÏ¸é => 2.3.1.4.5. °¡ µÈ´Ù.

        // 1.2.3.4.5. ¿¡¼­ 1À» 5·Î º¯°æÇÏ¸é => 5.1.2.3.4. °¡ µÈ´Ù.
        // 1.2.3.4.5. ¿¡¼­ 2¸¦ 4·Î º¯°æÇÏ¸é => 1.4.2.3.5. °¡ µÈ´Ù.


        // Áï, ¿ø·¡ °ª¿¡¼­ º¯°æµÈ °ª »çÀÌ¿¡ ÀÖ´Â °ªµéÀ»
        // ´õ Å©°Ô ¹Ù²î´ÂÁö ´õ ÀÛ°Ô ¹Ù²î´ÂÁö ÆÄ¾ÇÇØ¼­,
        // ±× »çÀÌÀÇ °ªµéÀ» +1ÇØÁÖ°Å³ª -1 ÇØ ÁØ´Ù.
        var cnt = 0 ;
        var temp = seled_sel.options[ seled_sel.selectedIndex ].value ;
        var temp_arr ;

        var temp_seled_val ; // loop ¾È¿¡¼­ ÀÓÀÇ·Î »ç¿ëÇÒ º¯¼ö

        var seled_val = get_sel_val( seled_sel ) ;

        var direct ;


        // ÇöÀç °ªº¸´Ù Å« °ÍÀ¸·Î Çß´ÂÁö, ÀÛÀº °ÍÀ¸·Î Çß´ÂÁö °áÁ¤

        if( old_seled_val < seled_val )
        {
                direct = 'big' ;
        }
        else if( old_seled_val > seled_val)
        {
                direct = 'small' ;
        }
	
        // selectÀÇ ÀÌ¸§ÀÌ print_order[1] ÀÌ·± ½ÄÀÌ¶ó.
        // ÆûÀÇ ¹è¿­·Î Á¢±ÙÇÏ´Â ¹æ¹ý ÀÌ¿Þ¿£ ¾ø´Ù.
        // »ç½Ç ´Ù¸¥ ¹æ¹ýÀÌ ÀÖÀ»Áöµµ ¸ð¸£°Ú´Âµ¥
        // ³­ ¸ð¸£°Ú´Ù.
        for( cnt = 0 ; cnt < frm.length ; ++cnt )
        {
                if( frm[cnt].name.substr(0, 11) == 'print_order' )
                {
                        temp_seled_val = get_sel_val( frm[cnt] ) ;

                        if( direct == 'big' )
                        // Å« °ÍÀ¸·Î º¯°æ
                        {
                                if( temp_seled_val > old_seled_val && temp_seled_val <= seled_val && ( frm[cnt].name != seled_sel.name ) )
                                // ¹üÀ§ ¾È¿¡ ÀÖÀ¸¸é
                                {
                                        frm[cnt].selectedIndex = frm[cnt].selectedIndex - 1 ;
                                }
                        }
                        else
                        // ÀÛÀº °ÍÀ¸·Î º¯°æ
                        {
                                if( temp_seled_val >= seled_val && temp_seled_val < old_seled_val && ( frm[cnt].name != seled_sel.name ) )
                                // ¹üÀ§ ¾È¿¡ ÀÖÀ¸¸é
                                {
                                        frm[cnt].selectedIndex = frm[cnt].selectedIndex + 1 ;
                                }
                        }
                }
        }

        // old_seled_valÀ» ÇöÀçÀÇ °ªÀ¸·Î º¯°æ.
        // ÇöÀç selÀ» ´Ù½Ã °ªÀ» ¹Ù²Ù¸é,
        // onFocus() ÀÌº¥Æ®°¡ ¾È ¹ß»ýÇÏ¹Ç·Î,
        // ¹«Á¶°Ç old_seled_valÀ» ÇöÀç °ªÀ¸·Î º¯°æÇÑ´Ù.
        set_old_seled_val( seled_sel ) ;

} // end of re_order_select_box()


// FocusµÉ ¶§, Focus()µÈ changeµÇ±â Àü ¿ø·¡ °ªÀ» ÀúÀå
function set_old_seled_val2( focused_sel )
{
        old_seled_val = get_sel_val2( focused_sel ) ;

} // end of set_old_seled_val()

// selectÀÇ value°¡ "12:1" ÀÏ ¶§, ':'·Î ÀÚ¸¥ µÚ µÚÀÇ ¼ýÀÚ¸¦ ¸®ÅÏ
function get_sel_val2( sel )
{

	var temp = sel.options[ sel.selectedIndex].value ;
	var temp_arr ;

	temp_arr = temp.split( ":", 2 ) ;

	return parseInt( temp_arr[1] ) ;
}

function re_order_select_box2( frm, seled_sel )
{
        // ¼Ò½º ÄÚµå´Â º¹ÀâÇÏÁö¸¸,
        // ±âº» °³³äÀº °£´Ü.
	// ³»°¡ ÄÚµùÀ» ¸øÇØ¼­.

        // 1.2.3.4.5. ¿¡¼­ 5¸¦ 1·Î º¯°æÇÏ¸é => 2.3.4.5.1. ÀÌ µÈ´Ù.
        // 1.2.3.4.5. ¿¡¼­ 3À» 1·Î º¯°æÇÏ¸é => 2.3.1.4.5. °¡ µÈ´Ù.

        // 1.2.3.4.5. ¿¡¼­ 1À» 5·Î º¯°æÇÏ¸é => 5.1.2.3.4. °¡ µÈ´Ù.
        // 1.2.3.4.5. ¿¡¼­ 2¸¦ 4·Î º¯°æÇÏ¸é => 1.4.2.3.5. °¡ µÈ´Ù.


        // Áï, ¿ø·¡ °ª¿¡¼­ º¯°æµÈ °ª »çÀÌ¿¡ ÀÖ´Â °ªµéÀ»
        // ´õ Å©°Ô ¹Ù²î´ÂÁö ´õ ÀÛ°Ô ¹Ù²î´ÂÁö ÆÄ¾ÇÇØ¼­,
        // ±× »çÀÌÀÇ °ªµéÀ» +1ÇØÁÖ°Å³ª -1 ÇØ ÁØ´Ù.
        var cnt = 0 ;
        var temp = seled_sel.options[ seled_sel.selectedIndex ].value ;
        var temp_arr ;

        var temp_seled_val ; // loop ¾È¿¡¼­ ÀÓÀÇ·Î »ç¿ëÇÒ º¯¼ö

        var seled_val = get_sel_val2( seled_sel ) ;

        var direct ;


        // ÇöÀç °ªº¸´Ù Å« °ÍÀ¸·Î Çß´ÂÁö, ÀÛÀº °ÍÀ¸·Î Çß´ÂÁö °áÁ¤

        if( old_seled_val < seled_val )
        {
                direct = 'big' ;
        }
        else if( old_seled_val > seled_val)
        {
                direct = 'small' ;
        }
	
        // selectÀÇ ÀÌ¸§ÀÌ print_order[1] ÀÌ·± ½ÄÀÌ¶ó.
        // ÆûÀÇ ¹è¿­·Î Á¢±ÙÇÏ´Â ¹æ¹ý ÀÌ¿Þ¿£ ¾ø´Ù.
        // »ç½Ç ´Ù¸¥ ¹æ¹ýÀÌ ÀÖÀ»Áöµµ ¸ð¸£°Ú´Âµ¥
        // ³­ ¸ð¸£°Ú´Ù.
        for( cnt = 0 ; cnt < frm.length ; ++cnt )
        {
                if( frm[cnt].name.substr(0, 11) == 'print_order' )
                {
                        temp_seled_val = get_sel_val2( frm[cnt] ) ;

                        if( direct == 'big' )
                        // Å« °ÍÀ¸·Î º¯°æ
                        {
                                if( temp_seled_val > old_seled_val && temp_seled_val <= seled_val && ( frm[cnt].name != seled_sel.name ) )
                                // ¹üÀ§ ¾È¿¡ ÀÖÀ¸¸é
                                {
                                        frm[cnt].selectedIndex = frm[cnt].selectedIndex - 1 ;
                                }
                        }
                        else
                        // ÀÛÀº °ÍÀ¸·Î º¯°æ
                        {
                                if( temp_seled_val >= seled_val && temp_seled_val < old_seled_val && ( frm[cnt].name != seled_sel.name ) )
                                // ¹üÀ§ ¾È¿¡ ÀÖÀ¸¸é
                                {
                                        frm[cnt].selectedIndex = frm[cnt].selectedIndex + 1 ;
                                }
                        }
                }
        }

        // old_seled_valÀ» ÇöÀçÀÇ °ªÀ¸·Î º¯°æ.
        // ÇöÀç selÀ» ´Ù½Ã °ªÀ» ¹Ù²Ù¸é,
        // onFocus() ÀÌº¥Æ®°¡ ¾È ¹ß»ýÇÏ¹Ç·Î,
        // ¹«Á¶°Ç old_seled_valÀ» ÇöÀç °ªÀ¸·Î º¯°æÇÑ´Ù.
        set_old_seled_val2( seled_sel ) ;

} // end of re_order_select_box()

  function open_share_list( form_name, from_no, no_type, p_opener )
  {
    var param ;

    var opener ; // °øÀ¯ Ã¢¿¡¼­ opener¿¡ µû¶ó¼­
                 // °øÀ¯ Ã¢ÀÇ titleÀÌ ´Ù¸£´Ù.

    if( typeof( p_opener ) != 'undefined' )
    {
      opener = p_opener ;
    }
    else
    {
      opener = '' ;
    }

    param = '/cm/share_list/share_list.php?form_name='+form_name+'&from_no='+from_no + '&no_type='+ no_type + '&opener=' + opener  ;

    var url = "/modal/modal_wrapper.php?url_path=" + escape( param ) ;
	//sp2ÀÏ¶§¿Í ºÐ±â
    if( !is_xpsp2_error() )
    	var mp_option = "status:false; dialogWidth: 515px; dialogHeight: 393px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	else
		var mp_option = "status:false; dialogWidth: 515px; dialogHeight: 373px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
    if( window.showModelessDialog( url, window, mp_option )  )
    {
    } // end of if()
    else
    // Ãë¼Ò¸¦ ´­·¶À»¸é ¾Ï °Íµµ ¾È ÇÑ´Ù.
    {
    } // end of else

  } // end of share_list ;


/**
 * ÁÖ¹Îµî·Ï ¹øÈ£¸¦ ÀÔ·ÂÇÏ´Â Æû¿¡¼­, È£Ãâ
 * ÆûÀÇ º¯¼ö ÀÌ¸§ÀÌ °íÁ¤ÀÏ ¶§ »ç¿ë
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.04.24
 */
function check_ssn(theForm)
{
	errfound = false;
	
	var str_jumin1 = theForm.jumin1.value;
	var str_jumin2 = theForm.jumin2.value;

	var checkImg='';
	
	var i3=0
	for (var i=0;i<str_jumin1.length;i++)
	{
		var ch1 = str_jumin1.substring(i,i+1);
		if (ch1<'0' || ch1>'9')
		{
			i3=i3+1 
		}
	}

	if( (str_jumin1 == '') || ( i3 != 0 ) )
	{
		theForm.jumin1.focus() ;

		return false ;
	}
	
                 
                
	var i4=0

	for (var i=0;i<str_jumin2.length;i++)
	{
		var ch1 = str_jumin2.substring(i,i+1);
		if (ch1<'0' || ch1>'9')
		{
			i4=i4+1
		}
	}

	if ((str_jumin2 == '') || ( i4 != 0 ))
	{
		theForm.jumin2.focus() ;

		return false ;
	}

	/*
	- 04.07.30 ÇãÁ¤¼ö
	if(str_jumin1.substring(0,1) < 4)
	{
		theForm.jumin2.focus() ;

		return false ;
	}
	*/
	
	/*
	if(str_jumin2.substring(0,1) > 2)
	{
		theForm.jumin2.focus() ;

		return false ;
	}
	*/	
	if((str_jumin1.length > 6) || (str_jumin2.length > 7))
	{
		theForm.jumin2.focus() ;

		return false ;
	}

	if ((str_jumin1 == '72') || ( str_jumin2 == '18'))
	{
		theForm.jumin1.focus() ;

		return false;
	}
	
	var f1=str_jumin1.substring(0,1)
	var f2=str_jumin1.substring(1,2)
	var f3=str_jumin1.substring(2,3)
	var f4=str_jumin1.substring(3,4)
	var f5=str_jumin1.substring(4,5)
	var f6=str_jumin1.substring(5,6)
	var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
	var l1=str_jumin2.substring(0,1)
	var l2=str_jumin2.substring(1,2)
	var l3=str_jumin2.substring(2,3)
	var l4=str_jumin2.substring(3,4)
	var l5=str_jumin2.substring(4,5)
	var l6=str_jumin2.substring(5,6)
	var l7=str_jumin2.substring(6,7)

	hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
	hap=hap%11
	hap=11-hap
	hap=hap%10

	if (hap != l7) 
	{
		theForm.jumin1.focus() ;
		return false ;
	}
	
	  
	var i9=0

	return true ;
} // end of check_ssn()

/**
 * Æû¿¡¼­ Ã³¸®ÇÏ´Â°Ô ¾Æ´Ï¶ó,
 * °Á ssn1, ssn2 ¸¦ ÀÔ·ÂÇÏ¸é, true/false¸¸ ¸®ÅÏ
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.04.24
 */
function check_ssn_tf( ssn1, ssn2 )
{
	var ssn ;
	
	errfound = false;
	
	var str_jumin1 = ssn1 ;
	var str_jumin2 = ssn2 ;

	var checkImg='';
	
	var i3=0
	for (var i=0;i<str_jumin1.length;i++)
	{
		var ch1 = str_jumin1.substring(i,i+1);
		if (ch1<'0' || ch1>'9')
		{
			i3=i3+1 
		}
	}

	if( (str_jumin1 == '') || ( i3 != 0 ) )
	{
		return false ;
	}
	
                 
                
	var i4=0

	for (var i=0;i<str_jumin2.length;i++)
	{
		var ch1 = str_jumin2.substring(i,i+1);
		if (ch1<'0' || ch1>'9')
		{
			i4=i4+1
		}
	}
	if ((str_jumin2 == '') || ( i4 != 0 ))
	{
		return false ;
	}

	/* 04.07.30
	 - ÇãÁ¤¼ö
	 */
	/*
	if(str_jumin1.substring(0,1) < 4)
	{
		return false ;
	}
	*/
	
	/*
	if(str_jumin2.substring(0,1) > 2)
	{
		return false ;
	}
	*/	
	if((str_jumin1.length > 6) || (str_jumin2.length > 7))
	{
		return false ;
	}

	if ((str_jumin1 == '72') || ( str_jumin2 == '18'))
	{
		return false;
	}
	
	var f1=str_jumin1.substring(0,1)
	var f2=str_jumin1.substring(1,2)
	var f3=str_jumin1.substring(2,3)
	var f4=str_jumin1.substring(3,4)
	var f5=str_jumin1.substring(4,5)
	var f6=str_jumin1.substring(5,6)
	var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
	var l1=str_jumin2.substring(0,1)
	var l2=str_jumin2.substring(1,2)
	var l3=str_jumin2.substring(2,3)
	var l4=str_jumin2.substring(3,4)
	var l5=str_jumin2.substring(4,5)
	var l6=str_jumin2.substring(5,6)
	var l7=str_jumin2.substring(6,7)

	hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
	hap=hap%11
	hap=11-hap
	hap=hap%10

	if (hap != l7) 
	{
		return false ;
	}
	
	  
	var i9=0

	return true ;

} // end of check_ssn_tf()


function isHangul(s) 
{
	var len;

	len = s.length;

	for (var i = 0; i < len; i++)  
	{
		if (s.charCodeAt(i) != 32 && (s.charCodeAt(i) < 44032 || s.charCodeAt(i) > 55203))
		return 0;
	}

	return 1;
} // end of isHangul

function check_space( str )
{
	if( str.indexOf(" ") != -1)
	{
		str = str.replace(/\s/gi, "" );    /* '\s' is white space regular expression */
		return str;
	}
	else
	{
		return "";
	}
}  // end of check_space()

function valid_id( str )
{
	/* check whether input value is included space or not  */
	var retVal = check_space( str );

	if( retVal != "" )
	{
		alert("¾ÆÀÌµð´Â ºó °ø°£ ¾øÀÌ ¿¬¼ÓµÈ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return 0;
	}

	/* checkFormat  */
	var isID = /^[a-z0-9]{4,16}$/;
	if( !isID.test(str) )
	{
		alert("¾ÆÀÌµð´Â 4~16ÀÚÀÇ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return 0;
	}

	return 1;

} // end of valid_id()

/**
 * formÀÇ º¯¼ö °ªÀÌ, not_expect_val°ú °°À¸¸é alert(err_msg)¸¦ Ãâ·ÂÇÏ°í
 * elem.focus()¸¦ ½ÇÇà
 * elemÀº elementÀÇ ¾àÀÚ
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.04.22
 */
function check_form_var( elem, not_expect_val, err_msg )
{
	if( elem.value == not_expect_val )
	{
		alert( err_msg ) ;
		elem.focus() ;

		return false ;
	}

	return true ;

} // end of check_form_var()

/**
 * date1 < date2 : return -1
 * date1 = date2 : return 0 
 * date1 > date2 : return 1
 * @author : ÇãÁ¤¼ö <wertyu@ufamily.co.kr>
 * @date : 2004.05.04
 */
function date_diff( date1, date2 )
{
	var str1 = new String( date1 ) ;
	var str2 = new String( date2 ) ;

	var arr1, arr2 ;

	arr1 = str1.split( "-" ) ;
	arr2 = str2.split( "-" ) ;
	
	arr1[0] = parseInt( arr1[0], 10 ) ;
	arr1[1] = parseInt( arr1[1], 10 );
	arr1[2] = parseInt( arr1[2], 10 );

	arr2[0] = parseInt( arr2[0], 10 );
	arr2[1] = parseInt( arr2[1], 10 );
	arr2[2] = parseInt( arr2[2], 10 );
	
	if( arr1[0] < arr2[0] )
	{
		return -1 ;
	}
	else if( arr1[0] == arr2[0] && arr1[1] < arr2[1] )
	{
		return -2 ;
	}
	else if( arr1[0] == arr2[0] && arr1[1] == arr2[1] && arr1[2] < arr2[2] )
	{
		return -3 ;
	}
	else if( arr1[0] == arr2[0] && arr1[1] == arr2[1] && arr1[2] == arr2[2] )
	{
		return 0 ;
	}
	
	return 1 ;
} // end of date_diff()

/**
 *  Å½»ö±â ¿ÀÇÂ ½ÃÅ°±â
 */
function control_uploader_open( control_id )
{
	control_id.OpenFileDialog() ;
} // end of control_upload_open()

/**
 * ÀüÃ¼ ¼±ÅÃ
 */
function control_uploader_select_all( control_id )
{
	control_id.SelectAllItems() ;
} // end of control_upload_select_all()

/**
 * ¼±ÅÃµÈ ÆÄÀÏ Áö¿ì±â
 */
function control_uploader_del( control_id )
{
	control_id.DeleteSelectedItem() ;
} // end of control_upload_del()

/**
 * Ã·ºÎµÈ ÆÄÀÏ °³¼ö °¡Á®¿À±â
 */
function control_uploader_get_cnt( control_id )
{
	return control_id.FileCount ;
} // end of control_uploader_get_cnt()

/**
 * Ã·ºÎµÈ ÆÄÀÏ ÀÌ¸§ °¡Á®¿À±â
 * ÆÄÀÏÀº 1¹ø ºÎÅÍ ½ÃÀÛ 
 */
function control_uploader_get_filename( control_id, idx )
{
	return control_id.GetFileName( idx ) ;
} // end of control_uploader_get_filename()

/**
 * »èÁ¦µÈ ÆÄÀÏ °³¼ö °¡Á®¿À±â
 */
function control_uploader_del_cnt( control_id )
{
	return control_id.DeletedFileIDCount ;

} // end of control_uploader_del_cnt()

/**
 * »èÁ¦µÈ ÆÄÀÏ id¸¦ °¡Á®¿À±â
 */
function control_uploader_del_list( control_id, i )
{
	return control_id.GetDeletedFileID( i ) ;
} // end of control_uploader_del_list()

function open_ud( img_path, caller )
{
	// 1. img_path¸¦ escape() ÇØ ÁÖ±â
	var org_path ;
	
	org_path = escape( img_path ) ;

	window.open( 'http://www.ufamily.co.kr/cm/ud/ud.php?caller='+caller+'&org_path='+org_path, 'UltraDrawing',  'width=1024, height=708, scrollbars=no, left=0, top=0');
} // end of open_ud()

/**
 * C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\uf82.png
 * ·ÎºÎÅÍ uf82.png¸¦ °¡Á®¿À±â
 */
function get_filename_src( src )
{
	var tmp = src.split( "\\" ) ;
	var cnt = count( tmp ) ;

	return tmp[cnt-1] ;
} // end of get_filename_src()

function send_image_phone_link( hostname, img_src )
{
	sendimg.host.value = hostname ;
	sendimg.img.value = img_src ;
	sendimg.com.value  = 'ufamily' ;

	window.open("","photo","width=706,height=685,status=no");
	sendimg.target="photo";
	sendimg.action="http://www.photoyo.com/pmail/pmail.jsp";
	sendimg.submit();
}

//¸µÅ© Á¡¼± ¾ø¾Ö´Â ÇÔ¼ö
/**
*¸µÅ©Á¡¼± ¾ø¾Ö´Â ÇÔ¼ö¸¦ ¿©·¯±ºµ¥ ½á¼­ doc_root¿¡ ÇÏ³ª¸¸ µÎ°í ÁÖ¼® Ã³¸® ÇÕ´Ï´Ù.(7¿ù 22ÀÏ °íÈñÇö)
function window::onload()
{
	for (i = 0; i < document.links.length; i++)
	{
		document.links[i].onfocus = document.links[i].blur;
	}
}
**/
function jumin_next(elem1,elem2,size)
{     // ÁÖ¹Î¹øÈ£ valid check , ÀÚµ¿ ´ÙÀ½ Æû ÀÌµ¿

   num = elem1.value ;
   siz = num.length;
   numFlag = Number(num);
   if(!numFlag && siz > 1 && num != '00' &&  num != '000'){
         alert('¼ýÀÚ¸¦ ³Ö¾îÁÖ¼¼¿ä');
	 elem1.focus() ;
         return false;
   }

   if(siz == size){
	  elem2.focus() ;
	  return true;
   }

} // end of next()

function get_txt_length( str )
{
	var curText ;
	var strLen ;
	var byteIs ;
	var lastByte ;
	var thisChar ;
	var escChar ;

	curText = new String( str ) ;
	strLen = curText.length ;

	byteIs = 0 ;

        for(i=0; i<strLen; i++)
        {
                thisChar = curText.charAt(i);
                escChar = escape(thisChar);

                if (escChar.length > 4)
                {
                        byteIs += 2;
                }
                else
                {
                        byteIs += 1;
                }
                lastByte = byteIs;
        }

	return lastByte ;

} // end of get_txt_length()

function set_text_len( elem, len )
{
	var txt = elem.value ;
	var txt_len = get_txt_length( txt ) ;

	len = parseInt( len ) ;
	if( parseInt( txt_len ) > parseInt( len ) )
	{
		alert('ÃÖ´ë ' + len + 'Bytes±îÁö¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù ^^' ) ;
		elem.value = my_substr( txt, len ) ;
	}

} // end of set_text_len()

/**
 * ÇÑ±ÛÀ» °í·ÁÇÑ substring()
 * @author : ÇãÁ¤¼ö
 * @date   : 2004.07.15
 */
function my_substr( txt, len )
{
        var curText;
        var strLen;
        var byteIs;
        var lastByte;
        var thisChar;
        var escChar;

        curText = new String(txt);
        strLen = curText.length;
        byteIs = 0;

        for(i=0; i<strLen; i++)
        {
                thisChar = curText.charAt(i);
                escChar = escape(thisChar);

                if (escChar.length > 4)
                {
                        byteIs += 2;
                }
                else
                {
                        byteIs += 1;
                }

                if (byteIs > len)
		// ´õ Å©¸é, Áö±Ý µ· °Å ±îÁö¸¸ return
                {
                        thisText = curText.substring(0, i);
                        byteIs = lastByte;

			return thisText ;
                        break;
                }

                lastByte = byteIs;
        }

	return txt ;

} // end of my_substr()

//
// rect_w, rect_h : ÀÌ¹ÌÁö°¡ º¸¿©Áú ºÎºÐ »ç°¢ÇüÀÇ width, height
// img_w, img_h   : ÀÌ¹ÌÁöÀÇ width, height
// return         : new_w:new_h
function get_size_img( rect_w, rect_h, img_w, img_h )
{
	var new_w, new_h ;

	if( img_w <= rect_w && img_h <= rect_h )
	// width, height ¸ðµÎ Å« °æ¿ì
	// width¿¡ °íÁ¤
	{
		new_w = img_w ;
		new_h = img_h ;
	}
	else if( img_w / img_h > rect_w / rect_h )
	// °¡·Î ºñÀ²ÀÌ ´õ Å« °æ¿ì.
	{
		new_w = rect_w ;
		new_h = img_h * ( new_w / img_w ) ;
	}
	else 
	// ¼¼·Î ºñÀ²ÀÌ ´õ Å« °æ¿ì.
	{
		new_h = rect_h ;
		new_w = img_w * ( new_h / img_h ) ;
	}

	return new_w + ":" + new_h ;

} // end of get_size_img()

/**
 * ºí·Ï, °¡Á· È¨ÇÇ µî¿¡¼­ 
 * POPup ÇüÅÂ·Î ¶ß´Â ·Î±ä Ã¢
 * @author : ÇãÁ¤¼ö
 * @date : 2004.07.06
 */
function go_pop_login()
{
	window.open('/user/pop_login/pop_login_f.php','pop_login','width=440,height=380')
} // end of go_pop_login()

/**
 * user_id¿¡°Ô ÂÊÁö º¸³»±â
 * @author : ÇãÁ¤¼ö
 * @date : 2004.07.08
 */
function go_memo( user_no )
{
	window.open('/ro/memo/send_f.php?from=quick&no_list='+user_no,'','width=430px,height=260px')
} // end of go_memo()

function go_guest_folder( user_dom, user_id )
{
	window.open( "http://mail."+user_dom + "/template/mail.ufamily.co.kr/t_login_web_folder_guest.html?user_id=" +user_id , "", 'status=yes,toolbars=no,width=1011,height=703,resizable=yes') ;
}

function go_webfolder()
{
	var user_dom = getCookie( "USER_DOM" ) ;

	window.open( "http://mail." + user_dom + "/servlet/login?_route=web_folder" , "", 'status=yes,toolbars=no,width=1011,height=703,resizable=yes') ;
}

function setCookie( name, value, expiredays ) 
{ 
        var todayDate = new Date(); 
        todayDate.setDate( todayDate.getDate() + expiredays ); 
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 

} // end of setCookie()

function getCookie( 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 "";

} // end of getCookie()

// ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ´Â ÇÊµå¿¡¼­
// keyPress ÀÌº¥Æ® ½Ã¿¡ È£ÃâÇØ ÁÖ¸é
// ¼ýÀÚ¸¸ ÀÔ·ÂÇÏµµ·Ï ÇØ ÁØ´Ù.
function only_digit()
{
	var key = window.event.keyCode ;
	if( key < 48 || key > 57 )
	{
		alert( '¼ýÀÚ¸¸ ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.' ) ;
		event.returnValue = false ;
	}
} // end of only_digit()

// °Ô½Ã¹° »èÁ¦½Ã ÆË¾÷Ã¢À» ¿ÀÇÂÇÏ¿© ºñ¹Ð¹øÈ£¸¦ ÀÔ·Â ¹Þ´Â´Ù.
function open_pop_del(frm_name, cmt_no)
{
	window.open('/cm/pop_del.php?form='+frm_name+'&cmt_no='+cmt_no,'pop_del','width=265,height=180');
} // end open_pop_del()

// À¯ÆÔ ¸Ó´Ï ÃæÀü Ã¢ ¶ç¿ì±â
function open_charge_win( mode )
{
	// mode : C = ÃæÀü¸¸
	//      : P = ¹º°¡ °áÁ¦ÇÒ °Ô ÀÖÀ» ¶§ °áÁ¦µµ °°ÀÌ º¸¿©ÁÖ±â
	if( typeof( mode ) == 'undefined' )
		mode = 'C' ;
	
	var charge_win ;
	var options = "" ;
	
	if( mode == 'C' )
	{
		options = "width=420,height=580" ;
	}
	else if( mode == 'P' )
	{
		options = "width=440,height=576,scrollbars=yes" ;
	}

		
	charge_win = window.open('/li/manage/ec/charge_f.php?mode=' + mode,'charge_win', options);

	charge_win.focus() ;

} // end of open_charge_win()

/**
 * ±â°£ º° SMS °Å·¡ ³»¿ª º¸±â
 * @author : ÇãÁ¤¼ö <wertyu@ufam.co.kr>
 * @date : 2004.10.28
 */
function open_sms_send_list()
{

	var sms_win ;
	var s_y, s_m, s_d ;
	var e_y, e_m, e_d ;

	var param = '' ;

	if( typeof( document.frm ) != 'undefined' )
	{
		if( typeof( document.frm.s_y ) != 'undefined' ) 
		{
			s_y = document.frm.s_y.value ;
			s_m = document.frm.s_m.value ;
			s_d = document.frm.s_d.value ;

			e_y = document.frm.e_y.value ;
			e_m = document.frm.e_m.value ;
			e_d = document.frm.e_d.value ;

			param = "real_click=T&s_y=" + s_y + "&s_m=" + s_m + "&s_d=" + s_d + "&e_y=" + e_y + "&e_m=" + e_m + "&e_d=" + e_d ;
		}

	}

	options = "width=440,height=400" ;
		
	sms_win = window.open('/li/manage/ec/sms_list.php?' + param, 'sms_win', options);

} // end of open_sms_send_list()

/**
 * ±â°£ º° ÀÎÅÍ³ÝÆù °Å·¡ ³»¿ª º¸±â
 * @author : ÇãÁ¤¼ö <wertyu@ufam.co.kr>
 * @date : 2004.10.28
 */
function open_iphone_send_list()
{

	var voip_win ;
	var s_y, s_m, s_d ;
	var e_y, e_m, e_d ;

	var param = '' ;

	if( typeof( document.frm ) != 'undefined' )
	{
		if( typeof( document.frm.s_y ) != 'undefined' ) 
		{
			s_y = document.frm.s_y.value ;
			s_m = document.frm.s_m.value ;
			s_d = document.frm.s_d.value ;

			e_y = document.frm.e_y.value ;
			e_m = document.frm.e_m.value ;
			e_d = document.frm.e_d.value ;

			param = "real_click=T&s_y=" + s_y + "&s_m=" + s_m + "&s_d=" + s_d + "&e_y=" + e_y + "&e_m=" + e_m + "&e_d=" + e_d ;
		}

	}

	options = "width=470,height=410,scrollbars=yes" ;
		
	voip_win = window.open('/li/manage/ec/iphone_list.php?' + param, 'voip_win', options);

} // end of open_sms_send_list()

/**
 * ¿ë·® º¯°æ ³»¿ª Á¶È¸ Ã¢ ¶ç¿ì±â
 * @author : ÇãÁ¤¼ö <wertyu@ufam.co.kr>
 * @date : 2004.11.02
 */
function open_quota_change_list()
{

	var quota_win ;
	var s_y, s_m, s_d ;
	var e_y, e_m, e_d ;

	var param = '' ;

	if( typeof( document.frm ) != 'undefined' )
	{
		if( typeof( document.frm.s_y ) != 'undefined' ) 
		{
			s_y = document.frm.s_y.value ;
			s_m = document.frm.s_m.value ;
			s_d = document.frm.s_d.value ;

			e_y = document.frm.e_y.value ;
			e_m = document.frm.e_m.value ;
			e_d = document.frm.e_d.value ;

			param = "real_click=T&s_y=" + s_y + "&s_m=" + s_m + "&s_d=" + s_d + "&e_y=" + e_y + "&e_m=" + e_m + "&e_d=" + e_d ;
		}

	}

	options = "width=440,height=400" ;
		
	quota_win = window.open('/li/manage/quota/quota_change_list.php?' + param, 'quota_win', options);

} // end of open_quota_change_list()

/**
 * °íÈñÇö. 04.11.03
 */
function open_quick()
{
        go_agent_login(agent_login);
}

function is_xpsp2()
{
	var strVerStr = window.navigator.appVersion;
	var arrVerStr = strVerStr.split('; ');

	if( arrVerStr.length >= 4 )
	{
		var arrOsVer = arrVerStr[2].split(' ');

		if( arrOsVer.length >= 3 && arrOsVer[0] == "Windows" )
		{
			var osVerNum = new Number(arrOsVer[2]);

			if( osVerNum >= 5.1 && strVerStr.indexOf("SV1") >= 35 ) 

				return true;
		}
	}

	return false;

} // end of is_xpsp2()

/**
 * login ÆäÀÌÁö¿¡¼­¸¸ ¾µ ¼ö ÀÖÀ½
 */
function is_xpsp2_error()
{
	// Äü ¼­ºñ½ºÀÇ °æ¿ì, update=no·Î ³Ñ¾î ¿À±â ¶§¹®¿¡
	// OBJECT Tag°¡ ¾ø´Ù.
	// µû¶ó¼­, UltraLiveUpdate°¡ ¾Æ¿¹ ¾ø¾î¼­,
	// undefinedÀÌ¹Ç·Î,
	// false¸¦ return
	
	if( typeof( Uploader ) == 'undefined' )
	{
		return false ;
	}
	if( typeof( RemoteAgent ) == 'undefined' )
	{
		return false ;
	}
	if( typeof( UltraLiveUpdate ) == 'undefined' )
	{
		return false ;
	}

	var obj_type1 = typeof( Uploader.SelectAllItems ) ;
	var obj_type2 = typeof( RemoteAgent.IsAgentLoggedIn ) ;
	var obj_type3 = typeof( UltraLiveUpdate.UpdateAx ) ;
	
	if( obj_type1 == 'undefined' || obj_type2 == 'undefined' || obj_type3 == 'undefined' )
	{
		if( is_xpsp2() )
		{
			return true ;
		}
	}

	return false ;
} // end of is_error()

function is_xpsp2_error_news()
{
	var obj_type1 = typeof( document.NewsEditor.IsEmpty ) ;
	
	if( obj_type1 == 'undefined' )
	{
		if( is_xpsp2() )
		{
			return true ;
		}
	}

	return false ;
} // end of is_error()
/*½Å±Ô ¸ÞÀÎ °ü·Ã ½ºÅ©¸³Æ® ½ÃÀÛ*/

//³»¹æ¹æ¹®

function visit_ro_my( cmd )
{
	visit_ro( '', cmd ) ;
}

function visit_ro(owner, cmd)
{
	var cmd = (cmd) ? cmd : "" ;
	var obj = window.open( "http://www.ufamily.co.kr/ro/?owner="+owner+"&cmd="+cmd, "ufam_main", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
	obj.focus();
}
//°Å½Ç¹æ¹®
function visit_li(owner, cmd)
{
	var obj = window.open( "http://www.ufamily.co.kr/li/?owner="+owner+"&cmd="+cmd, "ufam_main", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
	obj.focus();
}
function go_visit( no_type, user_no, ufam_no, cmd )
{
	if( no_type == 'P' )
	{
		visit_ro( user_no, cmd ) ;
	}
	else if( no_type == 'F' )
	{
		visit_li( ufam_no, cmd ) ;
	}

} // end of go_visit()

//ÇÃ·¡½Ã ¸Þ´º ½ºÅ©¸³Æ®
function go_page2(num){
	var page_str = new Array();
	page_str[0]= "/index.php";
	page_str[1]= "/ma/html/whatufam01.php";
	//page_str[2]= "Ä«Æä";
	//page_str[3]= "¼îÇÎ¸ô";
	if(num != '2' && num != '3'){
		location.href = page_str[num];
	}
	if(num == '3'){
		alert("ÁØºñÁß ÀÔ´Ï´Ù.");
	}
}

//¸ÞÀÎ INPUT BOX¹è°æ
function chk_idname2(){
	if(document.frm.id.value==''){
		document.frm.id.style.backgroundImage="url('/images/index/bg_id.gif')";
	}
}
function chk_pwname2(){
	if(document.frm.passwd.value==''){
		document.frm.passwd.style.backgroundImage="url('/images/index/bg_pw.gif')";
	}
} 

//·¹ÀÌ¾î À§Ä¡ °ü·Ã ½ºÅ©¸³Æ®
function reset_layer(){
	layer_height = document.all.layer_doc.scrollHeight;	
	document.all.bg_layer.style.height = layer_height;
}

//ÀÌ¸ÞÀÏ ÁÖ¼Ò ¹«´Ü¼öÁý °ÅºÎ 
function open_emailnot(){
	email_not = window.open("/ma/html/pop_emailnot.html","pop_email","width=520,height=180,scrollbars=no");
	email_not.focus();
}

//BestUFAM
function what_best(){
	best_not = window.open("/ma/html/pop_best.html","pop_best","width=450,height=645,scrollbars=no");
	best_not.focus();
}

//»õ³»±â ·¹º§¿Õ
function what_newking(){
	level_not = window.open("/ma/html/pop_what_level.html","pop_level","width=450,height=559,scrollbars=no");
	level_not.focus();
}

//È­¸ñÁö¼ö¿Õ
function what_happy(){
	happy_not = window.open("/ma/html/pop_what_happy.html","pop_happy","width=450,height=559,scrollbars=no");
	happy_not.focus();
}

//¿À´ÃÀÇ ¾Ù¹ü ½ÅÃ»
function apply_album(){
	screen_w=screen.availWidth;
	screen_h=screen.availHeight;
	screen_h2 = screen_h-10;
	popWidth = 344;
	popHeight = 436;
	popLeft=(screen_w-popWidth)/2;
	popTop=(screen_h-popWidth)/2;
	apply_ab = window.open("/ma/aotd/apply_f.php","pop_ab","width="+popWidth+",height="+popHeight+",left="+popLeft+",top="+popTop+",scrollbars=no");
	apply_ab.focus();
}

//»õ·Î¿î °¡Á· ½Å¹® ½ÅÃ»
function apply_np(){
	screen_w=screen.availWidth;
	screen_h=screen.availHeight;
	screen_h2 = screen_h-10;
	popWidth = 400;
	popHeight = 500;
	popLeft=(screen_w-popWidth)/2;
	popTop=(screen_h-popWidth)/2;
	apply_np = window.open("pop_apply_np.html","pop_np","width="+popWidth+",height="+popHeight+",left="+popLeft+",top="+popTop+",scrollbars=no");
	apply_np.focus();
}
/*½Å±Ô ¸ÞÀÎ °ü·Ã ½ºÅ©¸³Æ® ³¡*/

function mouseDown(e) {
	if(user_detail)
	{
		event_target = event.srcElement.tagName;

		if(event_target!="A") 
		{
			if(user_detail.style.display == "block")
			{
				user_detail.style.display			= "none";
			}
		}
	}
}

document.onclick	= mouseDown;
var	user_detail		= "";

function get_user_detail(ufam_no, user_no)
{
	if(user_no=="")
	{
		alert('Ä£±¸Á¤º¸°¡ ¾ø½À´Ï´Ù.');
	}
	else
	{
		if(event.srcElement.tagName=="A") 
		{
			if(user_detail)
			{
				user_detail.innerHTML	= "";
				document.body.removeChild(user_detail);
			}

			user_detail = document.createElement("div") ;
			document.body.appendChild(user_detail) ;

			var con = "";
			/*			
			con += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='72' height='80' id='tooltip' align='middle'>";
			con += "<param name='allowScriptAccess' value='sameDomain'>";
			con += "<param name='movie' value='/images/index/tooltip.swf?user_no="+user_no+"&ufam_no="+ufam_no+"'>";
			con += "<param name='quality' value='high'>";
			con += "<param name='wmode' value='transparent'>";
			con += "<embed src='/images/index/tooltip.swf?user_no="+user_no+"&ufam_no="+ufam_no+"' quality='high' wmode='transparent' width='72' height='80' name='tooltip' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>";
			con += "</object>";
			*/

                        con += "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border:solid 1px #C7C7C7\">";
                        con += "<tr>";
                        con += "        <td bgcolor=\"#FFFFFF\" style=\"padding:4 2 4 2\">";
                        con += "                <table cellpadding=\"0\" cellspacing=\"1\" border=\"0\">";
                        con += "                <tr>";
                        con += "                        <td><a href='http://www.ufamily.co.kr/ma/common/get_user_detail.php?mode=LI&user_no="+user_no+"&ufam_no="+ufam_no+"' target='user_detail_frame'><img src=\"http://www.ufamily.co.kr/images/index2/tip01.gif\" alt=\"°Å½Ç¹æ¹®\" width=\"50\" height=\"16\" border=\"0\" onmouseover=\"this.src='http://www.ufamily.co.kr/images/index2/tip01_on.gif'\" onmouseout=\"this.src='http://www.ufamily.co.kr/images/index2/tip01.gif'\"></a></td>      ";
                        con += "                </tr>";
                        con += "                <tr>";
                        con += "                        <td><a href='http://www.ufamily.co.kr/ma/common/get_user_detail.php?mode=RO&user_no="+user_no+"' target='user_detail_frame'><img src=\"http://www.ufamily.co.kr/images/index2/tip02.gif\" alt=\"³»¹æ¹æ¹®\" width=\"50\" height=\"16\" border=\"0\" onmouseover=\"this.src='http://www.ufamily.co.kr/images/index2/tip02_on.gif'\" onmouseout=\"this.src='http://www.ufamily.co.kr/images/index2/tip02.gif'\"></a></td>";
                        con += "                </tr>";
                        con += "                <tr>";
                        con += "                        <td><a href='http://www.ufamily.co.kr/ma/common/get_user_detail.php?mode=AF&user_no="+user_no+"' target='user_detail_frame'><img src=\"http://www.ufamily.co.kr/images/index2/tip03.gif\" alt=\"Ä£±¸½ÅÃ»\" width=\"50\" height=\"16\" border=\"0\" onmouseover=\"this.src='http://www.ufamily.co.kr/images/index2/tip03_on.gif'\" onmouseout=\"this.src='http://www.ufamily.co.kr/images/index2/tip03.gif'\"></a></td>";
                        con += "                </tr>";
                        con += "                </table>";
                        con += "        </td>";
                        con += "</tr>";
                        con += "</table>";

/*
			con += "<table cellpadding='0' cellspacing='0' border='0' width='125' height='54' background='/images/index/bg_quickbox.gif' style='table-layout:fixed'>";
			con += "<tr valign='top'>";
			con += "<td width='59' height='32' style='padding:14 0 0 5'>";
			con += "<a href='/ma/common/get_user_detail.php?mode=LI&user_no="+user_no+"&ufam_no="+ufam_no+"' target='user_detail_frame'><img src='/images/index/bt_quick01.gif' alt='°Å½Ç ¹æ¹®' width='54' height='18' border='0' onmouseover='this.src=\"/images/index/bt_quick01_on.gif\"' onmouseout='this.src=\"/images/index/bt_quick01.gif\"'></a>";
			con += "</td>";
			con += "<td style='padding:14 0 0 8'>";
			con += "<a href='/ma/common/get_user_detail.php?mode=AF&user_no="+user_no+"' target='user_detail_frame'><img src='/images/index/bt_quick03.gif' alt='Ä£±¸ ½ÅÃ»' width='54' height='18' border='0' onmouseover='this.src=\"/images/index/bt_quick03_on.gif\"' onmouseout='this.src=\"/images/index/bt_quick03.gif\"'></a>";
			con += "</td>";
			con += "</tr>";
			con += "<tr valign='top'>";
			con += "<td style='padding:0 0 0 5'>";
			con += "<a href='/ma/common/get_user_detail.php?mode=RO&user_no="+user_no+"' target='user_detail_frame'><img src='/images/index/bt_quick02.gif' alt='³»¹æ ¹æ¹®' width='54' height='18' border='0' onmouseover='this.src=\"/images/index/bt_quick02_on.gif\"' onmouseout='this.src=\"/images/index/bt_quick02.gif\"'></a>";
			con += "</td>";
			con += "<td></td>";
			con += "</tr>";
			con += "</table>";
*/

/*
			con += "<table border='1' bgcolor='red'>";
			con += "<tr><td>";
			con	+= "<img style='width:2; height:11; background:#333;' align='top'> <a href='/ma/common/get_user_detail.php?mode=RO&user_no="+user_no+"' target='user_detail_frame' class=list>Ä£±¸ ¹æ¹®</a>";
			con += "</td></tr>";
			con += "<tr><td>";
			con	+= "<img style='width:2; height:11; background:#333;' align='top'> <a href='/ma/common/get_user_detail.php?mode=LI&user_no="+user_no+"&ufam_no="+ufam_no+"' target='user_detail_frame' class=list>°Å½Ç ¹æ¹®</a>";
			con += "</td></tr>";
			con += "</table>";
*/
			con += "<iframe name='user_detail_frame' width='0' height='0'></iframe>";

			user_detail.style.position		= "absolute";
			user_detail.style.zIndex 			= "1000";

			user_detail.style.posTop			= (document.body.scrollTop + event.clientY);
			user_detail.style.posLeft			= (document.body.scrollLeft + event.clientX - 30);
			user_detail.style.posWidth		= 300;
			user_detail.style.posHeight		= 300;
			user_detail.innerHTML					= con;
			user_detail.style.display			= "block";
		}
		else {
			user_detail.style.display			= "none";
		}
	}
}

function get_user_send( user_no )
{
	if(user_no=="")
	{
		alert('Ä£±¸Á¤º¸°¡ ¾ø½À´Ï´Ù.');
	}
	else
	{
		if(event.srcElement.tagName=="A") 
		{
			if(user_detail)
			{
				user_detail.innerHTML	= "";
				document.body.removeChild(user_detail);
			}

			user_detail = document.createElement("div") ;
			document.body.appendChild(user_detail) ;

			var con = "";			

			con += "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border:solid 1px #C7C7C7\">";
			con += "<tr>";
			con += "        <td bgcolor=\"#FFFFFF\" style=\"padding:4 2 4 2\">";
			con += "                <table cellpadding=\"0\" cellspacing=\"1\" border=\"0\">";
			con += "                <tr>";
			con += "                        <td><a href='/admin/crm/msg_action.php?action=mail&user_no="+user_no+"' target='user_detail_frame'><img src=\"/admin/images/msg01.gif\" alt=\"°Å½Ç¹æ¹®\" border=\"0\" onmouseover=\"this.src='/admin/images/msg01_on.gif'\" onmouseout=\"this.src='/admin/images/msg01.gif'\"></a></td>      ";
			con += "                </tr>";
			con += "                <tr>";
			con += "                        <td><a href='/admin/crm/msg_action.php?action=memo&user_no="+user_no+"' target='user_detail_frame'><img src=\"/admin/images/msg02.gif\" alt=\"³»¹æ¹æ¹®\" border=\"0\" onmouseover=\"this.src='/admin/images/msg02_on.gif'\" onmouseout=\"this.src='/admin/images/msg02.gif'\"></a></td>";
			con += "                </tr>";
			con += "                <tr>";
			con += "                        <td><a href='/admin/crm/msg_action.php?action=sms&user_no="+user_no+"' target='user_detail_frame'><img src=\"/admin/images/msg03.gif\" alt=\"Ä£±¸½ÅÃ»\" border=\"0\" onmouseover=\"this.src='/admin/images/msg03_on.gif'\" onmouseout=\"this.src='/admin/images/msg03.gif'\"></a></td>";
			con += "                </tr>";
			con += "                </table>";
			con += "        </td>";
			con += "</tr>";
			con += "</table>";

			con += "<iframe name='user_detail_frame' width='0' height='0'></iframe>";

			user_detail.style.position		= "absolute";
			user_detail.style.zIndex 		= "1000";

			user_detail.style.posTop		= (document.body.scrollTop + event.clientY);
			user_detail.style.posLeft		= (document.body.scrollLeft + event.clientX - 30);
			user_detail.style.posWidth		= 300;
			user_detail.style.posHeight		= 300;
			user_detail.innerHTML					= con;
			user_detail.style.display			= "block";
		}
		else {
			user_detail.style.display			= "none";
		}
	}
}

function array_push(array, val)
{
	var length = array.length ;
	array[length] = val ;
}


/**
 * ¼ýÀÚ¸¸ ÀÔ·ÂµÇ´Â ÇÊµå¿¡¼­ onKeyPress¿¡ È£Ãâ 
 */
function only_num()
{
        // ¼ýÀÚ¸¸ ÀÔ·ÂµÇµµ·Ï ÇÑ´Ù.
        if( event.keyCode >= 48 && event.keyCode <= 57 )
        {
                event.returnValue = true ;
        }
        else
        {
                event.returnValue = false ;
        }
} // end of only_num()

/*
 * ÀÌ¹ÌÁö°¡ ¾øÀ» ¶§. ÁØºñ ÁßÀÔ´Ï´Ù. ÀÌ¹ÌÁö·Î ±³Ã¼
 * @author ÇãÁ¤¼ö <mysqlguru@hotmail.com>
 * @date 2005.09.09
 */
function img_onerror( img_id, type )
{
	if( type == 1 )
	// 100x100 ÀÌ¹ÌÁö·Î »Ñ¸®±â
	{
		img_id.src = '/images/img_onerror_100.jpg' ;
	}
	else
	// 310x310 ÀÌ¹ÌÁö·Î »Ñ¸®±â
	{
		img_id.src = '/images/img_onerror_310.jpg' ;
	}

	img_id.style.border=0 ;
} // end of img_replace()

function no_work()
{
	var msg = '°ü¸®ÀÚ ¸ðµå¿¡¼­´Â ÇØ´ç ¸µÅ©¸¦ Å¬¸¯ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.' ;
	alert( msg ) ;
}

// Array °ü·Ã ÇÔ¼ö
/**
 * obj¿¡ ¼ÓÇÑ <a>ÀÇ href ¼Ó¼º°ú onClick ¼Ó¼ºÀ» ¸ðµÎ ÇØÁ¦
 */
function remove_link( obj )
{

	var msg = '°ü¸®ÀÚ ¸ðµå¿¡¼­´Â ÇØ´ç ±â´ÉÀ» ÀÌ¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.' ;
        if ( !obj ) return '' ;
        if ( !obj.all ) return '' ;
        if ( obj.all.length == 0 ) return '' ;
        var str = '' ;
        for (var cnt=0; cnt < obj.all.length; cnt++)
        {
                if ( obj.all[cnt].nodeName == "A" )
                {
                        obj.all[cnt].href = "javascript:alert('"+msg+"')" ;
                        obj.all[cnt].target = '' ;
                }

                if( obj.all[cnt].onclick != null )
                {
                        obj.all[cnt].onclick = no_work ;
                }

        }

} // end of remove_link()


if( ! Array.prototype.my_push )
{
	Array.prototype.my_push = function( val ) 
	{
		//logger( "pushed : " + val ) ;
		this[this.length ] = val ;
	}
}

// Array¿¡¼­ ÁöÁ¤µÈ idx¿¡¼­ »èÁ¦
if( !Array.prototype.my_remove_idx )
{
	Array.prototype.my_remove_idx = function( idx )
	{
		if( isNaN(idx) || idx > this.length )
			return false;

		//logger( "remove:" + idx );
		for( var cnt = idx; cnt < this.length ; cnt++ )
		{
			this[cnt] = this[cnt+1];
		}

		this.length-=1;
	}

}

// Array¿¡¼­ ÁöÁ¤µÈ idx¿¡ INSERT. ±× µÚ °ÍµéÀº ¹Ð¸®°í
if( ! Array.prototype.my_add_idx )
{
	Array.prototype.my_add_idx = function( idx, val )
	{
		//logger( "added:" + idx + ":" + val ) ;
		if( isNaN(idx) || idx > this.length )
			return false;
		
		if( idx > this.length ) 
		{
			alert( 'idx is bigger than array length' );
			return ;
		}
		
		this.length += 1 ;

		for( var i = this.length - 1 ; i > idx ; i-- )
		{
			this[i] = this[i-1] ;
		}
		

		this[idx] = val ;

	}
}


function outObject(src, addition, param, embed)
{
        var html = "";
        html = '\
                <object '+addition+' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">\
                        <param name="movie" value="'+src+'">\
                        <param name="quality" value="best">\
                        '+param+'\
                        <embed '+addition+' src="'+src+'" '+embed+' quality="best" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">\
                </object>\
        ';
        document.write(html);
} // end of outObject()


function Comma(input) 
{
	var inputString = new String;
	var outputString = new String;
	var counter = 0;
	var decimalPoint = 0;
	var end = 0;

	inputString=input.toString();
	outputString='';
	decimalPoint = inputString.indexOf('.', 1);

	if (decimalPoint == -1) 
	{
		end = inputString.length - (inputString.charAt(0)=='-' ? 1 : 0);
		for (counter=1; counter <= inputString.length; counter++) 
		{
			outputString = (counter%3==0  && counter < end ? ',' : '') + inputString.charAt(inputString.length - counter) + outputString;
        	}
	}
	else
	{
		end = decimalPoint  - (inputString.charAt(0)=='-' ? 1 : 0);
		for (counter=1; counter <=  decimalPoint; counter++)    
		{
			outputString = (counter%3==0  && counter < end ? ',' : '') + inputString.charAt(decimalPoint - counter) + outputString;
		}
		for (counter=decimalPoint; counter <inputString.length; counter++)              {
			outputString += inputString.charAt(counter);
		}
	}

    return (outputString);
} // end of Comma()

// »ç¿ëÀÚÁ¤º¸¼öÁ¤ ÆË¾÷(°øÅë)
function user_edit_intro()
{
	var join_win=window.open("/user//user_info_edit.php","join_pop","scrollbars=no,resizable=no,top=50,left=50,width=600,height=538");
	join_win.focus();
}

//-------------------------------------------------------------------
// °ø¹é Ã¼Å©ÇÏ´Â ÇÔ¼ö
//-------------------------------------------------------------------
function checkSpace( str )
{
     if(str.search(/\s/) != -1){
     	return 1;
     }

     else {
         return "";
     }
}

/**
* ÄÚ¸àÆ® ´Þ±â
*/
function go_add_cmt( img_no )
{
	var frm = eval( "document.frm_" + img_no );
	var al_frm = document.al_list_frm ;
	// ·Î±ä ¾È ÇÑ »ç¶÷ÀÇ °æ¿ì
	if( !al_frm.writer_no.value )	
	{
		if( frm.writer_name.value == '' || frm.writer_name.value == 'ÀÌ¸§' )
		{
			alert( 'ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä' ) ;
			frm.writer_name.focus() ;
			return ;
		}
		else if( frm.passwd.value == "" || frm.passwd.value == 'ºñ¹Ð¹øÈ£' )
		{
			alert( '¾ÏÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä' ) ;
			frm.passwd.focus() ;
			return ;
		}	
		al_frm.writer_name.value = frm.writer_name.value;
		al_frm.passwd.value = frm.passwd.value ;
	} // end of ·Î±ä ¾È ÇÑ °æ¿ì

	if( frm.cmt_content.value == '' )
	{
	  alert('ÄÚ¸àÆ® ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä' ) ;
	  frm.cmt_content.focus() ;

	  return ;
	}

	if( ! confirm( 'µî·ÏÇÏ½Ã°Ú½À´Ï±î' ) )
		return ;
			
	al_frm.content.value = frm.cmt_content.value ;
	al_frm.img_no.value = img_no ;

	al_frm.cmt_mode.value = 'add' ;
	al_frm.action = '/etc/bbs/add_al_cmt_a.php' ;
	al_frm.target = 'al_hidden_frame';
	al_frm.submit() ;
} // end of go_add_cmt()

function go_del_cmt( cmt_no, confirm_passwd )
{
	var al_frm = document.al_list_frm ;
	if( confirm_passwd == 'T' )
	{
		al_frm.passwd.value = prompt( '¾ÏÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä', '' ) ;
		if( al_frm.passwd.value == 'null' )
		return ;
	}
	else if( confirm_passwd == 'A' )
	{
		if( !confirm( '»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?' ) )
		{
			return;
		}
	}

	al_frm.action = '/etc/bbs/add_al_cmt_a.php' ;
	al_frm.cmt_mode.value = 'del' ;
	al_frm.cmt_no.value = cmt_no ;
	al_frm.target = 'al_hidden_frame';
	al_frm.submit() ;

} // end of go_del_cmt()

function open_bbs_passwd( menu_no, use_no, bbs_no, bbs_seq, mode, reffer )
{
	var param ;

	var opener ; // °øÀ¯ Ã¢¿¡¼­ opener¿¡ µû¶ó¼­
				 // °øÀ¯ Ã¢ÀÇ titleÀÌ ´Ù¸£´Ù.

	if( typeof( p_opener ) != 'undefined' )
	{
	  opener = p_opener ;
	}
	else
	{
	  opener = '' ;
	}

	param = '/etc/bbs_passwd.php?menu_no='+menu_no+'&use_no='+use_no+'&bbs_no='+bbs_no+'&bbs_seq='+bbs_seq+'&mode='+mode+'&reffer='+reffer ;

	var url = "/modal/modal_wrapper.php?url_path=" + escape( param ) ;
	//sp2ÀÏ¶§¿Í ºÐ±â
	if( !is_xpsp2_error() )
		var mp_option = "status:false; dialogWidth: 316px; dialogHeight: 126px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	else
		var mp_option = "status:false; dialogWidth: 316px; dialogHeight: 106px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	if( window.showModelessDialog( url, window, mp_option )  )
	{
	} // end of if()
	else
	// Ãë¼Ò¸¦ ´­·¶À»¸é ¾Ï °Íµµ ¾È ÇÑ´Ù.
	{
	} // end of else

} // end of open_bbs_passwd()

function open_bbs_passwd_memo( menu_no, use_no, bbs_no, bbs_seq, mode, reffer )
{
	var param ;

	var opener ; // °øÀ¯ Ã¢¿¡¼­ opener¿¡ µû¶ó¼­
				 // °øÀ¯ Ã¢ÀÇ titleÀÌ ´Ù¸£´Ù.

	if( typeof( p_opener ) != 'undefined' )
	{
	  opener = p_opener ;
	}
	else
	{
	  opener = '' ;
	}

	param = '/etc/bbs_passwd.php?menu_no='+menu_no+'&use_no='+use_no+'&bbs_no='+bbs_no+'&bbs_seq='+bbs_seq+'&mode='+mode+'&referer='+reffer ;

	var url = "/modal/modal_wrapper.php?url_path=" + escape( param ) ;
	//sp2ÀÏ¶§¿Í ºÐ±â
	if( !is_xpsp2_error() )
		var mp_option = "status:false; dialogWidth: 316px; dialogHeight: 126px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	else
		var mp_option = "status:false; dialogWidth: 316px; dialogHeight: 106px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	if( window.showModelessDialog( url, window, mp_option )  )
	{
	} // end of if()
	else
	// Ãë¼Ò¸¦ ´­·¶À»¸é ¾Ï °Íµµ ¾È ÇÑ´Ù.
	{
	} // end of else

} // end of open_bbs_passwd()

function open_img_passwd( menu_no, use_no, al_no, img_no, mode )
{
	var param ;

	var opener ; // °øÀ¯ Ã¢¿¡¼­ opener¿¡ µû¶ó¼­
				 // °øÀ¯ Ã¢ÀÇ titleÀÌ ´Ù¸£´Ù.

	if( typeof( p_opener ) != 'undefined' )
	{
	  opener = p_opener ;
	}
	else
	{
	  opener = '' ;
	}

	param = '/etc/img_passwd.php?menu_no='+menu_no+'&use_no='+use_no+'&al_no='+al_no+'&img_no='+img_no+'&mode='+mode ;

	var url = "/modal/modal_wrapper.php?url_path=" + escape( param ) ;
	//sp2ÀÏ¶§¿Í ºÐ±â
	if( !is_xpsp2_error() )
		var mp_option = "status:false; dialogWidth: 316px; dialogHeight: 126px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	else
		var mp_option = "status:false; dialogWidth: 316px; dialogHeight: 106px; help:no; status:no;scroll:no; scrollbars:no status:no" ;
	if( window.showModelessDialog( url, window, mp_option )  )
	{
	} // end of if()
	else
	// Ãë¼Ò¸¦ ´­·¶À»¸é ¾Ï °Íµµ ¾È ÇÑ´Ù.
	{
	} // end of else

} // end open_img_passwd()

// Preview Image //
function previewImage(preview_id, obj)
{
	if( document.images[preview_id] && obj.value.match( /(.jpg|.jpeg|.gif|.png|.bmp|.JPG|.GIF|.PNG|.JPEG|.BMP)/) )
	{
		document.images[preview_id].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.value.replace('(', '%28').replace(')', '%29')+"', sizingMethod='scale')";
		//document.images[preview_id].src = obj.value;
		document.images[preview_id].style.display = '';
	}
	
	var obj_ = eval( "document.getElementById('" + preview_id + "_')" );
	if( obj_ == null ) return;
	obj_.value = obj.value;
}

// view image popup - start //
var imgObj = new Image();
previewPopup.showScroll = function(){ imageWin.document.getElementById('all').scroll = 'yes' };
previewPopup.hiddenScroll = function(){ imageWin.document.getElementById('all').scroll = 'no' };
function previewPopup(imgName)
{
	if( imgName == '' )
	{
		alert( 'ÀÌ¹ÌÁö¸¦ ¾÷·Îµå¸¦ ÇÏ¼Å¾ß ÇÕ´Ï´Ù..' );
		return;
	}

	if(navigator.appVersion.indexOf("MSIE 7.") > -1)	{
		alert("ÀÍ½ºÇÃ·Î·¯ 7.0 ¹öÀü¿¡¼­´Â ¹Ì¸®º¸±â¸¦ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		return;
	}

	var W, H, L, T;
	W = 200; H = 100;
	L = ( screen.width / 2 ) - ( W / 2 );
	T = ( screen.height / 2 ) - ( H / 2 );

	imageWin = window.open('about:blank', 'imageWin', 'width=' + W + ', height=' + H + ', left=' + L + ', top=' + T + ', scrollbars=no, status=no' );
	imageWin.document.write('<html><body id="all" style="margin:0;">');
	imageWin.document.write('<meta http-equiv="imagetoolbar" content="no">');
	imageWin.document.write('<div id="loading"><center><br><br>Loading....</center></div>');
	imageWin.document.write('</body><html>');

	imgObj.src = imgName;
	setTimeout( "previewPopup.createImgWin(imgObj)", 900);
}

previewPopup.createImgWin = function(imgObj)
{
	if ( imgObj.complete == false )
	{
		setTimeout( "previewPopup.createImgWin(imgObj)", 100);
		return;
	}

	previewPopup.resizeWin(imgObj.width, imgObj.height);

	imageWin.document.getElementById('loading').innerHTML = '<a href="javascript:window.close()"><img src="' + imgObj.src + '" border="0"></a>';
	imageWin.document.title = imgObj.src;
}

previewPopup.resizeWin = function(w, h)
{
	if( w >= screen.width && h >= screen.height-28 )
	{
		previewPopup.showScroll();
		imageWin.resizeTo(screen.width, screen.height - 28);
		imageWin.moveTo(0, 0)
	}
	else
	{
		if( w >= screen.width )
		{
			previewPopup.showScroll();
			imageWin.resizeTo(screen.width, h + 17);
			imageWin.moveTo(0, ( screen.height / 2 - 14 - 8 ) - ( h / 2 ) );
		}
		else if( h >= screen.height - 28 )
		{
			previewPopup.showScroll();
			imageWin.resizeTo(w + 10, screen.height - 28);
			imageWin.moveTo(( screen.width / 2 ) - ( w / 2 ), 0);
		}
		else
		{
			previewPopup.hiddenScroll();
			imageWin.moveTo((screen.width/2)-(w/2),(screen.height/2)-(h/2));
			imageWin.resizeTo(w + 10, h + 29);
		}
	}
}

function over_nick( )
{
	self.lGo( "/user/over_nick.php", 420, 310 ) ;
}

// ¿ø·¡ °¢ ÆäÀÌÁö¿¡ ÀÖ´ø add_mm_stdlib()¸¦ ¼öÁ¤ÀÌ ¿ëÀÌÇÏµµ·Ï
// stdlib.js ·Î ¿Å±è
function add_mm_stdlib( src, mm_type )
{
        var tags = get_tags_stdlib( src, '', '', mm_type ) ;

        iView.focus() ;

        var eEdit = iView.document.selection.createRange() ;
        eEdit.pasteHTML( tags ) ;


}

function get_tags_stdlib( src, comment, alignPos, mm_type )
{
    var attachTag = "";

    src = src.replace(/'/g, "\'");

    if  (src.match(/.jpg|.jpeg|.gif|.png$/i))
    // ±×¸² ÆÄÀÏ
    {
        var imgid = parseInt((Math.random()*10000000));

        if (alignPos == 'top' || alignPos == 'bottom')
            attachTag = "<center><img src='" + src + "' align='" + alignPos + "' id='userImg" + imgid + "</center>" ;
        else
            attachTag = "<img src='" + src + "' align='" + alignPos + "' id='userImg" + imgid + "'>" ;
    } // end of ±×¸² ÆÄÀÏ
    else
    // ±×¿ÜÀÇ °Íµé
    {
        attachTag = "<embed autostart='false' src='" + src + "' " ;
	if( mm_type == 'F' )
	{
		attachTag += 'type=application/x-shockwave-flash width=200 height=100>' + comment;
	}
	else if( mm_type == 'M' )
	{
		attachTag += 'type=video/x-msvideo width=200 height=150>' + comment;
	}
    }

    return attachTag;
} // end of get_tags()

function multi_al_upload( menu_no, al_no )
{

}



//ÀÌ¸§ ¸µÅ© ¸Þ´º
var UF_USER_MENU = {
	init : function ()
	{
		this.init_html_action() ;
		this.init_html_menu() ;
		this.user_no = '' ;
		this.ufam_no = '' ;
		this.is_menu_over = false ;
		this.set_moz_event( [ 'onmousedown' ] ) ;
		this.is_init = true ;
	},
	init_html_action : function ()
	{
		this.html_action = document.createElement( 'IFRAME' ) ;
		this.html_action.src = 'about:blank' ;
		this.html_action.width = 0 ;
		this.html_action.height = 0 ;
		this.html_action.frameBorder = 'no' ;
		this.html_action.scrolling = 'no' ;
		this.html_action.frameB = 0 ;
		document.body.appendChild( this.html_action ) ;
	},
	init_html_menu : function ()
	{
		this.html_menu = document.createElement( 'div' ) ;
		this.html_menu.style.position = 'absolute' ;
		this.html_menu.style.zIndex = 200000 ;
		this.html_menu.innerHTML = this.str_html_menu() ;
		document.body.appendChild( this.html_menu ) ;
		this.obj2evt2func( this.html_menu, 'onmouseover', 'UF_USER_MENU.menu_over' ) ;
		this.obj2evt2func( this.html_menu, 'onmouseout', 'UF_USER_MENU.menu_out' ) ;
	},
	name_write : function ( user_name, css_name, user_no, ufam_no )
	{
		//µðÆúÆ®  cssÃß±â ºêºì
		//if ( !css_name ) default_font_style = "font" ;
		if ( !user_no ) user_no = '' ;
		if ( !ufam_no ) ufam_no = '' ;
		var con = '<a onClick="UF_USER_MENU.on( \''+user_no+'\', \''+ufam_no+'\' ); return false;" href="#" class="' + css_name + '">'+user_name+'</a>';
		document.write(con);
		return false ;
	},
	menu_over : function ()	{ UF_USER_MENU.is_menu_over = true ; },
	menu_out : function ()	{ UF_USER_MENU.is_menu_over = false ; },
	on : function ( user_no, ufam_no )
	{
		if ( !this.is_init ) this.init() ;
		var x = this.get_pos_w2x( this.html_menu.offsetWidth ) ; //94
		var y = this.get_pos_h2y( this.html_menu.offsetHeight ) ; //116
		this.html_menu.style.left = x ;
		this.html_menu.style.top = y ;
		this.html_menu.style.display = 'block' ;
		this.obj2evt2func( document, 'onmousedown', 'UF_USER_MENU.off_by_doc' ) ;
		if ( user_no ) this.user_no = user_no ;
		if ( ufam_no ) this.ufam_no = ufam_no ;
	},
	off : function ()
	{
		this.html_menu.style.display = 'none' ;
		this.obj2evt2func_delete( document, 'onmousedown', 'UF_USER_MENU.off_by_doc' ) ;
	},
	off_by_doc : function ()
	{
		if ( !UF_USER_MENU.is_menu_over ) UF_USER_MENU.off() ;
	},
	ex : function ( mode )
	{
		if ( !this.user_no )
		{
			alert( 'Á¤º¸°¡ ¾ø½À´Ï´Ù' ) ;
			return ;
		}
		else if ( !mode )
		{
			return ;
		}
		var str_param = 'user_no=' + this.user_no + '&ufam_no=' + this.ufam_no + '&mode=' + mode ;
		this.html_action.src = 'http://www.ufamily.co.kr/cm/cm_name2redirect.php?' + str_param ;
		this.off() ;
	},
	str_html_menu : function ()
	{
		var html = "";
		html +='<table width="94" cellpadding="0" cellspacing="0" onmouseover="DIV_UF_REDIRECT_BOX_ON=true" onmouseout="DIV_UF_REDIRECT_BOX_ON=false">\
				<tr>\
					<td style="background:url(/images/ufam_quick_link/bit-layer01.gif) no-repeat; height:2px;"></td>\
				</tr>\
				<tr>\
					<td style="background:url(/images/ufam_quick_link/bit-layer02.gif) repeat-y; padding:5px 4px 5px 2px;">\
						<table width="100%" cellpadding="0" cellspacing="0">\
						<tr>\
							<td style="padding:3px 0 0 13px; height:17px; cursor:pointer;" onmouseover="this.style.background=\'#D7D7D7\'" onmouseout="this.style.background=\'#fff\'"><a href="#" onclick="UF_USER_MENU.ex( \'li_visit\' ); return false;" style="font:12px gulim; color:#1A1A1A; text-decoration:none;">°Å½Ç¹æ¹®</a></td>\
						</tr>\
						<tr>\
							<td height="2"></td>\
						</tr>\
						<tr>\
							<td style="padding:3px 0 0 13px; height:17px; cursor:pointer;" onmouseover="this.style.background=\'#D7D7D7\'" onmouseout="this.style.background=\'#fff\'"><a href="#" onclick="UF_USER_MENU.ex( \'ro_visit\' ); return false;" style="font:12px gulim; color:#1A1A1A; text-decoration:none;">³»¹æ¹æ¹®</a></td>\
						</tr>\
						<tr>\
							<td height="2"></td>\
						</tr>\
						<tr>\
							<td style="padding:3px 0 0 13px; height:17px; cursor:pointer;" onmouseover="this.style.background=\'#D7D7D7\'" onmouseout="this.style.background=\'#fff\'"><a href="#" onclick="UF_USER_MENU.ex( \'friend_request\' ); return false;" style="font:12px gulim; color:#1A1A1A; text-decoration:none;">Ä£±¸½ÅÃ»</a></td>\
						</tr>\
						<tr>\
							<td height="5"></td>\
						</tr>\
						<tr>\
							<td style="height:1px; background:url(/images/ufam_quick_link/dot-layer.gif) repeat-x;"></td>\
						</tr>\
						<tr>\
							<td height="5"></td>\
						</tr>\
						<tr>\
							<td style="padding:3px 0 0 13px; height:17px; cursor:pointer;" onmouseover="this.style.background=\'#D7D7D7\'" onmouseout="this.style.background=\'#fff\'"><a href="#" onclick="UF_USER_MENU.ex( \'memo_send\' ); return false;" style="font:12px gulim; color:#1A1A1A; text-decoration:none;">ÂÊÁöº¸³»±â</a></td>\
						</tr>\
						<tr>\
							<td height="2"></td>\
						</tr>\
						<tr>\
							<td style="padding:3px 0 0 13px; height:17px; cursor:pointer;" onmouseover="this.style.background=\'#D7D7D7\'" onmouseout="this.style.background=\'#fff\'"><a href="#" onclick="UF_USER_MENU.ex( \'sms_send\' ); return false;" style="font:12px gulim; color:#1A1A1A; text-decoration:none;">SMSº¸³»±â</a></td>\
						</tr>\
						</table>\
					</td>\
				</tr>\
				<tr>\
					<td style="background:url(/images/ufam_quick_link/bit-layer03.gif) no-repeat; height:2px;"></td>\
				</tr>\
				</table>';
		return html ;
	},
	get_pos_w2x : function ( width )
	{
		var layer_w = width ;
		var screen_w = document.body.offsetWidth + document.body.scrollLeft ;
		var base_x = event.clientX + document.body.scrollLeft ;
		if ( screen_w - base_x - layer_w <= 0 )
		{
			x = screen_w - layer_w - 10 ;
		}
		else
			x = base_x ;
		return x + 10 ;
	},
	get_pos_h2y : function ( height )
	{
		var layer_h = height ;
		var screen_h = document.body.offsetHeight + document.body.scrollTop ;
		var base_y = event.clientY + document.body.scrollTop ;
		if ( screen_h - base_y - layer_h <= 0 )
		{
			y = screen_h - layer_h - 5 ;
		}
		else
			y = base_y ;
		return y + 5 ;
	},
	obj2evt2func : function ( obj, evt_name, func_name )
	{
		if ( !obj ) return ;
		var evt_name = ( document.all ) ? evt_name : evt_name.substring( 2, evt_name.length ) ;
		if ( document.all )
		{
			obj.attachEvent( evt_name, eval(func_name) ) ;
		}
		else
		{
			obj.addEventListener( evt_name, eval(func_name), true ) ;
		}
	},
	obj2evt2func_delete : function ( obj, evt_name, func_name )
	{
		if ( !obj ) return ;
		var evt_name = ( document.all ) ? evt_name : evt_name.substring( 2, evt_name.length ) ;
		if ( document.all )
		{
			obj.detachEvent( evt_name, eval(func_name) ) ;
		}
		else
		{
			obj.removeEventListener( evt_name, eval(func_name), true ) ;
		}
	},
	set_moz_event : function ( array_moz_evt_name )
	{
		if ( !document.all )
		{
			for (var i = 0; i < array_moz_evt_name.length; i++)
			{
				document.addEventListener( array_moz_evt_name[i], function (e) {window.event = e;}, true) ;
			}
		}
	}
}

