$(document).ready (function () {
	$("#lTopMenuIn UL:first LI:last").css ("background", "none");
	
	// top menu
	var topActive = $('#lTopMenuIn A.head.hit');
	$('#lTopMenuIn A.head').parent ().hover (
		function () {
			topActive.removeClass ('hit');
			$(this).find ("A.head").addClass ("hit");
		},
		function () {
			topActive.addClass ('hit');
			$(this).find ("A.head").removeClass ("hit");
		}
	);

	// thumbs popup resize
    thumb		= null;
	
	$('.thumb IMG').hover (
		function () {
			$(this).parent ().css ("position", "relative");
			
			thumb		= $(this).clone ();
			position	= $(this).position ();
			
			if ($(this).parent ().parent ().hasClass ("mainPr")) {
				thumb.css ("border", "2px solid #ddca3d");
			}
			
			if ($(this).attr("thumb")) {
				rep = $(this).attr("thumb").split (":");
				
				thumb.attr (
					"src",
					thumb.attr ("src").replace ("/" + rep[0] + "/", "/" + rep[1] + "/")
				).css ("background", "#ffffff");
				
				// console.log (thumb.attr ("src"));
			}
			
			//
			// console.log (thumb.attr ("src").replace ("application/_cache/catpro_thumbs/1", "application/_cache/catpro_thumbs/" + $(this).attr("thumb")));
			//
			
			thumb.css ({
				"width"		: $(this).width () + 10,
				"height"	: $(this).height () + 10,
				"position"	: "absolute",
				"top"		: -5 + position.top,
				"left"		: -5 + position.left
			});
			
			$(this).parent ().append (thumb);
			
			thumb.unbind ("hover").hover (
				function () {},
				function () {
					$(this).unbind ("hover").remove ();
				}
			);
		},
		function () {}
	);
});
