$(document).ready(function()
{
	$('body').addClass('javascript-enabled');

	$('a.pop-up').click(function()
	{
		window.open($(this).attr('href'));
		return false;
	});

	// Tabs
	$('#nav').tabs({fxFade: true, fxAutoHeight: true});
	$('#omraden-tab-content').tabs({fxFade: true, fxAutoHeight: false});
	$('#article-news-section').tabs(1, {fxFade: true, fxAutoHeight: true});
	$('#reviews').tabs({fxFade: true, fxAutoHeight: true});

	// Survey Form
	fixSurveyForm();
});

function fixSurveyForm()
{
	// Remove submit button (not needed)
	$('#search-survey input[@type="submit"]').remove();

	// Add onclick to radio-buttons
	$('#search-survey input[@type="radio"]').click(function()
	{
		var answers_id = $(this).val();

		// Remove old form
		$('#search-survey form').slideUp("slow", function()
		{
			// Get new form
			$.get('search-survey.php?answers_id=' +answers_id, function(data)
			{
				// Insert new form
				$('#search-survey').html(data);

				// Show new form
				$('#search-survey form').hide().slideDown("slow");

				// Do it again on new form
				fixSurveyForm();
			});
		});
	});
}
