$(document).ready(function(){

/*
Documento: acciones.js,
Empresa de desarrollo: Global Interactive,
Autor: jpberwart,

*/
$("#flash_head").css({ height: "438px" });
 var hash = window.location.hash.substr(0);
 
		  var href = $('#ul.panel li a, #modelo_version a, #modelo_color a, li.faq a').each(function(){
		  var href = $(this).attr('href');
		  if(hash==href.substr(0,href.length-0)){
		  var toLoad = hash+'.html #call';
		  $('#data').load(toLoad, {language: "html"})
      }
      });
		  

      $(document).ready(function() {
		  $('li.nav1 a, li.nav2 a, li.nav4 a, li.nav5 a, #modelo_version a, #modelo_color a, li.faq a').click(function(){
			  $('html, body').animate({scrollTop:0}, 'slow');
		  });
		  $('li.nav3 a').click(function(){
			  $('html, body').animate({scrollTop:300}, 'slow');
		  });
      });
	  
/********************************************************************1.-Primero llamamos activamos las acciones de los botones*/		  
		  $("ul.panel li a, #modelo_version a, #modelo_color a, li.faq a").click(function(){
																				  
			
					var toLoad = $(this).attr('href');
					
					
					$('#data').hide('fast', loadContent); 
					$('#contiene_cargador').append('<span id="load">LOADING...</span>');
    				$('#load').fadeIn('normal');
					window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-0);
					
					  function loadContent() {
						 $('#data').load(toLoad,'',showNewContent);
					  }
					  function showNewContent() {
						//$.timer(5000, function(){});  
						$('#data').fadeIn(2500, hideLoader); 
					  }
					  function hideLoader() {
					  	$('#load').fadeOut('slow');	
					  }
					  
					return false;
						
			 });

/*****************************************************************1.-Ahora se va hacia arriba en un click****/ 


/******************************************************************2.-anima el head*/

	 $("ul.panel li a, #modelo_version a, #modelo_color a, li.faq a").click(function(){
      		$("#flash_head").animate({ height: "360px" }, 1000 );
			//$('#data').hide('fast');
			$.timer(2000, function(){$.getScript("../Scripts/llamada_accordion.js");});
			$.timer(2000, function(){$.getScript("../Scripts/validacion_ajax.js");});
    });
	

					/*$("ul.panel li a, #modelo_version a, #modelo_color a").each(function(){
								 var href = $(this).attr("href");
								  $(this).attr({ href: "#"});
								  $(this).click(function(){
														 
										
										//$('#data').fadeOut(2400);
										$.timer(500, function(){  
														var call = $("#data").load(href);
														call.hide().fadeIn(2000);
														
											 });
										
										//$.timer(1000, function(){$.getScript("../Scripts/llamada_accordion.js");});
										$.timer(2000, function(){$.getScript("../Scripts/validacion_ajax.js");});
										
								  });
							   });*/
					
					
					$("ul.panel li a").each(function(){
						 $(this).click(function(){
								$('ul.panel li a').removeClass('active');
								$(this).addClass('active');
								this.blur();
								return false;
							});	
						});
					
	
					
	
	/*************Fin***************/
	});
	
	/***************Estas son pal Alex que le gusta controlar flash con Jquery***********************/
	
	/****************Agranda Head: Es para agrandar el Head con el click de descubre Honda*************************************/
	 				function agranda_head() {
					  	$("#flash_head").animate({ height: "438px" }, 1000 );
					  }
					  
	/****************Achica Head: Es para el inverso*************************************/				  
					  function achica_head() {
					  	$("#flash_head").animate({ height: "360px" }, 1000 );
					  }
					  
					  /****************Agranda Head: Es para agrandar el Head con el click de descubre Honda*************************************/
	 				function agranda_head2() {
					  	$("#flash_head_index_buscador").animate({ height: "438px" }, 1000 );
					  }
					  
	/****************Achica Head: Es para el inverso*************************************/				  
					  function achica_head2() {
					  	$("#flash_head_index_buscador").animate({ height: "360px" }, 1000 );
					  }
					  
					   function normal_head() {
					  	$("#flash_head_index_buscador").animate({ height: "99px" }, 1000 );
					  }
	
