function func_codingsa_login(w, h)
{	
	 //너비와높이
	 if(!w) w = 500;
	 if(!h) h = 500;
	 
	 $("body").append('<div id="codingsa_login_popup"></div>');		 
	
	 var popup = $('#codingsa_login_popup');	
	 
	 //contents wrapper
	 popup.append('<div id="codingsa_login_popup_wrapper"></div>');
	 var wrapper = $('#codingsa_login_popup_wrapper');		 
	 
	 wrapper.draggable();
	  
	 styles = 
	 {
	   'position' : 'absolute',
	   'top' : '50%',
	   'left' : '50%',
	   'width' : w + 'px',
	   'height' : h + 'px',
	   'z-index' :100000,
	   'background' : 'url('+CODINGSA_PATH_IMG+'/login_popup_bg.png) 0 0 no-repeat',
	   'cursor' : 'move',
	   'font-family' : '"돋움","굴림","sans-serif"',
	   //'border' : '1px solid #006666',
	   'display' : 'none'  
	 }		 
	 wrapper.css(styles);	 
	 
	 //contents
	 wrapper.append('<div id="codingsa_login_popup_contents"></div>');
	 var contents = $('#codingsa_login_popup_contents');
	 
	 styles = 
	 {
	   'width' : w + 'px',
	   //'height' : h - 60 + 'px',
	   //'background' : '#fff',
	   'font-family' : '"돋움","굴림","sans-serif"',
	   'margin' : '0 auto',
	   'text-align' : 'center'
	 }
	 contents.css(styles);
	
	 //로그인폼
	 var codingsa_G5_BBS_URL2 = codingsa_G5_BBS_URL.replace("http://","");
	 var codingsa_G5_BBS_URL3 = codingsa_G5_BBS_URL2.replace("https://","");
	 var codingsa_G5_BBS_URL4 = codingsa_G5_BBS_URL3.replace("www.","");//혹시나...
	 var documentDomain2 = document.domain.replace("www.","");
	 var codingsa_G5_BBS_URL5 = codingsa_G5_BBS_URL4.replace(documentDomain2,"");//http이하 도메인까지 모두 제거
	 var codingsa_G5_BBS_URL6 = document.domain+codingsa_G5_BBS_URL5;//도메인 재정의(www이 붙던 안붙던 오류제거위해 실제주소창의 도메인사용)
	 contents.append("<form id='codingsa_loginform' action='"+codingsa_outlogin_action_url+"' method='post' autocomplete='off'><input type='hidden' name='url' value='"+codingsa_outlogin_url+"'><input type='text' name='mb_id' id='codingsa_loginform_id' required class='required' maxlength='20' title='아이디'><input type='password' name='mb_password' id='codingsa_loginform_password' required class='required' maxlength='20' title='비밀번호'><input type='image' src='"+CODINGSA_PATH_IMG+"/login_popup_submit_off.png' value='LOGIN' id='codingsa_loginform_submit'><div id='codingsa_loginform_auto'><input type='checkbox' name='auto_login' value='1'> 자동로그인</div><div id='codingsa_loginform_search'><a href='http://"+codingsa_G5_BBS_URL6+"/password_lost.php' id='codingsa_loginform_idsearch' title='아이디 패스워드찾기'>아이디 패스워드 찾기</a> | <a href='"+codingsa_G5_BBS_URL+"/register.php'>회원 가입</a></div></form>");	 
	 
	 //아이디 비밀번호 입력필드 공통스타일
	 var required = $('#codingsa_login_popup_contents .required');
	 
	 styles = 
	 { 
	   'width' : '279px',
	   'height' : '30px',
	   'font-size' : '1.5em',
	   'line-height' : '1.7em',
	   'font-weight' : 'bold',
	   'border' : 'none'
	 }
	 required.css(styles);

	 //아이디 입력필드
	 var input_id = $('#codingsa_login_popup_contents #codingsa_loginform_id');
	 
	 styles = 
	 { 
	   'position' : 'absolute',
	   'top' : '89px',
	   'left' : '137px'
	 }
	 input_id.css(styles);

	 //비밀번호 입력필드
	 var input_password = $('#codingsa_login_popup_contents #codingsa_loginform_password');
	 
	 styles = 
	 { 
	   'position' : 'absolute',
	   'top' : '149px',
	   'left' : '137px'
	 }
	 input_password.css(styles);

	 //로그인 버튼 스타일
	 var btn_submit = $('#codingsa_login_popup_contents #codingsa_loginform_submit');
	 
	 styles = 
	 {
	   'position' : 'absolute',
	   'top' : '210px',
	   'left' : '40px',	      
	   'cursor' : 'pointer'
	 }
	 btn_submit.css(styles); 

	 //자동로그인 스타일
	 var login_auto = $('#codingsa_login_popup_contents #codingsa_loginform_auto');
	 
	 styles = 
	 {
	   'position' : 'absolute',
	   'top' : '195px',
	   'left' : '80px',
	   'color' : '#fff',
	   'cursor' : 'pointer'
	 }
	 login_auto.css(styles);
	 
	 //정보찾기와 회원가입 스타일
	 var member_search = $('#codingsa_login_popup_contents #codingsa_loginform_search');
	 
	 styles = 
	 {
	   'position' : 'absolute',
	   'top' : '195px',
	   'left' : '200px'	  
	 }
	 member_search.css(styles);

	 var member_search_a = $('#codingsa_login_popup_contents #codingsa_loginform_search a');
	 
	 styles = 
	 {	   
	   'color' : '#fff',
	   'cursor' : 'pointer'
	 }
	 member_search_a.css(styles);	

	 //닫기버튼
	 wrapper.append('<div id="codingsa_login_popup_close"><a href="#"><img src="'+CODINGSA_PATH_IMG+'/login_popup_close.png"></a></div>');	
	 var btn_close = $('#codingsa_login_popup_close');
	 
	 styles = 
	 {
	   'position' : 'absolute',
	   'top' : '26px',
	   'left' : '395px',	   	   
	   'cursor' : 'pointer'
	 }		 
	 btn_close.css(styles);	
	 
	
	 //위치조정
	 if (wrapper.outerHeight() < $(document).height())
	 {
	  wrapper.css('margin-top', '-' + wrapper.outerHeight() / 2 + 'px');
	 } 
	 else 
	 {
	  wrapper.css('top', '0px');
	 }
	 if (wrapper.outerWidth() < $(document).width())
	 {
	  wrapper.css('margin-left', '-' + wrapper.outerWidth() / 2 + 'px');
	 }
	 else
	 {
	  wrapper.css('left', '0px');
	 }	

	//close
	btn_close.click(function () 
	{        
		wrapper.toggle(100);
	});
}
$(document).ready(function(){
	//로그인 팝업창 토글
	$("#codingsa_login_button").click(function()
	{
		$("#codingsa_login_popup_wrapper").toggle();
		$('#codingsa_loginform_id').focus();	
	});
	//로그인 버튼 롤오버
	$("#codingsa_loginform_submit").hover(		
	function()
	{			
		this.src=this.src.replace("_off","_on"); 
	},
	function()
	{			
		this.src=this.src.replace("_on","_off"); 
	}
	);
	//아이디찾기 팬시박스로 띄우기
	$("#codingsa_loginform_idsearch").fancybox(
	{		
		'titleShow':true,		
		'autoScale':true,
		'scrolling':'no',
		'transitionIn':'elastic',
        'transitionOut':'elastic',		
        'speedIn':200, 
        'speedOut':200,
		'type':'ajax',
		'onComplete': function()
		{
			$("#codingsa_login_popup_wrapper").toggle();
			$("#mb_email").focus();
		}
		
	});
	
});
