// JavaScript Document
function Ira(pagina,tar){
	var f= document.frmPrincipal;
	f.action=pagina;
	f.target=tar;
	f.submit();
}//fin de func

function limpiar(){
	var f= document.frmPrincipal;
	f.buscador.value='';
	
}//fin de func
function llenar(){
	var f= document.frmPrincipal;
	f.buscador.value='Búsqueda';
	
}//fin de func
function flip(col,nota){
	
	
	$.ajax({
			type: "POST",
			url: "flip.php",
			data: "col="+col+"&nota="+nota,
			beforeSend: function()
			{
				// Display something when the AJAX is loading.  This could be an image or just ext...
				$('#'+col).innerHTML = "cargando...";
			},
			success: function(html)
			{
				var response = html || "Error de datos";					
				$("#"+col).flip({
					direction: 'lr',
					color: '#cccccc',
					speed: 400,
					content: response
				});
				$("#"+col).css("background-image", "url(images/flipotrolado.gif)");
			},
		        error: function()
			{
				// Display something when the AJAX fails.  This could be an image or just text...
				$("#"+col).flip({ direction: 'tb', color: '#cccccc', content:"Error al cargar los datos!" }); 
			}
	});


}//fin de func
function regresar_flip(col){
	
	$("#"+col).revertFlip();
	$("#"+col).css("background-image", "url(images/cuadrodeflip.gif)");
}//fin de func

function ver_comentar(){
	    
		   $('#ver_comentarios').toggle();						  

}//fin de comentar

function getLoMas(num,seccion,subseccion,tipo,divorigen,divrespuesta,otrodiv){
	$("#"+otrodiv).removeClass("pestana_activada");
	$("#"+otrodiv).addClass("pestana");
	$("#"+divorigen).addClass("pestana_activada");
    $.get("get_lo_mas.php", { num: num, seccion:seccion, subseccion:subseccion, tipo:tipo},
	   function(data){
		 $('#'+divrespuesta).html(data).fadeIn('slow');
	}); 
}//fin de func
$(document).ready(function() {

  $('#economia').mouseover(function() {
    $.get("subsecciones.php", { seccion: 1},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#negocios').mouseover(function() {
    $.get("subsecciones.php", { seccion: 2},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#bancos').mouseover(function() {
    $.get("subsecciones.php", { seccion: 3},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#energia').mouseover(function() {
    $.get("subsecciones.php", { seccion: 4},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#tecnologia').mouseover(function() {
    $.get("subsecciones.php", { seccion: 6},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#global').mouseover(function() {
    $.get("subsecciones.php", { seccion: 7},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#sociedadycultura').mouseover(function() {
    $.get("subsecciones.php", { seccion: 8},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#inovacion').mouseover(function() {
    $.get("subsecciones.php", { seccion: 9},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  $('#puntodevista').mouseover(function() {
    $.get("subsecciones.php", { seccion: 10},
	   function(data){
		 $('#subsecciones').html(data);
	 });
  });
  
  
  $(function() {
    $(".anyClass").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		visible: 6
    });
  });

});
