/****  ****/

/**************************** Flash to JS Function START ****************************/
function bgImgProperty(imgurl) {
	this.bgImg = imgurl;
}

function idTextProperty(idX, idY, idWidth, idHeight, idTextDefault, idTextSize, idTextColor, idBgColor, idChangeBGColor, idBorderColor, idBorderFocusColor){
	this.idX 			= idX;
	this.idY 			= idY;
	this.idWidth 		= idWidth;
	this.idHeight 		= idHeight;
	this.idMaxChars 	= "20";
	this.idTextDefault 	= "";
	this.idTextFont		= "verdana";
	this.idBoldTag 		= "false";
	this.idTextSize 	= idTextSize;
	this.idTextColor 	= idTextColor;
	this.idBgColor 		= idBgColor; //"ffffff";
	this.idChangeBGColor = idChangeBGColor;
	this.idBorderSize 	= "1";
	this.idBorderColor 	= idBorderColor;
	this.idBorderFocusColor = idBorderFocusColor;
	this.idActualText 	= "ID";
	
}

function pwdTextProperty(pwdX, pwdY, pwdWidth, pwdHeight, pwdTextDefault, pwdTextSize, pwdTextColor, pwdBgColor, pwdChangeBGColor, pwdBorderColor, pwdBorderFocusColor){
	this.pwdX 			= pwdX;
	this.pwdY 			= pwdY;
	this.pwdWidth 		= pwdWidth;
	this.pwdHeight 		= pwdHeight;
	this.pwdMaxChars 	= "20";
	this.pwdTextDefault	= "";
	this.pwdTextFont	= "verdana";
	this.pwdBoldTag 	= "false";
	this.pwdTextSize 	= pwdTextSize;
	this.pwdTextColor 	= pwdTextColor;
	this.pwdBgColor 	= pwdBgColor; //"ffffff";
	this.pwdChangeBGColor = pwdChangeBGColor;
	this.pwdBorderSize 	= "1";
	this.pwdBorderColor 	= pwdBorderColor;
	this.pwdBorderFocusColor = pwdBorderFocusColor;
	this.pwdActualText 	= "password";
}

// Background Image URL
function setBackGround(){	return imgProperty.bgImg;	}

// 
function setType(){
	var returnval = "0";
	return returnval;
}

//
function setIdTextField(){
	var returnval = idProperty.idX + "," + idProperty.idY + "," + idProperty.idWidth + "," + idProperty.idHeight + "," 
				+ idProperty.idMaxChars + "," + idProperty.idTextDefault + "," + idProperty.idTextFont + "," + idProperty.idBoldTag + ","
				+ idProperty.idTextColor + "," + idProperty.idTextSize + "," + idProperty.idBgColor + "," + idProperty.idChangeBGColor + "," 
				+ idProperty.idBorderSize + "," + idProperty.idBorderColor + "," + idProperty.idBorderFocusColor + "," + idProperty.idActualText;
	
	return returnval;
}

//
function setPwTextField(){
	var returnval = pwdProperty.pwdX + "," + pwdProperty.pwdY + "," + pwdProperty.pwdWidth + "," 
			+ pwdProperty.pwdHeight + "," + pwdProperty.pwdMaxChars + "," + pwdProperty.pwdTextDefault + "," 
			+ pwdProperty.pwdTextFont + "," + pwdProperty.pwdBoldTag + "," + pwdProperty.pwdTextColor + "," 
			+ pwdProperty.pwdTextSize + "," + pwdProperty.pwdBgColor + "," + pwdProperty.pwdChangeBGColor + "," 
			+ pwdProperty.pwdBorderSize + "," + pwdProperty.pwdBorderColor + "," + pwdProperty.pwdBorderFocusColor + "," + pwdProperty.pwdActualText;
	return returnval;
}

function setIdTextField2(){
	var idX, idY, idWidth, idHeight, idMaxChars, idTextDefault, idTextFont, idBoldTag, idTextColor, idTextSize, idBgColor, idChangeBGColor, idBorderSize, idBorderColor, idBorderFocusColor, idActualText;
	idX = "0";
	idY = "0";
	idWidth = "97";
	idHeight = "16";
	idMaxChars = "13";
	idTextDefault = "";
	idTextFont = "";
	idBoldTag = "true";
	idTextColor = "666666";
	idTextSize = "12";
	idBgColor = "FFFFFF";
	idChangeBGColor = "EFF5E1";
	idBorderSize = "1";
	idBorderColor = "FF0000";
	idBorderFocusColor = "000000";
	idActualText = "ID";
	var returnval = idX + "," + idY + "," + idWidth + "," + idHeight + "," + idMaxChars + "," + idTextDefault + "," + idTextFont + "," + idBoldTag + "," + idTextColor + "," + idTextSize + "," + idBgColor + "," + idChangeBGColor + "," + idBorderSize + "," + idBorderColor + "," + idBorderFocusColor + "," + idActualText;
	
	return returnval;
}


function setPwTextField2(){
	var pwX, pwY, pwWidth, pwHeight, pwMaxChars, pwTextDefault, pwTextFont, pwBoldTag, pwTextColor, pwTextSize, pwBgColor, pwChangeBGColor, pwBorderSize, pwBorderColor, pwBorderFocusColor, pwActualText;
	pwX = "0";
	pwY = "21";
	pwWidth = "97";
	pwHeight = "16";
	pwMaxChars = "16";
	pwTextDefault = "";
	pwTextFont = "";
	pwBoldTag = "true";
	pwTextColor = "666666";
	pwTextSize = "12";
	pwBgColor = "FFFFFF";
	pwChangeBGColor = "EFF5E1";
	pwBorderSize = "1";
	pwBorderColor = "FF0000";
	pwBorderFocusColor = "000000";
	pwActualText = "password";
	var returnval = pwX + "," + pwY + "," + pwWidth + "," + pwHeight + "," + pwMaxChars + "," + pwTextDefault + "," + pwTextFont + "," +pwBoldTag + "," + pwTextColor + "," + pwTextSize + "," + pwBgColor + ","+pwChangeBGColor + ","+ pwBorderSize + "," + pwBorderColor + "," + pwBorderFocusColor + "," + pwActualText;
	
	return returnval;
}

//
function setSessionKey(){
	if (keystr!=null && keystr!="" )  {
		return keystr;
	} else {
		getKeys();
		
		if (!keystr) { //key
			setTimeout("voidfunction()" , 500);
		}
		return keystr;
	}
}

function voidfunction() {
	if (!keystr) 	return false;
	else 			return true;	
}

var mcode01 = "Please enter a User ID.";
var mcode02 = "Please enter a password.";
var mcode03 = ".";
var mcode04 = ".";

//
function getMessage(_mcode){
	var message = eval(_mcode);
	//alert(message);
	// window.focus();
	findSwf("login").focus();
}

function showMsg(_mcode){
	getMessage(_mcode);
}

function login(keyData){
	getEncryptData(keyData);
}

//
function getFullId(_str){
	// alert("full id = " + _str);
	recentID = _str;
}

function loginID(_str){
	getFullId(_str);
}

function capslock(){
	// alert('caps');
	getCapsLockToggled();
}
// 
function getAltS(bool){
	//alert("alt + s = " + bool);
}

function getKey(){
	findSwf("login").keySetting(setSessionKey());
	// keySetting();
}

function keySetting(){
	findSwf("login").keySetting("keystring");
}


function idSetting(){
}

function pwSetting(){
}


function focusID(){
	findSwf("login").focus();
	findSwf("login").focusInID();
}





function inputError(message){
	//alert('inputError'+message);
}

//
function getFullPwLength(_length){
	//alert("pw length = " + _length);
}

function getEncryptData(_en) {
	ens = _en.split(",");
	if(ens[1]==null || ens[1] == '' || ens[1] == 'null') {
		hideObject('flashTr');
		viewInformDiv(1);
	} else {
		var f = document.getElementById("loginform");
		if (f.keyname.value.length == 0 && f.turtle.value == 0) {
			f.keyname.value = ens[0];
			f.turtle.value =  ens[1];
			loginFormSubmit();
		}
	}
}

function loginFormSubmit() {
	entersubmitHan();
}


//
function getCapsLockToggled(_str){

	capslockNotice();
	
	// 
	addX = 30;
	addY = 28;
	setCapslockInfoOn();
}

// 
var loadFlash = false;
function loadComplete(){
    loadFlash = true;
}

/**************************** Flash to JS Function END ******************************/


/**************************** JS to Flash Function START ****************************/
//
function loginClick(){
	if (flashenable == 1) {
		window.focus();	
		findSwf("login").focus();	
		findSwf("login").loginCheck();
	} else {
		entersubmit_security();
	}
}
/**************************** JS to Flash Function END ******************************/

//
/*
function flashloading() {

	if (AC_FL_RunContent == 0) {
		flashenable = -1; //alert("This page requires AC_OETags.js.");
	} else if (DetectFlashVer(8,0,0)) {
		document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"113\" height=\"39\" id=\"login\" align=\"middle\">');
		document.write('<param name=\"allowScriptAccess\" value=\"always\" />');
		document.write('<param name=\"quality\" VALUE=\"high\" />');
		document.write('<param name=\"bgcolor\" VALUE=\"#ffffff\" />');
		document.write('<param name=\"wmode\" VALUE=\"window\" />');
		document.write('<param name=\"movie\" value=\"http://images.hangame.co.kr/static/flashlogin/Login.swf\" />');
		document.write('<embed swLiveConnect=\"true\" quality=\"high\" bgcolor=\"#ffffff\" wmode=\"window\" src=\"http://images.hangame.co.kr/static/flashlogin/Login.swf\" width=\"113\" height=\"39\" name=\"login\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');
		document.write('</object>');
	} else {
		flashenable = -1;
	}
}
*/


