//general site js

$$(".thumb-image").each(function(t) {
  Event.observe(t, "mouseenter", show_big_thumb.bind(t));  
//  Event.observe(t, "mouseleave", hide_big_thumb.bind(t));  
});

$$(".thumb").each(function(t) {
//  Event.observe(t, "mouseenter", show_big_thumb.bind(t));  
  Event.observe(t, "mouseleave", hide_big_thumb.bind(t));  
});


function hide_big_thumb() {
  this.select(".th-zoom")[0].hide();
}

var images = new Array();

function show_big_thumb() {
  $$(".th-zoom").invoke("hide");
  var node  =  this.up().select(".th-zoom")[0];
  var img = this.up().select(".th-zoom img")[0];
  var i = images.length;
  images[i] = new Image();
  images[i].onload = showThumb.bind(img);
  images[i].src = img.getAttribute("src_pre");
  new Effect.Appear(node, {duration:.2});
}

function showThumb() {
  this.src = this.getAttribute("src_pre");
}
