$( function()
{
	// JS SUPPORT BEGIN
	
	$(config.js_support).addClass('js');
	
	// JS SUPPORT END
	
});

// NIVO SLIDER INITIALIZATION BEGIN

$(window).load( function()
{
	// image sliders should be initialized, when all images are loaded ($(window).load(), not $(document).ready())
	$(config.nivo.elements).nivoSlider(config.nivo.options);
	
	$nivo_control = $('div.nivo-controlNav');
	
	$nivo_control.each( function()
	{
		parent_width = $(this).parent().width() / 2;
		control_width = $(this).outerWidth(true) / 2;

		$(this).css('margin-left', parent_width - control_width);
	});
	
	if ($.browser.msie || ($.browser.mozilla && $.browser.version < '1.9') || $.browser.opera)
	{
		$(config.nivo.elements).wrap($('<div />').addClass('border'));
	}
	
	// SLIDERS BEGIN
	/*
	$('#partners').slider
	({
		nav: 'ul.slider-nav',
		items: 'ul.items',
		visible: 5,
		slide: config.partners.slide,
		speed: config.partners.speed,
		fade: config.partners.fade,
		easing: config.partners.easing
	});
	
	
	$('div.success-stories').slider
	({
		nav: 'ul.slider-nav',
		items: 'ul.items',
		wrapper_class: 'success-stories-wrapper',
		visible: 1,
		slide: 1,
		speed: config.success_stories.speed,
		fade: config.success_stories.fade,
		easing: config.success_stories.easing
	});
	
	$('div.success-stories-wrapper').css
	({
		'padding-left': '1px',
		'padding-right': '1px'
	});
	*/
	$('div.testimonials').each( function()
	{
		width = $(this).width();
		
		$(this).children('ul.items').children('li').css('width', width - (width * 0.2));
	});
	
	$('div.testimonials').slider
	({
		nav: 'ul.slider-nav',
		items: 'ul.items',
		visible: 1,
		slide: 1,
		speed: config.testimonials.speed,
		fade: config.testimonials.fade,
		easing: config.testimonials.easing,
		auto_height_parent: true
	});
	
	// SLIDERS END
	
	// DESCRIPTION FOR IMAGES FROM TITLE ATTRIBUTE BEGIN
	/*
	$('a.frame > img').each( function()
	{
		width = $(this).width();
			
		if ($(this).next('span.title-description').length > 0)
		{
			$(this).next('span.title-description').css('width', width);
		}
	});
		*/
	// DESCRIPTION FOR IMAGES FROM TITLE ATTRIBUTE END
});

// NIVO SLIDER INITALIZATION END

