

function previewOn (event) {
  // alert(hOffset);
   
   
   var description = $(this).next().html();
   
   //+this.rel+
   //altProperty = $(this).find("img").attr("alt");
   //$(this).find("img").attr("alt","");
   
   altProperty = $(" > img",this).attr("alt");
   $(" > img",this).attr("alt","");
   
   
   
   $("body").append("<p id='tooltip'><img src='"+this.rel+"'/><br/>"+ description +"</p>");
   //alert(this.rel);
   
   var cssStyles = {
   'background-color':'white',
   'border':'1px solid #b0b0b0',
   'display':'none',
   'font-size': '12px',
   'left': (event.pageX + hOffset),
   'top': (event.pageY - vOffset),
   'padding': '4px',
   'position': 'absolute', 
   'z-index': 10
   }
   
   $("#tooltip").css(cssStyles).fadeIn("slow");    
}

function previewOff (event) {
  $("#tooltip").remove();
  $(" > img",this).attr("alt",altProperty);
}



$(  function() {
   
   hOffset=20;
   vOffset=20;

  // $("div.galleryImgWrapper a").bind('mouseover',previewOn).bind('mouseout',previewOff);
   
   $("div.galleryImgWrapper a").hover(previewOn,previewOff);
   $("div.galleryImgWrapper a").mousemove( function(event) {  
       $("#tooltip").css({'top':(event.pageY - vOffset),'left':(event.pageX + hOffset)});   
      }  
	); 
  }


);


