// JavaScript Document
jQuery(document).ready(function(){
var activo="";
$('div#mlateral-contenido').height($('div#derecha').height());
$.ajax({
		  url:  "includes/menu-lateral-autos.php",
		success: function(){
   				$('.boton').click(function() {
				if($(activo).attr('id')!= ""){;
				$(activo).next().slideToggle('normal');};
				
				if($(this).attr('id') == $(activo).attr('id')){
					activo="";
				}else{
					$(this).next().slideToggle('normal');
					activo=this;	
					};
					
				direccion=$(this).children().attr('href');
		
				if(direccion!="javascript: void(0)"){
				   document.location(direccion);
				   }
				   
				return false;
				});
	sub_activo=activarMenu($('#informativo').attr('indice'));

   }
})


	/**********************************/
	/* SUBMENU AUTOS */
	/**********************************/
	$('#modelos-btn').click(function() { 
		
		$(this).css({ backgroundPosition : "-158px 0"}).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"});
			}); 
		});  
		
	});  
		

});

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 });
}