(function ($) {
	$(document).ready(function() {
		$(".image_small a.colorbox").click(function(){
			//alert($(this).attr('title'));
			var reg=/([^/]+)$/;
			var path_small=$(this).children("img").attr('src');
			var file_small=reg.exec(path_small);
			var path_big=$(".big_image img").attr('src').replace(reg, file_small[0]);
			var linc_path=$(".big_image a").attr('href').replace(reg, file_small[0]);
			$(".big_image a").attr('href',linc_path);
			$(".big_image a").attr('title',$(this).children("img").attr('title'));
			$(".big_image img").attr('src',path_big);
			$(".big_image img").attr('title',$(this).children("img").attr('title'));
			$(".big_image img").attr('alt',$(this).children("img").attr('alt'));
			//$(this).attr('rel');
			$("div.image_small.active a").attr('rel',$(this).attr('rel'));
			$(this).attr('rel','');
			$("div.image_small.active").removeClass('active');
			$(this).parent().addClass('active');
			//alert();
			$("#big_img_text").text($(this).children("img").attr('title'));
			return false;
		});
		$('a.table_switch').click(function(){
			var table=$(this).attr('rel');
			$('.show').removeClass('show');
			//alert(table);
			$('#'+table).addClass('show');
			return false;
		});
		var left=$('.region-sidebar-second').height();
		$('#content .section').css('min-height',left);
		$("div.image_small.active a").attr('rel','');
	 	}
)}(jQuery));



