/*@cc_on/*@if(@_jscript_version<5.7)try{document.execCommand('BackgroundImageCache',0,1)}catch(e){}/*@end@*/

jQuery.noConflict();

(function($) {

  if (!window.EPLICA_loggedin) {

    $('form').autoValidate();
    
    // pngfix for IE6
    if ($.browser.msie) {
      $('img[scr$=".png"]').ifixpng();
    }
    
    //popup links
    if (window.popupLinks) {
        delete popupLinks.config.popup; // remove the default config
        Object.merge(popupLinks.config, {
          'a[href$=.pdf]':   ['_blank', ''],
          'a[href$=.doc]':   ['_blank', ''],
          'a[href$=.mov]':   ['_blank', ''],
          'a[href$=.wmv]':   ['_blank', ''],
          'a[href$=.mpeg]':  ['_blank', '']
        });
        popupLinks.init();
    }
    
    //fontsizer
    $('div.pagestyle').fontsizer();
    
    //datepicker
    if (window.datePicker) {
      datePicker.init();
    }

    if (window.collapseSections) {
      collapseSections.config = {
          'div.dropmenu' : {
            handle      : 'collapse',
            headSel     : "h2.boxhead",
            startOpen   : 0,
            showControls : 0,
            hoverOpen   : false,
            hoverClose  : false
          }
        };
      collapseSections.init();
    }
    
    //labelize
    $('#qstr').labelizor();


    if (window.zebraLists) {
      zebraLists.init({
        '.people table' : { 
          items : 'tr',
          subClasses : ['subrow'],
          excludeClasses : ['subtotal','total','th'],
          oddClass  : 'alt',
          handle    : 'zebra'
        },
        'table.zebra' : { 
          items : 'tr',
          subClasses : ['subrow'],
          excludeClasses : ['subtotal','total','th'],
          oddClass  : 'alt',
          handle    : 'zebra'
        }
      });
    }

    if(window.marquee) {
      marquee.config = {
        marquee : {
          container       : "div.framundan ul",
          listitems       : "li",
          stepsize        : 1,     // px
          speed           : 20,    // delay (ms/step)
          centrePause     : 5000,  // 0 = [no pause]
          mouseoverPause  : true,
          scrollfrom      : "top"   // top, bottom, left, right
        }
      };

      marquee.init();
    }
  

    //radio box block switcher
    var swHandler = {
      _click : function( e )
      {
        var val = DOM.getOptionValue( e.currentTarget  );
        for (var i=0,l=this._togElms.length; i<l; i++)
        {
          this._togElms[i].style.display = (this._togElms[i].id == val) ? "block" : "none";
        }
      },

      init : function()
      {
        var _sw = DOM.get("#xxa5")[0];
        if (_sw) {
          this._togElms = DOM.get(".swbox");
          if (this._togElms.length)
          {
            Event.add(_sw, "click", this._click, this);
            Event.add(_sw, "keyup", this._click, this);
            this._click({ 'currentTarget' : _sw });
          }
        }
      }
    };
    swHandler.init();
  
  }

  //flicker trick
  $('#noflickerCSS').remove();

})(jQuery);