// JavaScript Document
$(window).load(function() {
/*	$('#slideshow').after('<div id="ft-buttons-gallery" class="nav">').cycle({
        fx:     'fade',
        speed:  1000,
        pager:  '#ft-buttons-gallery'
    });*/
});

$(document).ready(function(){

		
SexyLightbox.initialize({
    find          : 'sexylightbox', // rel="sexylightbox"
    color         : 'white',
    dir           : 'aplication/webroot/imgs/sexyimages',
    emergefrom    : 'bottom',
    OverlayStyles : {
      'background-color': '#000',
     'opacity' : 0.6
    }
  });
 /* menu lavalam
$("#3").lavaLamp();*/
/*$("#galeria_image a").click(function(){
		$("#image_grande img").hide();
		$("#image_grande img").attr("src","aplication/webroot/imgs/catalogo/"+$(this).attr("rel")).fadeIn("slow");
		$(".highslide").attr("href","aplication/webroot/imgs/catalogo/"+$(this).attr("rel"));
		
		 agregado
		$("#galeria_image img").removeClass("active_imagenes");
		$(this).addClass("active_imagenes")
	});
	
	 */
	
	$(".repeat_nostros").css("display","none")
	$(".repeat_nostros").eq(0).css("display","block")
	
	$(".menu_nosotros a:eq(0)").addClass("active_nostros");
	$(".menu_nosotros a").click(function(){
		$(".repeat_nostros").hide();
		$(".repeat_nostros").eq($(this).index()).slideDown(400);	
		$(".menu_nosotros a").removeClass("active_nosot");
		$(this).addClass("active_nosot")
		
		
	});
	

/*ajax*/

$(".menu_detalle a").click(function(){
	$(".parrafo_variedad").show();
	$(".loading3").show();
	$(".organico").hide();
	$(".loading3").hide();
	$(".menu_detalle a").removeClass("activando");
	$(this).addClass("activando");
									 
	$.get("productos_ajax.php",{page:$(this).attr("name").split("-")[1]},function(data){ 
		$(".loading3").fadeOut("slow", function(){
			$(".organico").show();	
			$(".organico").html(data).fadeIn("slow");	
								   
		});			       																		  
	}); 
});	


});

var scrolling = null;
function scroll_up() {
	var d = document.getElementById('scroller');
	d.scrollTop = d.scrollTop - 5;
	scrolling = window.setTimeout(function() {
		scroll_up();
	}, 50);
}
function scroll_down() {
	var d = document.getElementById('scroller');
	d.scrollTop = d.scrollTop + 5;
	scrolling = window.setTimeout(function() {
		scroll_down();
	}, 50);
}
function stop_scroll() {
	window.clearTimeout(scrolling);
}

function mensaje() {
	alert("Este Producto no tiene Ficha Técnica");
}


if(document.location.pathname=="/quienes_somos.php"){
	
	
	var scroller  = null;
	var scrollbar = null;
	window.onload = function () {
    scroller  = new jsScroller(document.getElementById("Scroller-1"), 680, 306);
    scrollbar = new jsScrollbar(document.getElementById("Scrollbar-Container"), scroller, false);
	}
	
}else{
	
	var scroller  = null;
	var scrollbar = null;
	window.onload = function () {
    scroller  = new jsScroller(document.getElementById("Scroller-2"), 738, 310);
    scrollbar = new jsScrollbar(document.getElementById("Scrollbar-Container"), scroller, false);
	}
}
	
	
