/**
 *
 */
var submenu;

$(document).ready(function(){
	
	$('.main-menu > li').each(function(){
		var lilast = $(this).parent().find('li:last');
		submenu = $(this).find('.sub-menu');
		
		$('table.files').each(function(){
			$(this).find('tr:odd').addClass('odd');
			$(this).find('tr').each(function(){$(this).find('td:last').css('border-right','0px'); $(this).find('th:last').css('border-right','0px');});
		})
		
		$(this).hover(
			function(){
				if (!submenu.h)
				{
					submenu.h = submenu.height();
				}
				$(this).addClass("active");
				submenu.css('overflow','visible');
				submenu.slideDown(150);
			},
			function(){
				submenu.stop();
				submenu.height(submenu.h);
				$(this).removeClass("active");
				submenu.slideUp(0);
			})
		
		var submenu = $(this).find('.sub-menu');
		var pad_right = parseInt($(this).css('padding-right')); 
		if (submenu.width() < $(this).width())
		{
			submenu.width($(this).width()+pad_right - 1);
		}
	});
	
		$('.thickbox').fancybox({
			'zoomSpeedIn': 200,
			'zoomSpeedOut': 200,
			'frameWidth': 100,
			'frameHeight': 100,
			'overlayShow': true
		});	
	
	
	$(".header_animate").header_animate();
	
	 $('.section-caption').click(function()
	 {
		 $(this).parent().find('.text').toggle(200);
		 return false;
	 }); 
	 
	 $('.question-form .update_captcha').click(function(){
		
		$.get($(this).attr('href'), null, function (data, textStatus) 
		{
			$('.question-form .captcha').find('img').replaceWith(data);
		});
		return false;
	})
})

