//¸ðµç ¸µÅ© BlurÃ³¸®
function allblur() 
{
	for (i = 0; i < document.links.length; i++)
	document.links[i].onfocus = document.links[i].blur;
}

function MM_swapImgRestore() 
{ //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() 
{ //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) 
{ //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function submenu()
{
	if(document.getElementById("subM").style.display=="none")
	{
		document.getElementById("subM").style.display=''
	}
	else
	{
		document.getElementById("subM").style.display='none'
	}
}
function bodyclick()
{
	if(document.getElementById("subM").style.display=="")
	{
		obj=event.srcElement;
		while (1) 
		{
			if(obj == selectM) 
			{
				break;
			}
			else if(obj.tagName=="BODY") 
			{
				document.all("subM").style.display='none';
				break;
			}

			obj=obj.parentElement;
		}
	}
}
//Quick Menu Close
function quick()
{
	document.all("subM").style.display='none';
}
function overS()
{
	//event.srcElement.style.background="#FBEDC6"
}

function outS()
{
	//event.srcElement.style.background=""
}

function go_login()
{
	if( frm.id.value == '' )
	{
		alert('id¸¦ ÀÔ·ÂÇÏ¼¼¿ä.' ) ;
		frm.id.focus() ;
		return false;
	}

	if( frm.passwd.value == '' )
	{
		alert('¾ÏÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä' ) ;
		frm.passwd.focus() ;
		return false;
	}

	frm.submit() ;
	
} // end of go_login()

function check_login()
{
	if( event.keyCode == 13 )
		go_login() ;

} // end of check_login()

function go_logout(cur_menu, owner)
{
	//RemoteAgent.AgentLogOut();
	var param;
  if(cur_menu == 'li')
	{
		param = 'return_url=/li/index.php?owner='+owner;
		document.location="/user/logout_a.php?go_referer&"+param;
	}		
  else if(cur_menu == 'ro')
	{
		param = 'return_url=/ro/index.php?owner='+owner;
		document.location="/user/logout_a.php?go_referer&"+param;
	}
	else
		document.location="/user/logout_a.php?go_referer";
}

function checkbox()
{
        name=event.srcElement.src;
        if(name.match("check_on")==null)
        {
                event.srcElement.src="/images/main/main/check_on.gif"//check
                frm.leave_id.value = 'T' ;
        }
        else
        {
                event.srcElement.src="/images/main/main/check_off.gif"//unchek
                frm.leave_id.value = 'F' ;
        }
} // end of checkbox()
		
function go_search_id()
        {
                obj=window.open('/office/find/f_id_01.php', 'win_id', 'scrollbars=yes,status=yes,width=866,height=600');
                obj.focus();
        }		
function go_search_pw()
        {
                obj=window.open('/office/find/f_pw_01.php', 'win_id', 'scrollbars=yes,status=yes,width=866,height=600');
                obj.focus();
        }

        function go_regist(id)
        {
				if(id == 'undefined') id = '';
            //window.open('/user/regiv2/html/service01.html', 'win_reg', 'scrollbars=yes,status=yes,width=866,height=600');
            //window.open('/user/regiv2/service.php?com_id='+id, 'win_reg', 'scrollbars=yes,status=yes,width=866,height=600');
			//parent.location.href = '/user/regiv2/service.php?com_id='+id+'&type=page' ;
			var w = window.open('/user/regiv2/service.php?com_id='+id+'&type=page', 'ufam_index') ;
			w.focus() ;
        }

        function go_regiv2()
        {
                window.open('/user/regiv2/step_01.php', 'win_reg', 'scrollbars=yes,status=yes,width=866,height=600');
        }
        function go_page( page_name )
        {
                wait.style.display = 'block' ;
                layer_window.location = page_name ;

                wait.style.display = 'none' ;

        } // end of go_page()

        function close_layer()
        {
		// ¿©±â¸¦ ¹Ù²Ù¸é, Ã¢ÀÌ ¶ß¸é, Loading ÁßÀÔ´Ï´Ù.
		// ¶ó°í º¸¿©ÁÙ ¼ö ÀÖ°Ù´Ù.
				document.all.layer_window.src='about:blank' ;
                main_layer.style.visibility = 'hidden' ;
		// Àü±¤ÆÇ¹× »õ·Î¿î°Ô½Ã¹°À» °¡Áö°í¿Â´Ù 2005.01.27                
                update_all_hidden_info();
        } // end of close_layer()

        function go_sms()
        {
                var sms_win ;
                sms_win = window.open( "/ro/sms/index.php", "", "width=746,height=705,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
        }
	
	/* ºí·Î±× */
        function go_blog( first_page )
        {
		
		if( typeof(first_page) == 'undefined' )
		{
			first_page = ''
		}
		else
		{
			first_page = escape( first_page ) ;
		}
                window.open( "/mh/main_frame.php?first_page=" + first_page, "", "width=948,height=599,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
        }
	
	/* °¡Á· È¨ÇÇ */
        function go_li_blog()
        {
                var blog_win ;
                blog_win = window.open( "/li/blog/main_frame.php", "", "width=930,height=666,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
        }

        function go_news(no)
        {
                var blog_win ;
                blog_win = window.open( "/li/np/index.php?owner="+no, "", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=yes,titlebar=no,status=yes, top=0, left=0");
        }

	function go_mail()
	{
		// ¸ÞÀÏ ¸ÞÀÎ ÆäÀÌÁö¸¦ open ½ÃÅ²´Ù.
		
		var user_dom = getCookie( "USER_DOM" ) ;
		window.open( "http://mail."+user_dom+"/servlet/login?_route=" , "", 'status=yes,toolbars=no,width=1011,height=703,resizable=yes') ;	
	}
	
	function go_address()
	{
		var user_dom = getCookie( "USER_DOM" ) ;
		window.open( "http://mail."+user_dom+"/servlet/login?_route=contact" , "", 'status=yes,toolbars=no,width=1011,height=703,resizable=yes') ;	
	}


	function go_mail_write( rcpt )
	{
		var user_dom = getCookie( "USER_DOM" ) ;
		window.open( "http://mail."+user_dom+"/servlet/login?_route=create_mail&to=" + rcpt  , "", 'status=yes,toolbars=no,width=1011,height=703,resizable=yes') ;	
	}


	function open_beta_popup( p_from )
	{
		var from = '' ;
		var param ;
		var url ;
		var mp_option = "status:false; dialogWidth: 420px; dialogHeight: 540px; help:no; status:no;scroll:no; scrollbars:no status:no" ; 

		if( typeof( p_from ) != 'undefined' )
			from = p_from ;
		
		param = '/popup/beta_open.php?from='+from ;
		url = "/modal/modal_wrapper.php?url_path=" + escape( param ) ;	
		window.showModalDialog( url, window, mp_option ) ;

	} // end of open_beta_popup()

	// Agent Login ÇÏ±â
	function go_agent_login( id )
	{
		id.document.location.href = '/user/agent_login.php?mode=login' ;
	} // end of go_agent_login()

function office( src )
{
	if( typeof( src ) == 'undefined' )
	{
		src = '/office/' ;
	}

	if( src == '' )
	{
		src = '/office/' ;
	}

	obj=window.open(src, 'office', 'scrollbars=yes,status=yes,width=866,height=600');
               obj.focus();
               return obj;
} // end of office()

/* ³»¹æ°¡±â */
function go_ro( first_page )
{
	var blog_win ;

			if( typeof(first_page) == 'undefined' )
			{
				first_page = ''
			}
			else
			{
				first_page = escape( first_page ) ;
			}

	blog_win = window.open( "/ro/index.php?owner=" + first_page, "ufam_main", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
	blog_win.focus();
}

/* °Å½Ç°¡±â */
function go_li()
{
        var blog_win ;
        blog_win = window.open( "/li/index.php", "ufam_main", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
	blog_win.focus();
}
/* ³»¹æcmd */
function go_ro_cmd( cmd )
{
	var hp_win ;
	hp_win = window.open( "/ro/index.php?cmd=" + cmd, "ufam_main", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
	hp_win.focus();
}

/* °Å½Çcmd */
function go_li_cmd(cmd)
{
	var hp_win;
        hp_win = window.open( "/li/index.php?cmd="+cmd, "ufam_main", "width=1011,height=703,scroolbars=no,toolbars=no,resizable=no,titlebar=no,status=yes");
	hp_win.focus();
}

function go_card(id)
{
	
					//window.open('/user/regiv2/service_card.php?com_id='+id, 'win_reg', 'scrollbars=yes,status=yes,width=866,height=600');
	var w = window.open('/user/regiv2/service_card.php?com_id='+id+'&type=page', 'ufam_index') ;
	                        w.focus() 
}
