/** 트랜스몰 프로세서 플로우별 설명 **/
function change_step(step) {
	switch(step) {
		case 2 :
			$('step1').src			= "images/icon_step1.gif";
			$('step1_arrow').src	= "images/icon_arrowR.gif";
			$('step2').src			= "images/icon_step2_on.gif";
			$('step2_arrow').src	= "images/icon_arrowR_on.gif";
			$('step3').src			= "images/icon_step3.gif";
			$('step3_arrow').src	= "images/icon_arrowR.gif";
			$('step4').src			= "images/icon_step4.gif";
	
			$('step1_contents').style.display = "none";
			$('step2_contents').style.display = "";
			$('step3_contents').style.display = "none";
			$('step4_contents').style.display = "none";
		break;
		case 3 :
			$('step1').src			= "images/icon_step1.gif";
			$('step1_arrow').src	= "images/icon_arrowR.gif";
			$('step2').src			= "images/icon_step2.gif";
			$('step2_arrow').src	= "images/icon_arrowR.gif";
			$('step3').src			= "images/icon_step3_on.gif";
			$('step3_arrow').src	= "images/icon_arrowR_on.gif";
			$('step4').src			= "images/icon_step4.gif";
	
			$('step1_contents').style.display = "none";
			$('step2_contents').style.display = "none";
			$('step3_contents').style.display = "";
			$('step4_contents').style.display = "none";
		break;
		case 4 :
			$('step1').src			= "images/icon_step1.gif";
			$('step1_arrow').src	= "images/icon_arrowR.gif";
			$('step2').src			= "images/icon_step2.gif";
			$('step2_arrow').src	= "images/icon_arrowR.gif";
			$('step3').src			= "images/icon_step3.gif";
			$('step3_arrow').src	= "images/icon_arrowR.gif";
			$('step4').src			= "images/icon_step4_on.gif";
	
			$('step1_contents').style.display = "none";
			$('step2_contents').style.display = "none";
			$('step3_contents').style.display = "none";
			$('step4_contents').style.display = "";
		break;
		default :
			$('step1').src			= "images/icon_step1_on.gif";
			$('step1_arrow').src	= "images/icon_arrowR_on.gif";
			$('step2').src			= "images/icon_step2.gif";
			$('step2_arrow').src	= "images/icon_arrowR.gif";
			$('step3').src			= "images/icon_step3.gif";
			$('step3_arrow').src	= "images/icon_arrowR.gif";
			$('step4').src			= "images/icon_step4.gif";
	
			$('step1_contents').style.display = "";
			$('step2_contents').style.display = "none";
			$('step3_contents').style.display = "none";
			$('step4_contents').style.display = "none";
		break;
	}
}

/** 한일 단문 번역 **/
function translate() {
	var transAjax = new Ajax.Request('translate.html', {parameters:'type=' + arguments[0] + '&contents=' + encodeURIComponent($F('translator_contents')), onComplete:translate_finish});
} 
function translate_finish() {
	var res = arguments[0].responseText;
	$('translator_contents').innerHTML = res;
}

/** 도메인 검색 **/
function validate_domain(f) {
    if (f.enword.value.length < 1) {
        alert("도메인 값을 입력 하세요.");
        f.enword.focus();
        return false;
    }

    var char_text = /[^-a-zA-Z0-9]+/;
    if (char_text.test(f.enword.value)) {
        alert("도메인 값은 영문과 숫자만 입력 가능 합니다.");
        f.enword.focus();
        return false;
    }

    var hipen = /^(-)|(-)$/;
    if (hipen.test(f.enword.value)) {
        alert("도메인 이름은 하이픈으로 시작하거나 끝날 수 없습니다.");
        f.enword.focus();
        return false;
    }

    var result  = false; 
    var cnt     = f['tld[]'].length;
    for (var i = 0; i < cnt; i++) {
        if (f['tld[]'][i].checked) {
            result = true;
        }
    }
    if (result == false) {
        alert("등록을 원하시는 도메인 종류를 체크해주세요.");
        return false;
    }
}

/**
    플래시 주위에 점선 없애기 위해 처리.
**/
function flashMovie(fid, src, wid, hei, fvs, wmd, param) {
    this.fPrint     = '';
    this.Id         = document.getElementById(fid);
    this.Src        = src;
    this.Width      = wid;
    this.Height     = hei;
    this.FlashVars  = (typeof fvs != 'undefined')? fvs :'';
    this.Wmod       = (typeof wmd != 'undefined')? wmd :'';
    this.Param      = (typeof param != 'undefined')? param :'';

    if(isObject(Id)) {
        fPrint  = '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
        fPrint += ' width="'+Width+'"';
        fPrint += ' height="'+Height+'" '+Param+'>';
        fPrint += '<param name="movie" value="'+Src+'">';
        fPrint += '<param name="quality" value="high">';
        fPrint += '<param name="AllowScriptAccess" value="always" />';
        fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : '';
        fPrint += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : '';
        fPrint += '<embed';
        fPrint += fPrint + ' src="'+Src+'"';
        fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : '';
        fPrint += (Wmod != null) ? ' wmode="'+Wmod+'"' : '';
        fPrint += ' quality="high"';
        fPrint += ' pluginspage="https://www.macromedia.com/go/getflashplayer"';
        fPrint += ' type="application/x-shockwave-flash"';
        fPrint += ' width="'+Width+'"';
        fPrint += ' height="'+Height+'"';
        fPrint += ' AllowScriptAccess="always"></embed>';
        fPrint += '</object>';
        Id.innerHTML = fPrint;
    }
}
function isObject(a) {
    return (a && typeof a == 'object');
}

/** main banner fade **/
function fadeoutdiv(){
    $('layer_popup').fade(); 
    return false;   
}

