	$(document).ready(function(){
		
		//Remove outline from links
		$("a").click(function(){
			$(this).blur();
		});


		$("#cssmenu li").click(function(){
		window.location=$(this).find("a:first",this).attr("href");
		});
		
		//When mouse rolls over
		$("li.dd_menu_lev2").mouseover(function(){
			$(this).stop().animate({marginTop: '5px', paddingTop: '13px'},{queue:false, duration:400, easing: 'easeOutBounce'});		
		});
	
		//When mouse is removed
		$("li.dd_menu_lev2").mouseout(function(){
			$(this).stop().animate({marginTop: '20px', paddingTop: '0px'},{queue:false, duration:400, easing: 'easeOutBounce'})
		});
	
		$("li.dd_menu_lev2, li.dd_menu_lev2act, li.dd_menu_lev3, li.dd_menu_lev3act, li.dd_menu_lev4, li.dd_menu_lev4act").mouseover(function(){ 
			$(this).css("display", "block");
			$("ul:first",this).css("display", "block");
		}).mouseout(function(){
			$("ul:first",this).css("display", "none");
		});



		$("div.brend").mouseover(function(){
			$(".img img",this).stop().animate({width: '124px', marginLeft: '-1px', marginTop: '0px'},400);
			$(this).css("border", "2px #548FD5 solid");	
			$(this).css("width", "128px");
			$(this).css("height", "158px");	
		});

		$("div.brend").mouseout(function(){
			$(".img img",this).stop().animate({width: '100px', marginLeft: '15px', marginTop: '0px'},{queue:false, duration:400, easing: 'easeOutBounce'})
			$(this).css("border", "1px #548FD5 solid");
			$(this).css("width", "130px");
			$(this).css("height", "160px");
		});



		$("div.tipeOb").mouseover(function(){	
			var buttons=$("h3:first",this).height();
			var text=$("div.tipeT:first",this).height();
			var mt=Math.ceil((70-buttons-text)/2);
			if (mt<-5) { mt=0; }	
			//$("#h3").html(buttons);
			//$("#te").html(text);
			//$("#mt").html(mt);


			$("div.tipeT:first",this).stop().animate({paddingTop: mt},{queue:false, duration:400, easing: 'easeOutBounce'});
			$("h3:first",this).stop().animate({marginTop: mt},{queue:false, duration:400, easing: 'easeOutBounce'})
			$("div.ico img:first", this).stop().animate({width: '0px', height: '0px', opacity: '0'},400);
		});

		$("div.tipeOb").mouseout(function(){
			$("div.tipeT:first",this).stop().animate({paddingTop: '120px'},{queue:false, duration:400, easing: 'easeOutBounce'});
			$("h3:first",this).stop().animate({marginTop: '30px'},{queue:false, duration:400, easing: 'easeOutBounce'})
			$("div.ico img:first", this).stop().animate({width: '135px', height: '76px', opacity: '1'},400);
		});




		$("div.brend").click(function(){
		window.location=$(this).closest("div.brend").find("div.text a:first",this).attr("href");
		});

		if ($('div.submenuOb2').length)
		{
			$('div.submenuOb1').css('display', 'none');
		}
		if ($('div.submenuOb3').length)
		{
			$('div.submenuOb2').css('display', 'none');
		}

	});
	
	$(function(){
        $('.dd_menu_lev2 ul, .dd_menu_lev2act ul,.dd_menu_lev3 ul, .dd_menu_lev3act ul, .dd_menu_lev4 ul, .dd_menu_lev4act ul, div.tipeOb, div.submenuOb1, div.submenuOb2, div.submenuOb3').each(function() {
            eval($(this).corner());
        });
    });
