$(function ()	{
	$('#user_options').mouseenter(function()	{
		$(this).stop(true, true).animate({opacity: 1});
	});
	$('#user_options').mouseleave(function()	{
		$(this).stop(true, true).animate({opacity: 0.5});
	});
	$('#login_form').hide();
	$('#show_login_form').click(function()	{
		$('#login_form').slideToggle('fast');
	});
	
//reg password validation
	$('#reg_form').submit(function()	{
		if ($('#pass').val() != $('#confirm').val())	{
			alert("Das angegebene Passwort stimmt nicht mit dem Bestätigungspasswort überein.");
			$('#pass').val("");
			$('#confirm').val("");
			return false;
		}
	});
	
//cms
	$('#all_user_options').hide();
	$('#show_user_options').click(function()	{
		$('#all_user_options').slideToggle('fast');
	});
	
	$('.new .form').hide();
	$('.new a').click(function()	{
		$(this).parent().children('.form').toggle('fast');
	});
	
	$('.edit_form').hide();
	$('.edit_this').click(function()	{
		$(this).parent().children('.edit_form').toggle('fast');
	});
	$('.edit_this_mannschaft').click(function()	{
		$(this).parent().parent().children('.edit_form').toggle('fast');
	});
	
	$('.delete_this').click(function()	{
		var ok = window.confirm('Wirklich löschen?');
    	if (ok) {
        	return true;
        }
        else	{
        	return false;
        }
	});
	
	$('.spieler_daten').hide();
	$('.show_spieler_daten').click(function ()	{
		$(this).parent().children('.spieler_daten').toggle('fast');
	});
// /galerie
	var opt = {
		api_key: '9edeab2132714d817413ad9607b5ad05',
		photoset_ids: [
			'72157622193565026',
			'72157623264176073',
			'72157626400923048'
		],
		loading_msg: '<img src="ajax-loader.gif" id="spinner" />',
		thumb_click_hide: true
	}
	$('#gallery').flickrGallery(opt);
});
