(function($){Drupal.toggleFieldset=function(fieldset){var $fieldset=$(fieldset);if($fieldset.is('.collapsed')){var $content=$('> .fieldset-wrapper',fieldset).hide();$fieldset.removeClass('collapsed').trigger({type:'collapsed',value:false}).find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide'));$content.slideDown({duration:'fast',easing:'linear',complete:function(){Drupal.collapseScrollIntoView(fieldset);fieldset.animating=false;},step:function(){Drupal.collapseScrollIntoView(fieldset);}});}else{$fieldset.trigger({type:'collapsed',value:true});$('> .fieldset-wrapper',fieldset).slideUp('fast',function(){$fieldset.addClass('collapsed').find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show'));fieldset.animating=false;});}};Drupal.collapseScrollIntoView=function(node){var h=document.documentElement.clientHeight||document.body.clientHeight||0;var offset=document.documentElement.scrollTop||document.body.scrollTop||0;var posY=$(node).offset().top;var fudge=55;if(posY+node.offsetHeight+fudge>h+offset){if(node.offsetHeight>h){window.scrollTo(0,posY);}else{window.scrollTo(0,posY+node.offsetHeight-h+fudge);}}};Drupal.behaviors.collapse={attach:function(context,settings){$('fieldset.collapsible',context).once('collapse',function(){var $fieldset=$(this);var anchor=location.hash&&location.hash!='#'?', '+location.hash:'';if($('.error'+anchor,$fieldset).length){$fieldset.removeClass('collapsed');}var summary=$('<span class="summary"></span>');$fieldset.bind('summaryUpdated',function(){var text=$.trim($fieldset.drupalGetSummary());summary.html(text?' ('+text+')':'');}).trigger('summaryUpdated');var $legend=$('> legend .fieldset-legend',this);$('<span class="fieldset-legend-prefix element-invisible"></span>').append($fieldset.hasClass('collapsed')?Drupal.t('Show'):Drupal.t('Hide')).prependTo($legend).after(' ');var $link=$('<a class="fieldset-title" href="#"></a>').prepend($legend.contents()).appendTo($legend).click(function(){var fieldset=$fieldset.get(0);if(!fieldset.animating){fieldset.animating=true;Drupal.toggleFieldset(fieldset);}return false;});$legend.append(summary);});}};})(jQuery);;(function($){Drupal.FieldGroup=Drupal.FieldGroup||{};Drupal.FieldGroup.Effects=Drupal.FieldGroup.Effects||{};Drupal.FieldGroup.groupWithfocus=null;Drupal.FieldGroup.setGroupWithfocus=function(element){element.css({display:'block'});Drupal.FieldGroup.groupWithfocus=element;}
Drupal.FieldGroup.Effects.processFieldset={execute:function(context,settings,type){if(type=='form'){$('fieldset.fieldset').each(function(i){if($(this).is('.required-fields')&&$(this).find('.form-required').length>0){$('legend span.fieldset-legend',$(this)).eq(0).append('&nbsp;').append($('.form-required').eq(0).clone());}if($('.error',$(this)).length){$('legend span.fieldset-legend',$(this)).eq(0).addClass('error');Drupal.FieldGroup.setGroupWithfocus($(this));}});}}}
Drupal.FieldGroup.Effects.processAccordion={execute:function(context,settings,type){var accordions=$('div.field-group-accordion-wrapper',context).accordion({autoHeight:false,active:0,collapsible:true});if(type=='form'){$('div.accordion-item').each(function(i){if($(this).is('.required-fields')&&$(this).find('.form-required').length>0){$('h3.ui-accordion-header').eq(i).append('&nbsp;').append($('.form-required').eq(0).clone());}if($('.error',$(this)).length){$('h3.ui-accordion-header').eq(i).addClass('error');var activeOne=$(this).parent().accordion("activate",i);$('.ui-accordion-content-active',activeOne).css({height:'auto',width:'auto',display:'block'});}});}}}
Drupal.FieldGroup.Effects.processHtabs={execute:function(context,settings,type){if(type=='form'){$('fieldset.horizontal-tabs-pane').each(function(i){if($(this).is('.required-fields')&&$(this).find('.form-required').length>0){$(this).data('horizontalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after('&nbsp;');}if($('.error',$(this)).length){$(this).data('horizontalTab').link.parent().addClass('error');Drupal.FieldGroup.setGroupWithfocus($(this));$(this).data('horizontalTab').focus();}});}}}
Drupal.FieldGroup.Effects.processTabs={execute:function(context,settings,type){if(type=='form'){$('fieldset.vertical-tabs-pane').each(function(i){if($(this).is('.required-fields')&&$(this).find('.form-required').length>0){$(this).data('verticalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after('&nbsp;');}if($('.error',$(this)).length){$(this).data('verticalTab').link.parent().addClass('error');Drupal.FieldGroup.setGroupWithfocus($(this));$(this).data('verticalTab').focus();}});}}}
Drupal.FieldGroup.Effects.processDiv={execute:function(context,settings,type){$('div.collapsible',context).each(function(){var $wrapper=$(this);var $toggler=$('span.field-group-format-toggler:first',$wrapper);var $link=$('<a class="field-group-format-title" href="#"></a>');$link.prepend($toggler.contents()).appendTo($toggler);$link.click(function(){var wrapper=$wrapper.get(0);if(!wrapper.animating){wrapper.animating=true;var speed=$wrapper.hasClass('speed-fast')?300:1000;if($wrapper.hasClass('effect-none')&&$wrapper.hasClass('speed-none')){$('> .field-group-format-wrapper',wrapper).toggle();}else if($wrapper.hasClass('effect-blind')){$('> .field-group-format-wrapper',wrapper).toggle('blind',{},speed);}else{$('> .field-group-format-wrapper',wrapper).toggle(speed);}wrapper.animating=false;}return false;});});}};Drupal.behaviors.fieldGroup={attach:function(context,settings){if(settings.field_group==undefined){return;}$('body',context).once('fieldgroup-effects',function(){$.each(Drupal.FieldGroup.Effects,function(func){var type=func.toLowerCase().replace("process","");if(settings.field_group[type]!=undefined&&$.isFunction(this.execute)){this.execute(context,settings,settings.field_group[type]);}});});}};})(jQuery);;