$(document).ready(function(){	
				
	$('.menu a[href*=#],#active').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').animate({scrollTop: targetOffset}, 1000);
		  if(this.hash.slice(1)=='nosotros'){
		  $('#active').animate({top: 670}, 1000);
		  }
		  if(this.hash.slice(1)=='servicios'){
		  $('#active').animate({top: 1247}, 1000);
		  }
		  if(this.hash.slice(1)=='proyectos'){
		  $('#active').animate({top: 1864}, 1000);
		  }
		  if(this.hash.slice(1)=='contacto'){
		  $('#active').animate({top: 2141}, 1000);
		  }
		  return false;
		}
	  }
	});
	
	$('.menu2 a[href*=#],#active').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').animate({scrollTop: targetOffset}, 1000);
		  if(this.hash.slice(1)=='nosotros'){
		  $('#active').animate({top: 625}, 1000);
		  }
		  if(this.hash.slice(1)=='servicios'){
		  $('#active').animate({top: 1233}, 1000);
		  }
		  if(this.hash.slice(1)=='proyectos'){
		  $('#active').animate({top: 1799}, 1000);
		  }
		  if(this.hash.slice(1)=='contacto'){
		  $('#active').animate({top: 2497}, 1000);
		  }
		  return false;
		}
	  }
	});
	
	
	$('#active').css("left",(($(window).width()+940)/2)+"px");

	$(window).resize(function(){
			$('#active').css("left",(($(window).width()+940)/2)+"px");
			});
			
			
	$("#pageflip").hover(function() { //On hover...
        $("#pageflip img , .msg_block").stop()
                .animate({ //Animate and expand the image and the msg_block (Width + height)
                        width: '200px',
                        height: '200px'
                }, 500);
        } , function() {
        $("#pageflip img").stop() //On hover out, go back to original size 50x52
                .animate({
                        width: '88px',
                        height: '88px'
                }, 220);
        $(".msg_block").stop() //On hover out, go back to original size 50x50
                .animate({
                        width: '85px',
                        height: '85px'
                }, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
		});

});	
