/**
 *  homepage faq
 *
*/
/* constants */
HIDE_LINK = (LANG == 'ro') ? 'inchide' : 'hide';
SHOW_LINK = (LANG == 'ro') ? 'arata' : 'show';
last_opened_id = null;

function toggle_faq(id) {
    /*alert(last_opened_id);
    alert(id);     */
    try {
        if(id != last_opened_id) {
            $('question_'+last_opened_id).style.display = 'none';
            $('answer_'+last_opened_id).innerHTML = SHOW_LINK;
        }
    } catch(e) {
    };
    q_id = 'question_'+id;
    a_id = 'answer_'+id;
    if($(q_id).style.display == 'none') {
        $(q_id).style.display = 'block';
        $(a_id).innerHTML = HIDE_LINK;
    } else {
        $(q_id).style.display = 'none';
        $(a_id).innerHTML = SHOW_LINK;
    };
    last_opened_id = id;
}


/**
 * font size
 * 
 *
*/
var change_font = function() {
}

change_font.start_size   = 10;
change_font.end_size     = 16;
change_font.current_size = 10;
/**
 * increase font size
 *
*/
change_font.increase = function() {
    current_size = change_font.current_size;
    end_size     = change_font.end_size;
    if(current_size < end_size) {
        document.body.style.fontSize = current_size + 1 +'px';
        change_font.current_size++;
    }
};
/**
 * decrease font size
 *
*/
change_font.decrease = function() {
    current_size = change_font.current_size;
    start_size     = change_font.start_size;
    if(current_size > start_size) {
        document.body.style.fontSize = current_size - 1 + 'px';
        change_font.current_size--;
    }
}

function relocate(obj) {
    if(obj.value.length > 2) {
        window.location.href = host + '/contact/form/' + obj.value;
    }
}

function cancel_keys() {
    input_is_active = 1;
}

function enable_keys() {
    input_is_active = 0;
}