// ==UserScript==
// @name			yandexru
// @description		Дополнительная информация по выдаче Яндекса
// @namespace		veg
// @include			http://*yandex.ru/yandsearch?*
// @require 		http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
// ==/UserScript==
$(document).ready(function() 
{
	// Добавляем галочку «Без исключения»
	$("#precise").append('<label for="rd0"><input id="rd0" name="rd" type="checkbox" value="0">без исключения</label>');
	if(document.location.href.match(/&rd=0/i))
	{
		$("#rd0").attr('checked', 'checked');
	}
	
	// Заменяем галочку «на сайте» полем для ввода
	var surl = $("#site, #surl, #serverurl").val();
	if(!surl) surl = "";
	var suid = document.location.href.match(/&(site|surl|serverurl)=/i);
	suid = (suid) ? suid[1] : "surl";

	$("#site, #surl, #serverurl").parent().html("");
	$("#precise").prepend('<label for="search_on">на сайте: <input id="search_on" name="'+suid+'" type="text" value="'+surl+'"></label>');

	// Геозависимый поиск?
	$(".b-head-logo .text").html($(".b-head-logo .text").html().replace("<br>", " "));
	var geodep = $(".b-summary").html().indexOf("Поискать без учета региона.") != -1;
	if(geodep)
	{
		$(".b-head-logo .text").append("<br>Геозависимый поиск");
	}
	else
	{
		$(".b-head-logo .text").append("<br>Геонезависимый поиск");
	}
	
});
