$(document).ready(function()
{
	initNavigation();
	initOpenClose();
});
function initOpenClose(){
	$('div.faq-block').find('div.info-section').each(function(){
		var hold = $(this);
		var link = hold.find('a.btn-open-close');
		var box = hold.find('div.content-info');
		var h = box.height();
		box.height(0).hide();
		link.click(function(){
			if(link.data('opened')){
				link.data('opened', false);
				box.animate({height:0+'px'},{duration:300, complete:function(){
					box.hide();
				}});
				hold.removeClass('active');
			}
			else{
				link.data('opened', true);
				box.animate({height:h+'px'},300);
				hold.addClass('active');
			}
			return false;
		});
	});
	$('div.double-info-section > .info-section').find('> div.info-section').each(function(){
		var hold = $(this);
		var link = hold.find('a.btn-open-close');
		var box = hold.find('div.content-info');
		var h = box.height();
		box.height(0);
		link.click(function(){
			if(link.data('opened')){
				link.data('opened', false);
				box.animate({height:0+'px'},300);
				hold.removeClass('active');
			}
			else{
				link.data('opened', true);
				box.animate({height:h+'px'},300);
				hold.addClass('active');
			}
			return false;
		});
	});
}
function initNavigation()
{
	$('#nav li').hover(function()
	{
		$(this).addClass('hover');
	},
	function()
	{
		$(this).removeClass('hover');
		setTimeout(function(){Cufon.refresh('#nav > li > a')}, 10);
	});
}
