$(document).ready(function() {

	$("img.katobtn").css({opacity:0,visibility:"visible"}).mouseover(function(){
		$(this).stop();
		//$(".katobtn").css({opacity:0});
		$(this).css({opacity:1,backgroundColor:'#fff'})
	}).mouseout(function(event){
		//$(this).stop();
		if ($(event.relatedTarget).is(".katowrk")) $(this).css({opacity:0});
		else $(this).animate({opacity:0});
	}).click(function() {
	$(this).stop().css({opacity:1,backgroundColor:'#999'});
		top.location.href='/gallery/?thumbs=cats&categ='+this.id.substring(2);
	});

	$("img.katowrk").mouseover(function(event){
		//$(".katobtn").css({opacity:0});
		if ($(event.relatedTarget).is(".katobtn")) $(this).next(".katobtn").stop().css({opacity:1,backgroundColor:'#ccc'});
		else $(this).next(".katobtn").stop().css({backgroundColor:'#ccc'}).animate({opacity:1});
	}).mouseout(function(){$(this).next(".katobtn").stop().animate({opacity:0})}).click(function() {
	$(this).next(".katobtn").stop().css({opacity:1,backgroundColor:'#999'});
		top.location.href='/gallery/?thumbs=cats&categ='+this.id.substring(2);
	});
	
 });
