/*@cc_on/*@if(@_jscript_version<5.7)try{document.execCommand('BackgroundImageCache',0,1)}catch(e){}/*@end@*/

Req(
  'eutils',
  'fontsizer',
  'imgpop',
  'popups',
  'autovalidate',
  'mailtoenabler',
  function(){
    var $ = jQuery,
        ie6 = $.browser.msie && $.browser.version < 7;

    $('a.popup, .popup a').popUps({
        minimal: true,
        width:   100,
        height:  100
      });
    $('a.flash, .flash a').popUps({
        minimal: true,
        target:  'flash',
        width:   500,
        height:  375
      });


    $('div.people').Req('/bitar/common/personas/loadEmployee.js', function(){ this.eplicaEmployeeLoader(); });

    if (!window.EPLICA_loggedin)
    {
      $('.netfang').mailtoEnabler().filter('strong, em, b, i').zap();
    }
    $('.pagestyle').fontsizer();
    $('form').autoValidate();
    
    
    
    /* Christmas splash screen
    if (!ie6) {
      $('body.home').run(function() {
        var banner = $(this).find('div.imgrotor0 a'),
            splash = $('<div class="ipopup-curtain" style="position:fixed;background:#000;width:100%;height:100%;top:0;left:0;cursor: pointer;" title="loka"></div>' +
                      '<div class="splash" style="position:absolute;z-index:110;left:50%;margin-left:-350px;width:700px;padding-bottom:10px;cursor: pointer;" title="loka">' +
                      '<div class="boxbody">' +
                        '<img src="'+ banner[0].href +'" />' +
                      '</div>' +
                    '</div>'),
            closeSplash = function() { splash.fadeOut(500, function(){ splash.remove(); }); };
        
        banner.bind('click', function() {
          splash
              .hide()
              .appendTo('body')
              .filter('.splash')
                  .css({
                      top:  10 + $(window).scrollTop()
                    })
              .end()
              .filter('.ipopup-curtain')
                  .css({
                      opacity: .7
                    })
              .end()
              .fadeIn(400, function(){ setTimeout(function(){ closeSplash(); }, 7000); })
              .click(function(){
                  closeSplash();
                });
            return false;
          });

        if(!$.cookie('splash'))
        {
          splash.find('img:first').bind('load readystatechange', function() {
              banner.trigger('click');
            });
          splash.find('img')[0].src += ''; //readystate hack
        }
        $.cookie('splash', 'splash', { path:'/', expires:360 });
      })
    } // end splash */

  }
);