$(document).ready(function(){
					 
 $('.menu > li.boton ')
	.hover(
      function(){
        $(this).stop()
          .animate({
			'marginTop': "-10px"
          }, 300);  
	  },
	  function(){
        $(this).stop()
          .animate({
			'marginTop': "2px"
          }, 300);
	  }
	);
	
	$("#menuDw > li.boton").click(function(e){
		$("li.activoDw").removeClass("activoDw");
		$(this).addClass("activoDw");
		$(".contenido").fadeOut();
		$('#'+this.id+'d').fadeIn();
   });
	
   $("#menuDm > li.boton").click(function(e){
		$("li.activoDm").removeClass("activoDm");
		$(this).addClass("activoDm");
		$(".contenido").fadeOut();
		$('#'+this.id+'d').fadeIn();
   });
	
   $('.linkM').click(function(event){
		$('#cntc').show("slow");  
   });
   
   $('.cerrarC').click(function(event){
	$('#cntc').hide("slow")
   });

   $('.btnMail').click(function(event){
		$("#envMail").html("<p><img src='imagenes/icoLoad.gif' width='12' /> <b>Enviando.</b></p>")
		$("#envMail").load("enviarMail.php",{n:$("#n").serialize(),m:$("#m").serialize(),t:$("#t").serialize()})
   });
   
   $('#IE').click(function(event){
	$('#IE').hide("slow")
   });

   $(function(){
   var $win = $(window);
   $win.scroll(function (){
   		if($win.scrollTop() == 0)
        	$(".scrollTo").fadeOut();
		else 	
		$(".scrollTo").fadeIn();
        });
   });
   
   $(".toolTipDw").hover(
		function() {
		this.tip = this.title;
		$(this).append(
			'<div class="toolTipWrapperDw">'
				+'<div class="toolTipTopDw"></div>'
				+'<div class="toolTipMidDw"><p>'+
					this.tip
				+'</p></div>'
				+'<div class="toolTipBtnDw"></div>'
			+'</div>'
		);
		this.title = "";
		this.x = 0;
		this.y = 0;
		$(".toolTipDw").mousemove(function(e){
      		this.x = e.pageX;
	  		this.y = e.pageY;
   		});	
		$(this).find(".toolTipWrapperDw").css({bottom:this.y+10,left:this.x})
		$(".toolTipWrapperDw").fadeIn(400);
	},
	function() {
		$(".toolTipWrapperDw").fadeOut(400);
		$(this).children().remove();
			this.title = this.tip;
		}
	);
   
   $(".toolTipDm").hover(
		function() {
		this.tip = this.title;
		$(this).append(
			'<div class="toolTipWrapperDm">'
				+'<div class="toolTipTopDm"></div>'
				+'<div class="toolTipMidDm"><p>'+
					this.tip
				+'</p></div>'
				+'<div class="toolTipBtnDm"></div>'
			+'</div>'
		);
		this.title = "";
		this.x = 0;
		this.y = 0;
		$(".toolTipDm").mousemove(function(e){
      		this.x = e.pageX;
	  		this.y = e.pageY;
   		});	
		$(this).find(".toolTipWrapperDm").css({bottom:this.y+10,left:this.x})
		$(".toolTipWrapperDm").fadeIn(400);
	},
	function() {
		$(".toolTipWrapperDm").fadeOut(400);
		$(this).children().remove();
			this.title = this.tip;
		}
	);
	
	$(".i").click(function()
	 {
		var e = $(this).attr("id");
		$("#"+e+"I").fadeIn("slow");
	 });
	
	$(".c").click(function()
	 {
		var p = $(this).parent().parent().attr("id");
		$("#"+p).fadeOut("slow");
	 });
	

});
