/*
 * Control form's inputs ContactUs
 *
 * @param windows : Boolean value that specifies whether it is an external window
 */
function checkContact (windows)
{
    var form     = EL ('formContact');
    var email    = EL ('email');
    var name = EL ('name');
    var theme = EL ('theme');
    var message = EL ('message');

    if (name.value == '')
    {
        if (windows)
        {
            affichePopUpContactUs ('name-mandatory-error');
        }
        else
        {
            affichePopUp ('name-mandatory-error');
        }

    }
    else if (email.value == '')
    {
        if (windows)
        {
            affichePopUpContactUs ('email-mandatory-error');
        }
        else
        {
           affichePopUp ('email-mandatory-error');
        }
    }
    else if (!Valraiso.util.checkEmail (email.value))
    {
        if (windows)
        {
            affichePopUpContactUs ('email-valide');
        }
        else
        {
            affichePopUp ('email-valide');
        }

    }
    /*else if (Valraiso.form.select.getSelectedText (theme) == '')*/
    else if (theme.value == '')
    {
        if (windows)
        {
            affichePopUpContactUs ('theme-mandatory-error');
        }
        else
        {
            affichePopUp ('theme-mandatory-error');
        }

    }
    else if (message.value  == '')
    {
        if (windows)
        {
            affichePopUpContactUs ('message-mandatory-error');
        }
        else
        {
            affichePopUp ('message-mandatory-error');
        }
    }
    else
    {
        form.submit();
    }

    return false;
}

/**
 * open div in substitution page
 */
function openForm ()
{
    var div     = EL ('form');
    div.style.display = "block";

    return false;
}

function setThemeValue(id)
{
    var theme = EL('theme');
    var themeId = EL(id);

    theme.value = themeId.value;
}

function checkRadioButton(radioId)
{
    var inputRadioId = EL (radioId);
    var inputRadioChecked = inputRadioId.checked;

    if (!inputRadioChecked)
    {
        inputRadioId.checked = true;
    }
}

