// encoding: utf-8
/*@cc_on/*@if(@_jscript_version<5.7)try{document.execCommand('BackgroundImageCache',0,1)}catch(e){}/*@end@*/

// ***** jqreq *****
Req(
  'fontsizer',
  'autovalidate',
  'x/innerfade',
  function(){
    var $ = jQuery;
    
      // captionFix
      /*
      $('.imgbox').each(function(){
          var _theBlock = $(this);
          var w = _theBlock.offsetWidth;
          var p = 0;
          var b = 0;
          
          while (!_theBlock.hasClass('imgbox') && _theBlock.parentNode) {
            _theBlock = _theBlock.parentNode;
          }
          
          if (_theBlock.hasClass('imgbox'))
          {
            _theBlock.css('width', w + "px");

            $("div", _theBlock).each(function(){
                $(this).css('width', 'auto');
            });

            $('body').addClass('kick');
          }
      });
      */
      
      
      $('body').addClass('js-active');


    //frontpage imagelist crossfader
     $('body.home div.imglist div.item')
        .each(function() {
            $(this).find('> *:not(img)').wrapAll('<div class="imgcontent" />');
          })
        .parent()
        .innerfade({
            animationtype: 'fade',
            speed: 1000,
            timeout: 5000,
            type: 'random',
            containerheight: '241px'
          });


    // remove flicker trick
    $('#noContentFlashHack').remove();

    // fontsizer
    $('div.fontsizer').fontsizer();

    // validate all forms
    $('form').autoValidate();
        
  }
);
// **** /jqreq *****


