﻿function establishControlgroups()
{
    $('.controlgroup').each(function()
    {
        var currValue = $('.' + $(this).attr('parentcontrol')).attr('value')
        switch (currValue)
        {
            case '':
                if ($(this).hasClass('hideneutral'))
                    $(this).css('display', 'none');

                if ($(this).hasClass('showneutral'))
                    $(this).css('display', '');
                    
                break;


            case '0':
                if ($(this).hasClass('hidenegative'))
                    $(this).css('display', 'none');

                if ($(this).hasClass('shownegative'))
                    $(this).css('display', '');

                break;
                
            case '1':
                if ($(this).hasClass('hidepositive'))
                    $(this).css('display', 'none');

                if ($(this).hasClass('showpositive'))
                    $(this).css('display', '');

                break;
                
                
            
        }
    });
}

function ToggleContactpointItems()
{
    var currValue = $('.rolechoice').attr('value')
    
    switch (currValue)
    {
        case '1':
            $('.contactpointcontrolgroup').css('display', 'none');

            break;

        case '2':
            
            $('.contactpointcontrolgroup').css('display', 'block');
            
            break;
    }
}


function HideMessage()
{
    $('.message').hide('slow');
}
