
	var resizator=0;
	function Expand(){
		$('.n').show();
		$('.non').show();
		$('.t1').show();
		$('.t2').hide();
	}

	function resize4search(){
		for(i=1;i<document.images.length;i++){
			if(typeof(document.images[i].name)!="undefined")if((""+document.images[i].name).indexOf("mynameis")>=0){
				document.images[i].style.display='block';
				if((""+document.images[i].name).indexOf("нтерьер")>=0){
				}else{
					document.images[i].width="100";document.images[i].height="100";
				}
			}
		}
		if(resizator){
			resizator=0;
		}else{
			resizator++;
			setTimeout("resize4search()",1000);
		}
	}

	function Reload(){
		var S = "&"+$('#filterform').serialize();
		S = S.replace(/&p=/g, '+');
		S = '/cms/view.php?load=look&tpltovars=tovars4search&tplnews=news4search&tpl=mainzero&q='+S;
//		alert(S);
		setTimeout("resize4search()",1000);
		newContent(S,'filterres','')
/*		$.post(''+S, '', function(D){
			$('#filterres').html(D);
		}); */
	}
	
	$(document).ready(function(){
		$(".h").click(
			function(){
				$(this).next().toggle();
				$(this).children('img').toggle();
			}
		);
		$("input.p").click(
			function(){
				if($(this).parent().children("input:checked").length > 0){
					$(this).parent().prev().children(".x").show();
				}else{
					$(this).parent().prev().children(".x").hide();
				};
				Reload();
			}
		);
		$("mybutt1").click(
			function(){
				if($(this).parent().children("input:checked").length > 0){
					$(this).parent().prev().children(".x").show();
				}else{
					$(this).parent().prev().children(".x").hide();
				};
				Reload();
			}
		);
		$(".help").click(
			function(){
				$(".helptext").hide();
				$(this).next().css('left', $(this).offset().left + 17);
				$(this).next().css('top', $(this).offset().top - 38);
				$(this).next().show();
			}
		);
		$(".helptext").click(
			function(){
				$(this).hide();
			}
		);
	  
		$(".lightbox").lightbox({
		  fitToScreen: true,
		  imageClickClose: false,
		  navBarSlideSpeed: 200,
		  resizeSpeed: 200,
		  fileLoadingImage: '/lightbox/images/loading.gif',
		  fileBottomNavCloseImage: '/lightbox/images/closelabel.gif',
		  strings:{
			prevLinkTitle: 'Предыдущий рисунок',
			nextLinkTitle: 'Следующий рисунок',
			prevLinkText: '&laquo; Назад',
			nextLinkText: 'Вперед &raquo;',
			closeTitle: 'Закрыть галерею',
			image: 'Рисунок ',
			of: ' из '
		  }
		});
});
 
