function ajax(sec){
		// Agrego el "Cargando..."
	if (seccion!=sec){
		seccion = sec;
		var indice = 0;
		if (sec=='steelFraming'){
			indice = 0;
		}else if (sec=='dryWall'){
			indice = 1;
		}else if (sec=='aberturas'){
			indice = 2;
		}else if (sec=='desarrollos'){
			indice = 3;
		}else if (sec=='contacto'){
			indice = 4;
		}
		var acordeon = jQuery('#menu');
		acordeon.accordion("activate", indice);
		$('.contenido').html('<br /><br /><div class="cargando"><img src="imagenes/loading.gif" border="0" /><br /><br />Cargando, por favor espere...</div>');
		
		$.ajax({
			 url: 'includes/switch.php'
			,type: 'POST'
			,data: ({
				seccion: sec
			})
			,success: function(response){
				$('.contenido').html(response);
			}
			,failure: function(){
				$('.contenido').html('ERROR AL CARGAR LA SECCI&Oacute;N.<br />Por favor, intente nuevamente.');
			}
		});
	}
}


function ajaxAcordeon(sec){
		// Agrego el "Cargando..."
	if (seccion!=sec){
		seccion = sec;
		$('.contenido').html('<br /><br /><div class="cargando"><img src="imagenes/loading.gif" border="0" /><br /><br />Cargando, por favor espere...</div>');
		
		$.ajax({
			 url: 'includes/switch.php'
			,type: 'POST'
			,data: ({
				seccion: sec
			})
			,success: function(response){
				$('.contenido').html(response);
			}
			,failure: function(){
				$('.contenido').html('ERROR AL CARGAR LA SECCI&Oacute;N.<br />Por favor, intente nuevamente.');
			}
		});
	}
}
	




function galerias(galeria){
	// Agrego el "Cargando..."
	$('.contenido').html('<br /><br /><div class="cargando"><img src="imagenes/loading.gif" border="0" /><br /><br />Cargando, por favor espere...</div>');
	
	$.ajax({
		 url: 'includes/listar_imagenes_ajax.php'
		,type: 'POST'
		,data: ({
			galeria: galeria 
		})
		,success: function(response){
			$('.contenido').html(response);
		}
		,failure: function(){
			$('.contenido').html('ERROR AL CARGAR LA SECCI&Oacute;N.<br />Por favor, intente nuevamente.');
		}
	});
}

function irSeccion(seccion){
	// Agrego el "Cargando..."
	$('.contenido').html('<br /><br /><div class="cargando"><img src="imagenes/loading.gif" border="0" /><br /><br />Cargando, por favor espere...</div>');
	
	$.ajax({
		 url: 'includes/switch.php'
		,type: 'POST'
		,data: ({
			seccion:seccion 
		})
		,success: function(response){
			$('.contenido').html(response);
		}
		,failure: function(){
			$('.contenido').html('ERROR AL CARGAR LA SECCI&Oacute;N.<br />Por favor, intente nuevamente.');
		}
	});
}


function ajaxMenu(sec){
	objFlash = swfobject.getObjectById('menuFlash');
	objFlash.ajaxSwf(sec);
}

function volver(){
	$('.contenido').html('<br /><br /><div class="cargando"><img src="imagenes/loading.gif" border="0" /><br /><br />Cargando, por favor espere...</div>');
	$.ajax({
		 url: 'includes/switch.php'
		,type: 'POST'
		,data: ({
			seccion: seccion
		})
		,success: function(response){
			$('.contenido').html(response);
		}
		,failure: function(){
			$('.contenido').html('ERROR AL CARGAR LA SECCI&Oacute;N.<br />Por favor, intente nuevamente.');
		}
	});
}


