$(document).ready(function()
{
	// Toevoegen aan favorieten (IE & Firefox)
	$('#add_to_favorites').click(function()
	{
		if(document.all)
		{
			if(window.external != undefined && window.external != null)
			{
				window.external.AddFavorite(location.href, document.title);
			}
			else
			{
				alert('Uw browser ondersteunt deze functie niet. Probeer de website a.u.b. handmatig toe te voegen.');
			}
		}
		else if(window.sidebar)
		{
			window.sidebar.addPanel(document.title, location.href, "");
		}
		else
		{
			alert('Uw browser ondersteunt deze functie niet. Probeer de website a.u.b. handmatig toe te voegen.');
		}
		return false;
	});

	// Een klik op 'Controleer spelling' afvangen, en toevoegen aan statistieken
	$('#mce_0_spellchecker_action').live('click', function()
	{
		$.ajax(
		{
			type: "POST",
			url: "http://www.hallofryslan.nl/misc/dictionary/spellcheckerAddStat.php",
			data: "value=add",
			success: function(msg)
			{
			}
		});
	});


	/*
	// Woordenboek open of dicht schuiven
	$('#dictionary_activate').click(function()
	{
		$('#translation_container').slideUp('fast');
		$('#wordbox_container').slideUp('fast');
		$('#dictionary_input_text').val('');
		$('#spelling_div').slideUp('fast');
		
		if( $('#dictionary_activate').attr('src') == '/themes/hallofryslan.nl/styles/images/menu_dictionary_button.jpg' )
		{
			$('#dictionary_activate').attr('src', '/themes/hallofryslan.nl/styles/images/menu_dictionary_button_close.jpg');
			$('#dictionary_div').slideDown();
		}
		else
		{
			$('#dictionary_activate').attr('src', '/themes/hallofryslan.nl/styles/images/menu_dictionary_button.jpg');
			$('#dictionary_div').slideUp();
		}
	});


	// Spellingscontrole open of dicht schuiven
	$('#spelling_activate').click(function()
	{
		$('#dictionary_div').slideUp('fast');
		$('#wordbox_container').slideUp('fast');
		$('#translation_container').slideUp('fast');
		$('#dictionary_activate').attr('src', '/themes/hallofryslan.nl/styles/images/menu_dictionary_button.jpg');
		
		$('#spelling_div').slideToggle();
	});
	*/


	$('#wurdboek_title').click(function()
	{
		$("#wurdboek_title").animate(
		{
			backgroundColor: '#C2DFEF'
		}, 500);
		
		$("#spelling_title").animate(
		{
			backgroundColor: '#FFFFFF'
		}, 500, function()
		{
			//$("#wurdboek_title").css('color', '#FFFFFF');
			//$("#spelling_title").css('color', '#A20808');
			
			$('#dictionary_div').slideDown();
			$('#spelling_div').slideUp();
		});
	});


	$('#spelling_title').click(function()
	{
		$("#wurdboek_title").animate(
		{
			backgroundColor: '#FFFFFF'
		}, 500);
		
		$("#spelling_title").animate(
		{
			backgroundColor: '#C2DFEF'
		}, 500, function()
		{
			//$("#wurdboek_title").css('color', '#A20808');
			//$("#spelling_title").css('color', '#FFFFFF');
			
			$('#spelling_div').slideDown();
			$('#dictionary_div').slideUp();
		});
	});


});
