$(function(){
	var win = $.os.name;
	if (win != "win") {
		$(".sub #header .sections .link").css("font-size-adjust", ".502");
	}
	$("dl.tabs dt").click(function(){$(this).siblings().removeClass("selected").end().next("dd").andSelf().addClass("selected");});

	$('#filial, #language').click(function(){
		$(this).children('.list').slideDown('fast').end().mouseleave(function(){
			$(this).children('.list').slideUp('fast');
		});
	});
	
	$("#sliding .wrap").hover(on, out);
		function on(){$(this).animate({top: $(this).parent().height()-$(this).height() + "px"}, 2000);};
		function out() {$(this).animate({top: "0"}, 2000);};
	$('#slides-analytics #sections').carousel({loop:true,autoSlide:true,autoSlideInterval:4000,delayAutoSlide:2000,dispItems:3,effect:"slow",pagination:true});
	$('#content DL.collapsable dt').collapsor({sublevelElement:'dd', speed: 1000});
	$('#content .collapsableElement').collapsor({sublevelElement:'.subElement', speed: 1000});
	$('#liqpay-slides #sections').carousel({loop:false,dispItems:1,effect:"fade",pagination:true});
	$('a[rel*=lightbox]').fancybox({'overlayOpacity' : 0.8, 'overlayColor' : '#111'});
	$("a[href^=http://webim.brocompany.com]").click(function(){window.open(this.href);return false;});
	
	$(".has-tooltip").tooltip({cssClass:"tooltip"});
}); 

/**
 *jQuery Collapsor
 *
 */
(function($) {$.fn.collapsor = function(settings){settings = $.extend({}, $.fn.collapsor.defaults, settings);var triggers = this;return this.each(function(){$(this).find('+ ' + settings.sublevelElement).hide();if($(this).hasClass(settings.openClass)){$(this).find('+ ' + settings.sublevelElement).show();}$(this).click(function(){$(triggers).not($(this)).removeClass(settings.openClass);if ($(this).next().is(settings.sublevelElement)){$(this).blur().toggleClass(settings.openClass);$(this).next().animate({height:'toggle', opacity:'toggle'}, settings.speed, settings.easing);$(this).parent().parent().find(settings.sublevelElement).not($(this).next()).animate({height:'hide', opacity:'hide'}, settings.speed, settings.easing);return false;}});});};$.fn.collapsor.defaults={activeClass: 'active',openClass:'open',sublevelElement: 'ul',speed: 500,easing: 'swing'};})(jQuery);