done = _uButton('', 'b', {
	style: 3,
	text: '<b>Поиск</b>',
	id: 'bSearch'
}); // кнопка Поиск
nextpage = _uButton('', 'b', {
	style: 3,
	text: '<b>Подгрузить</b> ещё',
	id: 'resulpage'
}); // кнопка Поиск
$('#typeSearch').click(function () {
	new _uWnd('crazySearch', 'Быстрый поиск', 400, 100, {
		align: 0,
		shadow: 0,
		close: 1,
		autosize: 1,
		maxh: 500,
		minh: 100,
		resize: 1,
		oncontent: function () {
			$('#bSearch').click(function () {
				$('#npage').hide();
				$('.resul').html('<div align="center">Пожалуйста, подождите...</div>');

				if ($('#tSearch').val().length >= 3) {

					$.get('/search/?q=' + $('#tSearch').val() + ';t=0;p=1;md=', function (data) {
						$('.resulPageq').html($('#qq', data).find('.pagesBlockuz1,data').html())
						$('#npage').click(function () {
							$.get('/search/?q=' + $('#tSearch').val() + ';t=0;p=' + $('.resulPageq').find('.swchItem:last').attr('href').split('/')[4].split(';')[2].substr(2) + ';md=', function (data) {
								if ($('#qq', data).find('.pagesBlockuz1,data').text().indexOf('»') != -1) {
									$('#npage').show()
								}
								else {
									$('#npage').hide()
								}
								$('.resulPageq').html($('.pagesBlockuz1', data).html())
								$('#qq', data).find('.searchtitle,data').each(function () {
									$('.resul').append($(this).html());
								});
							});

						});
						$('.resul').prepend().html('');
						if ($('.swchItem').size() == '0') {
							$('#npage').hide()
						}
						else {
							$('#npage').show()
						}
						if ($('#qr', data).text().indexOf('0-0') != -1) {
							$('.resul').html('<div align="center">Результатов по запросу <b>' + $('#tSearch').val() + '</b> не найдено</div>');
						}
						else {
							$('#qq', data).find('.searchtitle,data').each(function () {
								$('.resul').append($(this).html());
							});

						}
						_uWnd.alert('<center>' + $('#qr', data).html() + '</center>', 'Результат', {
							w: 300,
							h: 70,
							tm: 8000
						});

						_uWnd.getbyname('crazySearch').checksize();
					});
				} else {
					$('.resul').html('<div align="center">Слишком короткий запрос</div>');
					_uWnd.getbyname('crazySearch').checksize();
				}
			});
		}
	},
	'<div style="display:none" class="resulPageq"></div><div style="margin:8px;"><div style="overflow:hidden;"><div style="float:left;"><center><input type="text" id="tSearch" style="width:300px;"></center></div><div style="float:left;margin-left:5px;">' + done + '</div></div><hr>Что ищем?<hr><div class="resul" style="margin-top:6px;"></div><div align="center" style="display:none;" id="npage">' + nextpage + '</div></center></div>')
});
