window.addEvent('domready', function() {  
  
  var myMenu = new MenuMatic({
    matchWidthMode: 1,
    duration: 1200,
    /*hideDelay: 0*/
    /*duration: 0*/
    fixHasLayoutBug: false
  });
  
  /*
  if ($('slideshow')) {
	var gallery = new slideGallery($("slideshow"), {
	  holder: ".mask",
	  elementsParent: "#box",
	  elements: "img",
	  steps: 1,
	  mode: "circle",
	  autoplay: true,
	  duration: 6000,
	  speed: 3000,
	  direction: "horizontal"
	});
  }
  */
  
  // Zoom images
  var products = $$('.products');
  products.each(function(product,pindex) {
	var thumbs = product.getElements('.image .thumbs');
	var bigs = product.getElements('.image .big');
	thumbs.each(function(thumb,tindex) {
	  var big = bigs[tindex];
	  if(big != null) {
		var pos = thumb.getPosition(product);
		big.setStyle('left',pos.x);
		big.setStyle('top',pos.y);
		big.setStyle('display','block');
		var prodFx = new Fx.Morph(big).set('.prodImgOut');
		thumb.addEvent('mouseenter', function(e) {
		  prodFx.cancel();
		  prodFx.start('.prodImgIn');
		});
		big.addEvent('mouseleave', function(e) {
		  prodFx.cancel();
		  prodFx.start('.prodImgOut');
		});
	  }
	});
  });
  
}); 
