
jQuery(function($){

	$('ul.faq-qa-set a.question').toggle(
		function()
		{
			var set = $(this).parent().parent();
			window.location.hash = '#'+set.attr('id').replace('_set', '');
			$(this).siblings().filter('ul.answer').css('display', 'block');
		},
		function()
		{
			window.location.hash = '';
			$(this).siblings().filter('ul.answer').css('display', 'none');
		}
	);

	if (window.location.hash && window.location.hash.indexOf('#faq_') === 0)
	{
		var hash = window.location.hash;
		window.location.hash = hash+'_position';
		window.location.hash = hash;
		$(window.location.hash+'_set').find('ul.answer').css('display', 'block');
	}

	$('.colorbox-popup').click(function(){
		var content = $(this).find('.colorbox-popup-hidden-content');
		$.colorbox({
			html:   content.html(),
			width:  content.width(),
			height: content.height()
		});
		return false;
	});
	
	try {
	if (typeof Empty.alert !== 'undefined')
		$.colorbox({
			html: Empty.alert,
			width: '500px'
		}); } catch(err){}
});

