$(document).load(function(){});
$(document).ready(function(){
$("#lav").lavaLamp({
            //fx: "bounceout",
			//speed: 800, 
			//fx: "backout", 
            //speed: 150,
         });
var h=0;
$('.menu ul li').hover(
		function() {
			$(this).addClass("hov").siblings("li#act").addClass("nonact");
			h=$(this).height();
			if($.browser.msie)
			{
				$(this).height($("ul", this).height()+50);
			}
			else{
				$(this).height($("ul", this).height()+30);
			}
			//$("ul", this).show();
		},
        function() {
			$(this).removeClass("hov").siblings('li#act').removeClass('nonact');
			$(this).height(h);
			//$("ul", this).hide();
			}
    );
$('.menu ul li ul').hover(
		function(){
			$(this).parents("li").addClass("hov").siblings("li#act").addClass("nonact");
		},
		function() {
			$(this).parents("li").removeClass("hov").siblings('li#act').removeClass('nonact');
			}
		);
$('.menu ul li ul li').hover(function(){
			$(this).height(30);
			//if($.browser.msie) {$('li.last:last').height(40);}
});

		//if($.browser.msie) {$('li.last:last').height(50);}
  /*
	$('.menu ul li').click(
        function() {
      $(this).addClass("act").siblings('li#act').addClass('noact');
	  $(this).addClass("act").siblings('li').removeClass('act');
        }
    );
	*/

//	if ($(document).hasClass(".conteiner"))
//	{
		$(".toggle").click(function() {
			if(!$(this).hasClass("bigToggle")) 
			{
				$(this).parent(".conteiner").height($(this).height());
				$(this).parent(".conteiner").width($(this).width());
			}
			$(this).toggleClass('bigToggle', 1000);
			return false;
		});
		//$(".conteiner").each(function(){$(this).height($(this).height());});
//	}
/*
	if ($.browser.msie)
	{
		$(".forumEnter input").each(function(){$(this).css({'height': '14px', 'margin': '0px 0px 0px 1px', 'width':'90px'})});
		$(".forumEnter input[type='submit']").css({'height': '24px', 'margin': '0px -5px 0px 2px', 'width':'95px'});
		if ($.browser.version=="7.0")
		{
			
		}
		if ($.browser.version=="8.0")
		{
			
		}
	}
*/
	$("li.lv1-li>ul>li").hover(function(){
		$("li.lv1-li>ul>li").each(function(){if($(this).hasClass("current")) $(this).removeClass("current");});
		$(this).addClass("current");
	});
	$(".topmenu ul li a").each(function(i){
	var obj = $(this);
	var width = 0;
	var pr = 0;
		if($(obj).next("ul").html()!=null)
		{
			$(obj).parent().parent("ul").find(">li").each(function(index){
				if (pr==0&&$(obj).parent().find("a").text()!=$(this).find("a").text()) width = width + $(this).width()+parseInt($(this).css("padding-left"))+parseInt($(this).css("padding-right"));
				else if(pr==0) pr = index;
			});
			$(obj).next("ul").each(function(ii){
				if(i==2) $(this).css({"left":width+"px","position":"absolute","left":"270px","width":"240px"});
				if(i==7) $(this).css({"left":width+"px","position":"absolute","left":"420px","width":"240px", "height": "210px"});
			});
		}
	});
	// ���� ���� ����� �������
	if ($("form[name='reviewsForm']").size()>0)
	{
		var iInd = $("select[name='form_dropdown_orgFis']").val();
		var table = $("form[name='reviewsForm'] table");
		if (iInd == 1)
		{
			$("tr:eq(1)", table).hide();
			$("tr:eq(1) input", table).val("empty");
			$("tr:eq(2)", table).show();
			$("tr:eq(4)", table).show();
		}
		else
		{
			$("tr:eq(1)", table).show();
			$("tr:eq(2)", table).hide();
			$("tr:eq(4)", table).hide();
			$("tr:eq(2) input", table).val("empty");
			$("tr:eq(4) input", table).val("empty");
		}
	}
	$("#menuOuter li").mouseover(function(){$("#anim").hide();});
	$("#menuOuter li").mouseout(function(){$("#anim").show();$("#menuOuter li").find(".current").removeClass("current");});
});

function selChange(){
	var iInd = $("select[name='form_dropdown_orgFis']").val();
	var table = $("form[name='reviewsForm'] table");
	if (iInd == 1)
	{
		$("tr:eq(1)", table).hide();
		$("tr:eq(1) input", table).val("empty");
		$("tr:eq(2) input", table).val("");
		$("tr:eq(4) input", table).val("");
		$("tr:eq(2)", table).show();
		$("tr:eq(4)", table).show();
	}
	else
	{
		$("tr:eq(1) input", table).val("");
		$("tr:eq(1)", table).show();
		$("tr:eq(2)", table).hide();
		$("tr:eq(4)", table).hide();
		$("tr:eq(2) input", table).val("empty");
		$("tr:eq(4) input", table).val("empty");
	}
}
