{"version":3,"sources":["tp-site.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"tp-site.js","sourcesContent":["$(function () {\n    $('.flag-check').each(function () {\n        if($(this).is(':checked')) {\n            $(this).parent().attr('class', 'flag-on');\n        }\n    });\n\n    $('.show-details:checked').each(function () {\n        if('Yes' == $(this).val()) {\n            var show = $(this).data('show');\n\n            $('#' + show).show();\n        }\n    });\n})\n\n$('.show-details').on('click', function () {\n    var show = $(this).data('show');\n\n    if ($(this).val() == 'Yes') {\n        $('#' + show).slideDown();\n    } else {\n        $('#' + show).slideUp();\n        clearFormElements('#' + show);\n    }\n});\n\n// Clear the values within a div with a given class name\nfunction clearFormElements(className)\n{\n    $(className).find(':input').each(function() {\n        switch(this.type) {\n            case 'password':\n            case 'text':\n            case 'textarea':\n            case 'file':\n            case 'select-one':\n            case 'select-multiple':\n\t\t\t\t$(this).val('');\n\t\t\t\tbreak;\n            case 'checkbox':\n            case 'radio':\n                this.checked = false;\n        }\n    });\n}\n\nfunction calculateProportion(count, total)\n{\n    if (typeof(count) == \"undefined\" || '' == count) {\n        count = 0;\n    }\n\n    if (typeof(total) == \"undefined\" || '' == total) {\n        total = 0;\n    }\n\n    if (total == 0) {\n        return 100;\n    }\n\n    var proportion = (count/total)*100;\n\n    return Math.round(proportion);\n}"]}