/**
 * jquery.js
 *
 * History:
 * - 2009-06-08 rr: Erstellt
 */

$(document).ready(function() {
	// Externe Links kennzeichnen
    //$('#wrapper').extlink();

    //Admin Navigation
	$("div#nav_top_admin_div").hover(function(){
		$(this).css("height", "auto");
	}, function() {
		$(this).css("height", "100px");
	});

    // Bildupload togglen (Userprofil)
    $("a#ToggleNewPic").click(function(){
    	$("#ChoosePicDiv").hide();
		$("#NewPicDiv").slideToggle('normal');
	});

	// Avatarauswahl togglen (Userprofil)
    $("a#ToggleChoosePic").click(function(){
    	$("#NewPicDiv").hide();
		$("#ChoosePicDiv").slideToggle('normal');
	});

	// Passwort-Ändern togglen (Userprofil)
    $("a#TogglePwdDiv").click(function(){
		$("#ChangePwdDiv").slideToggle('normal');
	});

	// FormResult Erfolgsmeldung ausfaden
	setTimeout(function(){
		$("#formresult_success").fadeOut("normal");
		$("#formresult_success").slideUp('normal');
	}, 500000);

	// Bereits gerated Text anzeigen
    $("a#BtnAlreadyRated").click(function(){
		$("span#TxtAlreadyRated").show();
	});

	// Bitte Registrieren für Rating
    $("a#BtnRegForRate").click(function(){
		$("span#TxtRegForRate").show();
	});

	// Bitte Registrieren für Rating
    $("a#ToggleCommentContainer").click(function(){
		$(".CommentContainerHidden").slideToggle('normal');
		$("a#ToggleCommentContainer").hide();
	});

	$("#datepicker").datepicker({ dateFormat: 'dd.mm.y', maxDate: '+0d', showOn: 'button', buttonImage: '/cms/styles/default/img/datepicker.gif', buttonImageOnly: true });

	$("div#slideOut").css("height", "0px");

	$("a.slideOutOpenLink").click(
		function () {
			$("div#slideOut").animate({height: "112px"}, 1500);
			$("div#slideOutOpenLinkWrapperInner").css({"border-bottom-width":"1px", "border-bottom-style":"solid", "border-bottom-color":"black"});
			$("div#slideOutCloseLinkWrapperInner").css("visibility", "visible");
			$("a.slideOutOpenLink").removeAttr("href");
			//$("div#wrapper").animate({"marginTop": "130px"}, 1500);
			$("div#wrapper").css("margin-top", "130px");
        }
	);
	
	$("a.slideOutCloseLink").click(function(){
		$("div#slideOut").animate({height: "0px"});
			$("div#slideOutOpenLinkWrapperInner").css({"border":"none"});
			$("div#slideOutCloseLinkWrapperInner").css("visibility", "hidden");
			$("a.slideOutOpenLink").attr("href", "#")
			$("div#wrapper").css("margin-top", "10px");
	});

	$("#captcha").attr({ autocomplete:"off" });
});