function SearchFocus()
{
if (document.getElementById('search_text').value == 'поиск по сайту'){document.getElementById('search_text').value=''}
}

function SearchBlur()
{
if (document.getElementById('search_text').value == ''){document.getElementById('search_text').value='поиск по сайту'}
}

$(document).ready(function(){

/*
$("a[href$=jpg]").live('click',function(){return hs.expand(this);});
$("a[href$=gif]").live('click',function(){return hs.expand(this);});
$("a[href$=png]").live('click',function(){return hs.expand(this);});
$("a[href$=jpeg]").live('click',function(){return hs.expand(this);});
*/
LinksAll = document.getElementsByTagName('a');
for (var i=0; LinkOne = LinksAll[i]; i++)
{
	if ((LinkOne.href.indexOf('.jpg') != -1) || (LinkOne.href.indexOf('.gif') != -1) || (LinkOne.href.indexOf('.png') != -1) || (LinkOne.href.indexOf('.jpeg') != -1))
		LinkOne.onclick = function(){return hs.expand(this)};
	if ((LinkOne.href.indexOf('.JPG') != -1) || (LinkOne.href.indexOf('.GIF') != -1) || (LinkOne.href.indexOf('.PNG') != -1) || (LinkOne.href.indexOf('.JPEG') != -1))
		LinkOne.onclick = function(){return hs.expand(this)};
}

$('.decore tr').find('td:first').addClass('first');
$('.decore').find('tr:first').addClass('first');

$('.with_popup > div > span').mouseenter(function(){
	$(this).find('.sub_menu').slideDown('fast');
}).mouseleave(function(){
	$(this).find('.sub_menu').slideUp('fast');
});

if ($.browser.msie) $('h1.main_center_h1').textShadow('1px 1px 2px #000');


});

function AjaxPage(url,idh){
$('#'+idh).html('<'+'img src="/design/images/loading.gif" width="16" height="16" alt="" /> Загрузка...');
$.get(url,function(data){
$('#'+idh).html(data);
});
}

$.fn.textShadow = function(o){
	if (!o) return; // если нет параметра - выходим
	var str = o.split(' '), // делим введенную строку
	x = parseInt(str[0]), // получаем отступ сверху
	y = parseInt(str[1]), // и снизу
	blur = 0, // значения по умолчанию
	color = '';
	if (str.length == 3) { // если было передано 3 параметра
		color = str[2]; // третьим параметром будет цвет
	} else { // иначе
		blur = parseInt(str[2]); // третьим параметром будет размытие 
		color = str[3]; // а четвёртым цвет
	}
	return $(this).each(function(){ // для каждого элемента
	    	var text = $(this); 
	    	text.css({
			position:'relative', // устанавливаем относительное позиционирование
			'z-index':0, // определяем позицию на случай использования фона
			zoom:1 // хак для IE 6
		}).append('<span></span>') // добавляем к элементу тег span 
		.find('span').html(text.html()) // находим его и вставляем в него содержимое элемента
	    	.css({width:text.width(), // ширина тени равна ширине элемента
		    position:'absolute', // устанавливаем абсолютное позиционирование
		    'z-index':-1, // прячем тень за основной элемент
		    color:color, // устанавливаем основной цвет
		    left:x - blur + 'px', // отступ от элемента сверху 
		    top:y - blur + 'px', // и снизу
		    'padding-left':text.css('padding-left'), // отступы тени равны отступам элемента
        'padding-top':text.css('padding-top')}); 
    if (blur) text.find('span') // если нужно размыть тень, находим её
      .css('filter','progid:DXImageTransform.Microsoft.Blur(pixelradius=' + blur + ', enabled="true")'); // и размываем с помощью фильтра blur
        });
};

