// encoding: utf-8
/*@cc_on/*@if(@_jscript_version<5.7)try{document.execCommand('BackgroundImageCache',0,1)}catch(e){}/*@end@*/

// ***** jqreq *****
Req('fontsizer', 'autovalidate', 'labelizor', 'x/ifixpng', 'mailtoenabler', 'imgpop', function(){
  var $ = jQuery;


  // fontsizer
  $('div.pagestyle').fontsizer();
  
  // labelize search input
  $('#qstr').labelizor();
  
  if (!window.EPLICA_loggedin) {

    // pngfix for IE6
    if ($.browser.msie) {
      $('img[src$=".png"]').ifixpng();
    }
    
    //zebra tables
    $('div.article table tr:even').addClass('alt');
  
  
  // activate imgpopper
  $('div.imagelist li a')
        .each(function(){
            // remove when jsp has been fixed
            var img = $(this).find('img')[0];
            this.href = img.src.replace('/list/', '/large/');
          })
          .imgPopper({
                curtainColor : '#ffffff',
                curtainOpacity : '0.75'
            });
  
  var article = $('div.article div.boxbody'),
      articleImages = $('> img, p > img, span > img', article);
  articleImages
      .each(function() {
          var imgSrc = $(this).attr('src'),
              largeImg = imgSrc.replace(/\/[^\/]+\/([^\/]+)$/, '/large/$1'),
              imgTitle = $(this).attr('alt');
          $(this)
              .wrap('<a title="'+ imgTitle +'" href="'+ largeImg +'"></a>');
        });
  articleImages
      .parent()
      .imgPopper({
            curtainColor : '#ffffff',
            curtainOpacity : '0.75'
        });
  $('div.article div.boxbody div.imgbox a img')
      .parent()
      .imgPopper({
            curtainColor : '#ffffff',
            curtainOpacity : '0.75'
        });
  }
  
  
  //remove flicker trick
  $('#noflickerCSS').remove();
  
  $('span.netfang, span.email').mailtoEnabler();
  
  // validate all forms
  $('form').autoValidate();
      
});
// **** /jqreq *****
