// JavaScript Document
Shadowbox.loadSkin('classic', 'shadowbox/skin'); // use the "classic" skin
Shadowbox.loadLanguage('es', 'shadowbox/lang'); // use the English language
Shadowbox.loadPlayer(['img', 'qt'], 'shadowbox/player'); // use img and qt players
jQuery(document).ready(function(){
	
	$("#campo_busqueda").keypress(function(e) {
		if (e.keyCode == 13) {
			document.location.href="productos.php?vb="+$("#campo_busqueda").val();
		}
	});
	jQuery('.tooltip').tooltip({
		track: true,
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250				   
	});

	jQuery('#swftop').flash({
		src: 'imagenes/botonera.swf',
		width: 956,
		height: 49,
		wmode: "transparent",
		flashvars:{
				seccionactual:_seccionactual,
				idiomaactual:_idiomaactual
		}
	});
	jQuery('#swftop2').flash({
		src: 'imagenes/top.swf',
		width: 956,
		height: 114,
		wmode: "transparent",
		flashvars:{
				seccionactual:_seccionactual,
				idiomaactual:_idiomaactual
		}
	});
		jQuery('#swftop3').flash({
		src: 'imagenes/proyector2.1.swf',
		width: 716,
		height: 212,
		wmode: "transparent",
		flashvars:{
				seccionactual:_seccionactual,
				idiomaactual:_idiomaactual
		}
	});

	InicializaShadowbox();
	if(_idcategoria != ""){
		$("#subcategorias_"+_idcategoria).show("fast",function(){		
			equalHeight($(".columnas"));
		});
		$("#subcategoria_"+_idsubcategoria).addClass("seleccionado");
	}else{
		equalHeight($(".columnas"));
	}	
	
});
function InicializaShadowbox(){
		var option = {
			resizeLgImages: true,
			displayNav: true,
			handleUnsupported : 'remove',
			keysClose: ['c', 27]
		};
		Shadowbox.init(option);    
	}
          
function BuscarProducto(){
	document.location.href="productos.php?vb="+$("#campo_busqueda").val();
}
function LinkMarcas(){
	document.location.href=$("#marcas_nologos").val();
}

function equalHeight(group) {
    tallest = 0;
    group.each(function() {
        thisHeight = $(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }				
    });
    group.height(tallest);
}
