// JavaScript Document
//mostrar documentos lihgtbox
	  var GB_ANIMATION = true;
      $(document).ready(function(){
        $("a.video").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_show(t,this.href,650,600);
          return false;
        });
		 $("a.pdf, a.link").click(function(){
			  var t = this.title || $(this).text() || this.href;
			  GB_show(t,this.href,700,900);
			  return false;
			});
		$("a.info").click(function(){
		  var t = this.title || $(this).text() || this.href;
		  GB_show(t,this.href,650,710);
		  return false;
		});
		$("a.boletin").click(function(){
		  var t = this.title || $(this).text() || this.href;
		  GB_show(t,this.href,450,450);
		  return false;
		});
      });
	
	  
  $(document).ready(function(){
							 
	/*Buscador*/
	$(".buscador").click(function () {
        //$(this).val("Buscar").hide(500, function(){$(".buscador").val("").fadeIn(100)});
		$(".buscador").val("").fadeIn(100);
    });
	$(".buscador").blur(function () {
		if ( $(this).val()==''){
		$(".buscador").val("").fadeOut(100,function(){$(this).val("Buscar").fadeIn(500)});
         
		}
    });
	/*menu superior*/
	$(".SubMenu").hide();
	$(".MenuSupBtn img").click(function () { 
		$(".SubMenu").fadeOut(250);
		var indice = $(".MenuSupBtn img").index(this);
		$(".SubMenu:eq("+indice+")").slideDown("slow");	
		$("tr.MenuSupBtn td:eq("+indice+")").hover(
		  function () {

		  }, 
		  function () {
			$(".SubMenu").fadeOut(250);
		  }
		);
	});

	/*menu familias*/
	$("div.FamiliaDesplegar").hide();
	$(".familia").click(function () {
		//$(".SubMenu").fadeOut(250);
		//$(".FamiliaDesplegar").slideUp(250);
		var indfamilia = $(".familia").index(this);
		$(".familia:eq("+indfamilia+")+div").slideToggle("slow");	
	});
	/*añadir al carrito*/
	$("#CajaAnadirFin").hide();
	$("div.anadirOk").hide();
	$("#productoEnCesta").hide();
	$("input.annadir").click(function(){
		var NCaja = $(this).val();		
		if ($("input#" + NCaja).val() == ''){
			alert('Debe especificar las unidades que desea añadir')
		}else{
			if (isNaN($("input#" + NCaja).val())){
				alert('Añada las unidades en numeros')
			}else{
				if(parseFloat($("input#" + NCaja).val()) > 1200){
					alert('La cantidad máxima por pedido es de 1.200 unidades')
				}else{
					$("div#ContCesta").load("cesta2.asp?Cod_Producto=" + $("input#cual_" + NCaja).val() + '&Cantidad=' + $("input#" + NCaja).val());
					/*$("#anadir").fadeOut("fast",function(){$("div.anadirOk").fadeIn("slow");});*/
					/*$("div.anadirOk").fadeIn("slow");*/
					$("#Linea_" + NCaja).fadeOut("slow");
					$("div.anadirOk").fadeOut("slow",function(){$("#productoEnCesta").fadeIn("slow",function(){$("#productoEnCesta").fadeOut("slow",function(){$("div.anadirOk").fadeIn("slow")});});});
					
				}
			}
		}
		
	});
	/*Mas fotillos desplegar*/
	$("#Mas_Fotillos").hide();
	$("#Mas_Fotillos_Btn_Cerrar").hide();
	$("a.Mas_Fotillos_Btn").click(function(){$("#Mas_Fotillos").show("fast",function(){$("#Mas_Fotillos_Btn").hide("fast",function(){$("#Mas_Fotillos_Btn_Cerrar").show("fast")});});});
	$("a.Mas_Fotillos_Btn_Cerrar").click(function(){$("#Mas_Fotillos").hide("fast",function(){$("#Mas_Fotillos_Btn").show("fast",function(){$("#Mas_Fotillos_Btn_Cerrar").hide("fast")});});});
	/*enlaces dynacloud*/
	
	
	/*carga carito*/
	$("div#ContCesta").load("cesta2.asp");
	
	
	$("div#ContCesta").ajaxComplete(function(request, settings){
		$("#cesta div").hide("fast",
			function(){$("#cesta").slideUp("slow",
			function(){$("#cesta").slideDown("slow",
			function(){$("#cesta div").fadeIn("slow"
			)}
			)}
			)}
		);
		$("a.comprar").click(function(){
		  var t = this.title || $(this).text() || this.href;
		  GB_show(t,this.href,600,750);
		  return false;
		});
 	});
	 /*Fndo de articulos del listado*/
	     $("div.articulo").hover(
      function () {
        $(this).css({ backgroundColor:"#fee9f0" });
      }, 
      function () {
        $(this).css({ backgroundColor:"" });
      }
    );
	

  });
/*menu de salto de dreamweaver*/
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
