$(document).ready(function(){
	 $("div#right h3").corner("round top 10px");
	 $("li.active").corner("round top 7px");
});
	 
	 

function clearLoginFields() {
	document.getElementById("Loginname").value='';
	document.getElementById("Passwort").value='';
}

$(document).ready(function(){
	$('.entrycomment').hide();
	$('.entrycomment').prev('.tx-guestbook-right').find('p.create_comment_link').prepend('<a href="#" class="toggleComments">Kommentare anzeigen</a> | ');
	
	$('a.toggleComments').live('click', function(){
		$(this).parents('.tx-guestbook-right').eq(0).next('.entrycomment').slideToggle(800);
		
		if($(this).text() == 'Kommentare anzeigen') {
			$(this).text('Kommentare ausblenden');
		}
		else {
			$(this).text('Kommentare anzeigen');
		}
		
		return false;
	});
	
	
	$('.create_comment_link').each(function(){
		
		$(this).find('a:last').click(function(){	
						
			var link = $(this);
			var commentform = $('<p />').addClass('commentform').text('Bitte warten...');
			
			
			if( $(link).parent().next('.commentform').find('form').length > 0 ) {
				$(link).parent().next('.commentform').find('form').find('input[type="text"]:first').focus();
				return false;
			}
			
			
			$(this).parent().after( $(commentform) );
			

			$.getScript('/typo3conf/ext/sr_freecap/pi2/freeCap.js', function() {
				$(commentform).load( $(link).attr('href') + ' #guestbook_form' );
			});
			
			return false;
		});
		
		
	});
	
	
	$('#guestbook_form').find('a').live('click', function(){
		return false;
	});
	
	
});






$(document).ready(function(){	
	
	var loginText = 'Benutzername';	
	var passwordText = '########';
	
	var login = $('#Loginname');
	var password = $('#Passwort');
		
		
	$(login).val('Benutzername');
	$(password).val('########');
	
	$(login).add(password).css({
			'color' : '#ababab',
			'fontStyle' : 'italic'
	});
	

	$(login).add(password).focus(function(){
		
		$(this).css({
			'color' : '#000',
			'fontStyle' : 'normal'}
		);
		
		if($(this).val() == loginText || $(this).val() == passwordText) {
			$(this).val('');
		}

	}).blur(function(){		

		if($(this).val() == '') {
			$(this).css({
				'color' : '#ababab',
				'fontStyle' : 'italic'
			});
		}

		if($(this).val() == '' && $(this).attr('id') == 'Loginname') {
			$(this).val(loginText);
		}
		
		if($(this).val() == '' && $(this).attr('id') == 'Passwort') {
			$(this).val(passwordText);
		}
		
	});

});
