<!--
// ---------------------------------------------------------------------------------------------- //
// ETC
// ---------------------------------------------------------------------------------------------- //
// ¾à°üµ¿ÀÇ
function check_agreement(f)
{
    if (f.agreement.checked == false)
    {
        alert('Please confirm that you agree approving terms and conditions.');
        f.agreement.focus();
        return false;
    }
}
// ÀÌ¸ÞÀÏÇü½ÄÀÇ ¾ÆÀÌµð ¿äÃ»Æû Ã¼Å© /page/signup/signup.html;
function check_request_id(f)
{
    if (regEmail.test(f.request_id.value) == false)
    {
        alert("Check your ID please\nexample : your_request_id@domain.com");
        f.request_id.select();
        return false;
    }
}
/*
function view_cash_table()
{
    window.open("./pricing_table.php", "cash_table", "width=400px,height=200px,top=300px,left=500px");
}
*/
function check_duplication(f)
{
    if (regEmail.test(f.request_id.value) == false)
    {
        alert("Check your ID please\nexample : your_request_id@domain.com");
        f.request_id.select();
        return false;
    }
    f.mode.value = 'check_duplication';
    f.submit();
}
// 
function change_cash_type(obj)
{
    var new_cash    = document.createTextNode(ex_info[obj.selectedIndex][2] + " " + obj.value);
    your_cash       = document.getElementById('yourCash');
    your_cash.replaceChild(new_cash, your_cash.childNodes[0]);
}

// ¿ä±Ý°è»ê
function get_price(giga, mega)
{
    var mega_pay, pay, total_pay;

    total_pay = pay = mega_pay = 0;

    switch(mega)
    {
        case "0":
            mega_pay = 0;
            break;
        case "500":
            mega_pay = 5;
            break;
    }

    if( giga < 1 ) pay = mega_pay;
    else pay = (10) + ((giga-1)*9.5) + mega_pay;
    return pay;
}

// 1000KRW¸¦ ÇØ´ç È­ÆóÀÇ °¡°ÝÀ¸·Î º¯È¯;
function exchange_your_cash(std_exchange_rate)
{
    var real_exchange   = 1000/std_exchange_rate;
    real_exchange       += 0.005;// 3ÀÚ¸®¿¡¼­ ¹Ý¿Ã¸² ÇÏ±â À§ÇØ;
    real_exchange       = real_exchange.toString();
    split_exchange      = real_exchange.split('.');
    split_exchange[1]   = split_exchange[1].substr(0, 2);
    return eval(split_exchange[0] + '.' + split_exchange[1]);
}

// ³¯Â¥¸¦ ¼±ÅÃÇÏ¸é Total Æû¿¡µµ ¹Ù²î°Ô; function change_period(obj)
function change_period(obj)
{
    var f = obj.form;
    var total_price = get_total_price(f.giga.value, f.mega.value, f.period.value);
    f.total_period.value = f.period.value;
    f.total_price.value = total_price;
}

function get_total_price(giga, mega, period)
{
    var total_price, dc;
    var price = get_price(giga, mega);

    if (period == 6) dc = 0.05;
    else if (period >= 12) dc = 0.1;
    else dc = 0;

    total_price = Math.ceil(price * period * (1-dc) * 100) / 100;

    return total_price.toFixed(2);
}

function check_signup(f)
{
    if (regPasswd.test(f.passwd.value) == false)
    {
        alert('Password Format is incorrected');
        f.passwd.select();
        return false;
    }
    else if (f.passwd.value != f.passwd_confirm.value)
    {
        alert('The passwords you supplied did not match.');
        f.passwd_confirm.value = '';
        f.passwd.select();
        return false;
    }
    else if(f.sex.value == '')
    {
        alert('Choose your gender');
        f.sex.focus();
        return false;
    }
    else if(regName.test(f.first_name.value) == false)
    {
        alert('First Name Format is incorrected');
        f.first_name.select();
        return false;
    }
    else if(regName.test(f.last_name.value) == false)
    {
        alert('Last Name Format is incorrected');
        f.last_name.select();
        return false;
    }
    else if (f.state.selectedIndex == '')
    {
        alert('Choose your residing country');
        f.state.focus();
        return false;
    }
    else if (regEmail.test(f.email.value) == false)
    {
        alert('E-Mail format is incorrected');
        f.email.select();
        return false;
    }
    /*
    else if (regNormal.test(f.city.value) == false)
    {
        alert('City Name Format is incorrected');
        f.city.select();
        return false;
    }
    else if (regNormal.test(f.state.value) == false)
    {
        alert('State Name Format is incorrected');
        f.state.select();
        return false;
    }
    else if (f.country.selectedIndex == '')
    {
        alert('Choose your country');
        f.country.focus();
        return false;
    }
    else if (regNormal.test(f.postal_code.value) == false)
    {
        alert('Postal Code Format is incorrected');
        f.postal_code.select();
        return false;
    }
    */
}
function call_payment_win(bool)
{
    if (bool == true)
    {
        window.open('about:blank', 'credit_payment', 'width=465px,height=480px');
    }
    return true;
}
function check_update_profile(f)
{
    if (f.nick_name.value == '')
    {
        alert('You must specify a nick name for your account.');
        f.nick_name.focus();
        return false;
    }
    else if (regEmail.test(f.other_email.value) == false)
    {
        alert('You must specify a valid email');
        f.other_email.select();
        return false;
    }
    /*
    if (f.other_email.value != '')
    {
        if (regEmail.test(f.other_email.value) == false)
        {
            alert('Email format is not correct');
            f.other_email.value='';
            f.other_email.focus();
            return false;
        }
    }
    else if (regNormal.test(f.city.value) == false)
    {
        alert('City Name Format is incorrected');
        f.city.select();
        return false;
    }
    else if (regNormal.test(f.state.value) == false)
    {
        alert('State Name Format is incorrected');
        f.state.select();
        return false;
    }
    else if (f.country.selectedIndex == '')
    {
        alert('Choose your country');
        f.country.focus();
        return false;
    }
    else if (regNormal.test(f.postal_code.value) == false)
    {
        alert('Postal Code Format is incorrected');
        f.postal_code.select();
        return false;
    }
    */
}
//-->
