/**
 * 	@author		허윤화 , yunhwa.heo@nhncorp.com, [ http://www.yunhwa.pe.kr, yunhwa@yunhwa.pe.kr ]
 * 	@version	v.0.1
 *  @since		2009.10.30
 *
 *  한게임 보안 로그인 2단계 플래시 로그인
 *  디자인 관련 요소와 연동되는 JS  
 *  
 *  DisplayObject의 속성을 플래시 UI 외부에서 수정 가능하도록 개발 되었습니다. 
 *  Sample로 개발되어신 속성 옵션 이외 컨트롤 하는 DisplayObject의  
 *
 *	CHANGE LOG:
 * 		
 * 		2009.11.18 
 * 			플래시 로그인 모듈 재개발 완료
 *
 * 		2009.11.25
 * 			배경 이미지 로드 가능하도록 인터페이스 추가
 * 	
 */
 
/*------------------- ExternalInterface.call( flash -> js ) ------------------------*/
/*
 * 텍스트 필드 속성 정보
 * : 좌표 및 가로 세로 크기 
 * name : id / pw
 */
function getTextFildInfo(name)
{
	var textField = new Object();
				
	// 텍스트 필드 속성 설정
	textField = {					
					_width : 113,		// input > width
					_height : 18		// input > height
				};
	
	switch (name)
	{
		case "id" : 
			textField.maxChars = 12; 
			textField._x = -1;		
			// 세로형 / 가로형: (input_id > margin - left)
			
			textField._y = 1;
			// 세로형 / 가로형 : (input_id > margin - top) + (input_id > padding - left)
			break; 			
		case "pw" : 
			textField.maxChars = 15; 
			textField._x = -1;
			// 세로형 : (input_id > margin - left) 
			// 가로형 : (input_id > margin - left) + (input_id > font - weight) + (input_id > margin - right) 
			//						+ (input_pw > margin - left)			
			textField._y = 23;

			// 세로형 : (input_id > margin - top) + (input_id > font - height) + (input_id > margin - bottom) 
			//						+ (input_pw > margin - top) +  (input_pw > padding - top) 
			// 가로형 : (input_id > margin - top)	
			break;  			
		default :
			break; 
			
	}

	return textField;
}

/*
 * 텍스트 포멧(텍스트 필드 내 택스트 관련 속성) 속성 정보 
 * : 폰트 사이즈 , 컬러, 볼드, 자간 등 
 */
function getTextFormatInfo(name, status)
{
	var textFormat = new Object();
	
	//-- 텍스트 필드 공통 속성 설정
	// 텍스트 포멧 속성 설정
	textFormat = {
					size : 13,			// input > font - size
					color: 0x343333,	// input > color
					bold : false, 		// input > font - weight
					letterSpacing : -1	// input > letter - spacing
				};

	switch (name)
	{
		case "id" : 
			textFormat.leftMargin = 5;		// input_id > padding - top
			break; 			
		case "pw" : 
			textFormat.leftMargin = 5;		// input_pw > padding - top
			break;  			
		default :
			break; 
			
	}
	
	switch (status)
	{ 
		case "mouseover" :
			textFormat.bold = true;
			break; 			
		case "writeafter" : 
			textFormat.bold = false;
			break;  			
		default : 
			break; 
	}
	
	return textFormat;
}

/*
 *  배경 이미지 속성 정보 및 url 
 */
function getBackgroundInfo(name, status)
{	
	var background = new Object();
	var gameid = "r2/sub5";
	switch (name)
	{
		case "id" : 
			background._x = 0;
			// 세로형 / 가로형: (input_id > margin - left)
			
			background._y = 0;
			// 세로형 / 가로형 : (input_id > margin - top)
			break; 			
		case "pw" : 
			background._x = 0;
			// 세로형 : (input_id > margin - left) 
			// 가로형 : (input_id > margin - left) + (input_id > font - weight) + (input_id > margin - right)
			//						+ (input_pw > margin - left)
			background._y = 22;
			// 세로형 : (input_id > margin - top) + (input_id > font - height) + (input_id > margin - bottom) 
			//						+ (input_pw > margin - top)
			// 가로형 : (input_id > margin - top)
			break;  			
		default :
			break; 			
	}

	// 이미지 경로 설정
	if(name == "stage")
	{
		//사용하지 않으므로 임시로 주석처리
		//background.url = "http://flashdev.naver.com/FlashUILab/Hangame/HeoYunHwa/200911_LoginRenewal/images/bg.jpg";
	}	
	else
	{
		switch (status)
		{ 
			case "mouseover" : 
				background.url = "http://images.hangame.co.kr/hangame/login/loginui/"+gameid+"/input_txt_mouseover.gif";	// input_id > background
				break; 			
			case "writeafter" : 
				background.url = "http://images.hangame.co.kr/hangame/login/loginui/"+gameid+"/input_txt_writeafter.gif";	// input_writeafter > background
				break;  			
			default :
				background.url = (name == "id")? "http://images.hangame.co.kr/hangame/login/loginui/"+gameid+"/input_txt_id.gif" : "http://images.hangame.co.kr/hangame/login/loginui/"+gameid+"/input_txt_pw.gif"; 	
			// input_id > background / input_pw > background			
				break; 
		}
	}	
	return background;
}

/*********************** UI Style ExternalInterface.call( flash -> js ) End **************************/