$('document').ready(function () {

  $('#claims').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    speed:  'slow', 
    timeout: 5000,
		slideExpr: 'h3',
		cleartypeNoBg: true	});

	$('#slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    speed:  'slow', 
    timeout: 5000,
		slideExpr: 'img',
		random: true

	});
/*	
	$(window).bind('resize', function () {
		$('#slideshow img').each(function () {
			$(this).css({width: $('#slideshow').width()});		
		});
	});
*/		
	$('.lavaLamp').lavaLamp({
			fx: 'easeOutQuad',
			speed: 800,
			returnHome: $('li.current', this).length == 0,
			homeLeft: ($('li.current', this).length == 0 ? -1 : 0)
		});
	
	$('#print-product').click(function() {
//		$('#main-wrap').print();	
		window.print();	
	});
	
	$('.patologia h5').click(function () {
		if ($(this).next().hasClass('open')) {
			$(this).next().slideUp();
			$(this).next().removeClass('open');
		} else {
			$('.patologia h5 + ul[class*="open"]').removeClass('open');
			$('.patologia h5 + ul').slideUp();
			$(this).next().slideDown();
			$(this).next().addClass('open');
		}
	});
	
	if (window.location.hash) {
		if ($(window.location.hash).size() > 0) {
			$(window.location.hash + ' h5 + ul').slideDown();
		}
	}
		
	$(window).scroll(function() {
		if ($('#sidebar .container').length > 0) {
			var top = $('#sidebar .container').offset().top - parseFloat($('#sidebar .container').css('margin-top').replace(/auto/, 0));
			var topPadding	= 15;
			
	    if ($(window).scrollTop() > top) {
	        $('#sidebar .container').css({
	            marginTop: $(window).scrollTop() - top + topPadding
	        });
	    } else {
	        $('#sidebar .container').css({
	            marginTop: 0
	        });
	    }
		}
  });

	if ($.browser.msie) {
	  $('.round-box').corner('round 5px');
	}

});