// JavaScript Document
jQuery(document).ready(function(){



	$("#izquierda").height($("#derecha").height());
	/**********************************/
	/* SUBMENU AUTOS */
	/**********************************/
	
	$("#modelos-btn").click(function() { 
		
		$(this).css({ backgroundPosition : "-158px 0px"}).parent().find("ul#subnav").slideDown('fast').show();
	   
		$(this).parent().hover(function() {  
			$("#modelos-btn").css({ backgroundPosition : "-158px 0px"});
		}, function(){
			$(this).parent().find("ul#subnav").slideUp('slow', function(){
				$("#modelos-btn").css({ backgroundPosition : "0px 0px"});
			}); 
		});  
		
	});  
		

});
var activo="";
function mostrar_categoria(cat){
	if(activo == ""){
		ocultar_todos();
		$("#cat-"+cat).show();
		activo=$("#cat-"+cat);
	}else{
		$(activo).hide();
		$("#cat-"+cat).show();
		activo=$("#cat-"+cat);
		}
		$("#izquierda").height($("#derecha").height());
}
function ocultar_todos(){
	$('.ficha-categoria').each(function(index) {
    $(this).hide();
  });
	$("#izquierda").height($("#derecha").height());
}
function mostrar_todos(){
	$('.ficha-categoria').each(function(index) {
    $(this).show();
	
  });
activo="";
$("#izquierda").height($("#derecha").height());
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
	}
//////////////////////////////////////////////////////////////////////////////////////
/// para activar el menu de la pagina que estoy viendo
//////////////////////////////////////////////////////////////////////////////////////
function activarMenu(sec){
	//console.log(sec);
	if(sec!="none"){
	$("#sec"+sec).next().css("display", "block");
	return $("#sec"+sec+".boton");
	}
	}
	
function mostrarPrecio(obj) {
  var el = document.getElementById(obj);
 // el.innerHTML = 'Desde $ 349,000.00';
  $("#precio-layer").css({display: "inline"});
  $("#precio-layer").height($("#cont-mod-auto").height());
  $("#precio-layer").stop().animate({opacity: 1}, 600 );
}
function quitarPrecio(obj) {
  var el = document.getElementById(obj);
 // el.innerHTML = 'PRECIO';
  $("#precio-layer").stop().animate({ opacity: 0 }, 600 ,function(){$("#precio-layer").css({display: "none"});});
  // $("#precio-layer").css({ opacity: 0 });
}
