
/* - ++resource++idg-events.js - */
// http://www.immanuel.de/portal_javascripts/++resource++idg-events.js?original=1
var $j=jQuery.noConflict();
function _showHideTopicFields(substring,mode){$j('.field').each(function(f){if(this.id.indexOf(substring)!=-1){if(mode=='show')
$j('#'+this.id).show();else
$j('#'+this.id).hide()}})}
function hideAllTopicFields(){_showHideTopicFields('ForTopic','hide')}
function showTopicFields(topic){_showHideTopicFields('ForTopic'+topic,'show')}
function _hideEmptySelectElements(){var mf=$j('#mandatoryForTopicFortbildung');if(mf.children('option').length==0){$j('#archetypes-fieldname-mandatoryForTopicFortbildung').hide()}}
function topic_change_handler(e){var topic=$j('#archetypes-fieldname-topic :selected').val();if(topic=='Standard'){hideAllTopicFields()} else{showTopicFields(topic)}
_hideEmptySelectElements()}
$j(document).ready(function(){var topic=$j('#archetypes-fieldname-topic');if(topic){topic.bind('change',topic_change_handler);var topic_value=$j('#archetypes-fieldname-topic :selected').val();if(topic_value=='Standard'){hideAllTopicFields()} else{showTopicFields(topic)}
_hideEmptySelectElements()}})

