// AJAX Calls

// "Quienes" AJAX Call
function quienes_loader() {
  $('#panelQuienes').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('quienes_go()', 800);
}
function quienes_go() {
  $('#panelQuienes').load("content.html #panelQuienes");
}

// "Marcas" AJAX Call
function marcas_loader() {
  $('#panelMarcas').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('marcas_go()', 1500);
}
function marcas_go() {
  $('#panelMarcas').load("content.html #panelMarcas", function(){
$('#slideshowMarcas').cycle({
		fx:	'scrollHorz',
		sync:	true,
		//easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}                                    

// "Editorial" AJAX Call
function editorial_loader() {
  $('#panelEditorial').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('editorial_go()', 1500);
}
function editorial_go() {
  $('#panelEditorial').load("content.html #panelEditorial", function(){
$('#slideshowEditorial').cycle({
		fx:       'scrollLeft',
		easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}

// "Stands" AJAX Call
function stands_loader() {
  $('#panelStands').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('stands_go()', 1500);
}
function stands_go() {
  $('#panelStands').load("content.html #panelStands", function(){
$('#slideshowStands').cycle({
		fx:       'scrollLeft',
		easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}

// "Eventos" AJAX Call
function eventos_loader() {
  $('#panelEventos').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('eventos_go()', 1500);
}
function eventos_go() {
  $('#panelEventos').load("content.html #panelEventos", function(){
$('#slideshowEventos').cycle({
		fx:       'scrollLeft',
		easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}

// "Impresos" AJAX Call
function impresos_loader() {
  $('#panelImpresos').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('impresos_go()', 1500);
}
function impresos_go() {
  $('#panelImpresos').load("content.html #panelImpresos", function(){
$('#slideshowImpresos').cycle({
		fx:       'scrollLeft',
		easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}

// "Avisos" AJAX Call
function avisos_loader() {
  $('#panelAvisos').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('avisos_go()', 1500);
}
function avisos_go() {
  $('#panelAvisos').load("content.html #panelAvisos", function(){
$('#slideshowAvisos').cycle({
		fx:       'scrollLeft',
		easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}

// "Muestras" AJAX Call
function muestras_loader() {
  $('#panelMuestras').html('<img src="images/ajax-loader.gif" width="220" height="19" />');
  setTimeout('muestras_go()', 1500);
}
function muestras_go() {
  $('#panelMuestras').load("content.html #panelMuestras", function(){
$('#slideshowMuestras').cycle({
		fx:       'scrollLeft',
		easing:   'easeInBack',
		speed:    700,
		timeout:  2500,
		pause:	true,
		before: onBefore
    });
});
}

// callback fired when each slide transition begins
function onBefore(curr,next,opts) {
    var $slide = $(next);
    var w = $slide.outerWidth();
    var h = $slide.outerHeight();
    $slide.css({
        marginTop: 0,
        marginLeft: (398-w)
    });
}