$(window).load(function(){
		
		//..................................................................................................................................................
		//PLUGIN'S CALLS:
		
  //New Select plugin
		//comboboxes (no select, no errors):
		//$(this).newSelect({identifier:'select'});
  //WLRS feature for language selects (no wlrs select, no errors):
		

  //Slide Navigation plugin (no navi, expect errors):
  var companyTopNaviLength = $('#company-navigation-top').children().children().children().length;

  //Horizontal Navigation plugin (no horizontal navi, no errors):
  //company navigations:
  $(this).horizontalNavi('#company-navigation-top', 2);
  $(this).horizontalNavi('#company-navigation-bottom', false);
  //crumb navigation:
  $(this).horizontalNavi('#crumb-navi', false);

  //Fancy Input plugin (no fancy inputs, no errors):
  $(this).fancyInput({inputs:'.fancy-input',labels:'.fancy-label'});

  //ScrollPane plugin for vertical navi, only if subitems are larger then var a (no .branch-navi-subitems-pane, no errors):
  var a = '.branch-navi-subitems-pane';
  if($(a).is('div')){
    var b = $(a).height();
    if(b > 400){
	     b = 200;
    };
 	  $(a).css({height:b + 'px'});
	   $(a).jScrollPane({showArrows:true,scrollbarWidth:18,arrowSize:19,wheelSpeed:15});
	   //with height reducing of ".branch-navi-subitems-pane "- rebuild left "form layout" in old ies,
		  //cause there are old~ies~#expression(s) for this "form layout" in stylesheet and it needs manual rebuild:
	   if($.browser.msie && parseInt($.browser.version) < 8){
			   var c = 11;
			   $('#branch-navi').children().children('div:nth-child(2)').children('div:nth-child(2)').each(function(){
				    $(this).children().each(function(){
				      c += $(this).height();
				    });
			     $(this).css({height:c + 'px'});
		    });
		  };
  };

  //..................................................................................................................................................
  //WEB-CUSTOMIZE ACTIONS:
  
  //tabindex for google top form elements, tabindex for other "a" elements, which are not in header in opera:
  $('#google-search-top-input').attr('tabindex', companyTopNaviLength + 3);
  $('#google-search-top-submit').attr('tabindex', companyTopNaviLength + 4);
  if($.browser.opera){
    $('#body *').each(function(i){
      if($(this).is(':input, a')){
        $(this).attr('tabindex', tabIndex + i);
      };
		});
  };

  //for every "a" element with class "outofdomain" add atribute target="_blank":
  $('.outofdomain, ._blank').each(function(){
    if($(this).is('a')){
      //for "a" elements bottom menu:
      $(this).attr('target', '_blank');
    }else{
		    //for "a" elements in slide navi and vertical menu:
      $(this).parent().parent().attr('target', '_blank');
    };
  });
  
  // TEST
  $(".detail_product").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	showBody: " - ",
	extraClass: "pretty fancy",
	top: 25,
	left: -150
  });

  
  //for every input type/button and type/submit - on hover events, focus and blur events manage hover class:
  $(':button').each(function(i){
		  $(this).parent().hover(function(){$(this).children().addClass('hover');$(this).addClass('hover')},function(){if(!$(this).hasClass('focused')){$(this).children().removeClass('hover');$(this).removeClass('hover')}});
    $(this).focus(function(){$(this).parent().addClass('hover focused');$(this).addClass('hover')});
    $(this).blur(function(){$(this).parent().removeClass('hover focused');$(this).removeClass('hover')});
  });
  $(':submit').each(function(i){
    $(this).hover(function(){$(this).addClass('hover')},function(){if(!$(this).hasClass('focused')){$(this).removeClass('hover')}});
    $(this).focus(function(){$(this).addClass('hover focused');});
    $(this).blur(function(){$(this).removeClass('hover focused');});
  });
  

		


  $(".accordion .solo").hide();
  $(".accordion .accordion-box").hide();

      $(".accordion .column-list-link a").click(function(event){
       $(this).parent().parent().find(".solo").toggle();
	$(this).parent().parent().find(".accordion-box").toggle();
       
       // Stop the link click from doing its normal thing
       event.preventDefault();
     }); 
     
     
     
   $(".photo-gallery a").attr('rel', 'shadowbox[gallery]');

	// this is for adding to MENU->LI a class for IE6
	// this is for adding to SUB_MENU->LI a class for IE6
	// this is for adding to LANGUAGE_MENU->LI a class for IE6
	$("#sub_menu li, #locales li").mouseover(function() {
		$(this).addClass('sfhover');
	}).mouseout(function() {
		$(this).removeClass('sfhover');
	});
//	if ($(this).browser) {
		$("#nav > li").mouseover(function() {
			$(this).addClass('sfhover');
		}).mouseout(function() {
			$(this).removeClass('sfhover');
		});
//	}


});

