jQuery().ready(function(){	
	if(document.getElementById('theMenu')){
		jQuery('#theMenu').Accordion({active: 'h3.selected', header: 'h3', alwaysOpen: false, animated: true, showSpeed: 400, hideSpeed: 800});
	}
	
	
});



$(window).load(function(){ 
	if(document.getElementById('img-slide'))
		$('#img-slide').easySlider({
			auto: true, 
			continuous: true,
			numeric: true,
			controlsShow:true,
			nextId: 'sliderNext',
			prevId: 'sliderPrev',
			speed: 2000
		});
		
	if(document.getElementById('slide-nosotros'))
		$('#slide-nosotros').easySlider({
			auto: true, 
			continuous: true,
			numeric: true,
			controlsShow:true,
			nextId: 'sliderNext',
			prevId: 'sliderPrev',
			speed: 2000
		});
	
	
});


$(document).ready(function() {
	$(".item-especial1").easySlider({
			auto: true,
			controlsShow: false,
			continuous: true,
			pause: 6000
	});
	$(".item-especial2").easySlider({
			auto: true,
			controlsShow: false,
			continuous: true,
			pause: 6000
	});
	$(".item-especial3").easySlider({
			auto: true,
			controlsShow: false,
			continuous: true,
			pause: 6000
	});
	$("#imgs-sidebar").easySlider({
			auto: true,
			controlsShow: false,
			continuous: true,
			pause: 6000
	});
});




/*$(function() {
    $(".anyClass").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		visible: 5
    });
});*/

function CargarInfo(xproducto_id, xdetalle_producto_id, xcant){
	jQuery.get('ev-includes/process/ajax-cargarfoto.php', {producto_id: xproducto_id, detalle_producto_id:xdetalle_producto_id, cant:xcant, pag:'varias_fotos' }, function(data) {
		  jQuery('#fotos-ajax').html(data);
	});
	MostrarFoto(xproducto_id, xdetalle_producto_id, 1);
	return false;
}

function MostrarFoto(xproducto_id, xdetalle_producto_id, xp){
	with(document){
		
		jQuery.get('ev-includes/process/ajax-cargarfoto.php', {producto_id: xproducto_id, detalle_producto_id:xdetalle_producto_id, p:xp, pag:'una_foto' }, function(data) {
			  jQuery('#foto-principal').html(data);
			  var zoom = getElementById('zoom');
			  zoom.href = 'productos/'+xproducto_id+'_'+xdetalle_producto_id+'_'+xp+'_iLarge.jpg';
			  zoom.rel = 'zoom-position: custom; zoom-width: 694px; zoom-height:420px; zoom-fade:true;fps:999;';
			  zoom.firstChild.src = 'productos/'+xproducto_id+'_'+xdetalle_producto_id+'_'+xp+'_iMedio.jpg';
			  MagicZoom.refresh();
			  /*if(getElementById('fotos-ajax')){
				  jQuery('#zoom').hover(function(){
						getElementById('fotos-ajax').style.zIndex=-1;
				  },
				  function(){
						getElementById('fotos-ajax').style.zIndex=2; 
				  }
				  );
			  }*/
		});
	}
	return false;
}
