function init_search_form() {
	$(document).ready(function() {
		$("#error-404-search-show-link").click(function() {
			$("#error-404-search-form").toggle();
			return false;
		});
		$("#error-404-search-form-link").click(function() {
			$("#error-404-search-form").toggle();
			return false;
		});
		var coord, xpos, ypos;
		coord = $("#error-404-search-show-link").offset();
		ypos = coord.top;
		xpos = coord.left;
		coord = $("#error-404-search-form-link").offset();
		ypos -= coord.top;
		xpos -= coord.left;
		coord = $("#error-404-search-form").offset();
		ypos += coord.top;
		xpos += coord.left;
		$("#error-404-search-form").toggle();
		$("#error-404-search-form").css({top: ypos + "px", left: xpos + "px"});
	});
}
$(document).ready(function() {
	// png fix
	if (navigator.userAgent.indexOf("MSIE 6") != -1) {
		DD_belatedPNG.fix(".png");
	}
	// search feature
	$("#head-search .text").focus(function() {
		var $_this = $(this);
		if ($_this.val() == $_this.attr("title")) {
			$_this.attr("value", "");
		}
	});
	$("#head-search .text").blur(function() {
		var $_this = $(this);
		if ($_this.val() == "") {
			$_this.attr("value", $_this.attr("title"));
		}
	});
	$("#head-search .submit").click(function() {
		$_this = $("#head-search .text");
		if ($_this.val() == $_this.attr("title")) {
			return false;
		}
	});
});


$(document).ready(function(){
	$("#consult-form input").focus(function(){
		if (($(this).attr("value") == 'Имя')||($(this).attr("title") == 'Телефон'))
			$(this).attr("value", "");
	})
	
	$("#consult-form input").blur(function(){
		var title = $(this).attr("title");
		if ($(this).attr("value") == "") {$(this).attr("value", title);};
	})
	
	$("#consult-form textarea").focus(function(){
		if ($(this).attr("value") == "Комментарий")
			$(this).attr("value", "");
	})
	
	$("#consult-form textarea").blur(function(){
		var title = $(this).attr("title");
		if ($(this).attr("value") == "") {$(this).attr("value", title);};
	})
	
	$("#consult-form input[type=image]").click(function(){
		$("#consult-form input[type=text]").each(function() {
			if (($(this).attr("value") == 'Имя')||($(this).attr("title") == 'Телефон'))
				$(this).attr("value"," ");
		});
		$("#consult-form textarea").each(function() {
			if ($(this).attr("value") == "Комментарий")
				$(this).attr("value"," ");
		});
	});
});
