$(document).ready(function() {
	// инициализируем меню
	$(".main_menu .podm p").each(function(){
		$(this).parent().css('width',$(this).parent().width());
		$(this).height(15);
		$(this).width($(this).parent().width());
		$(this).parent().css("display","none")
		$(this).find('a').css("float","left")
	})
   $(".main_menu td").hover(function(){
				$(this).find("a").addClass("hover");
				$(this).find(".podm").css("display","block")
			},
			function(){
				$(this).find(".podm").css("display","none");
				$(this).find("a").removeClass("hover");
		})
	
	// запускаем карусель, и устанавливаем слайдшоу к нему
	$('#mycarousel').jcarousel({ scroll: 2 });
	$("#mycarousel a").colorbox({slideshow:true, height:"75%"});
	
	// строка поиска
	$("#header .search input[type=text]").map(function(key, el){
		$(el).attr("rel", el.value);
		$(el).bind("focus", function(){
			if(this.value == $(this).attr("rel")){
				this.value="";
			}
		});
		$(el).bind("blur", function(){
			if(this.value == ""){
				this.value = $(this).attr("rel");
			}
		})
		$(el).parent().bind("submit", function(){
			var elText;
			elText = $("input[type=text]");
			if((elText.get(0).value == "") || (elText.get(0).value == elText.attr("rel"))){
				return false;
			}
		})
	})
});



