
$(document).ready(function() {
	$('#linkServicios').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			&& location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').stop().animate({scrollTop: targetOffset}, 1500, 'easeOutBounce');
				return false;
			}
		}
	});
	$('#linkContacto').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
			&& location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').stop().animate({scrollTop: targetOffset}, 1500, 'easeOutBounce');
				return false;
			}
		}
	});

	$("#IrArriba").hide();
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 200) {
				$('#IrArriba').fadeIn();
			} else {
				$('#IrArriba').fadeOut();
			}
		});
		$('#IrArriba a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});
});