$(document).ready(function(){ 

	// smooth scrolling
	$("a.softscroll").click(function() {
		var elementClicked = $(this).attr("href");
		var destination = $(elementClicked).offset().top;
		jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 1000 );
		return false;
	});
	
	
	// open links with rel=external in a new window
	$('a[class*=external],ul.downloads a').click( function() {
		window.open(this.href);
		return false;
	});
	
	// alternating rowcolors
	$("#content table tr:even").addClass('even') 
	$("#content table tr:odd").addClass('odd')
	
	
	// liest den title von Inputfeldern aus und setzt ihn dynamisch als value
	function switchText()
	{
		if ($(this).val() == $(this).attr('title'))
			$(this).val('').removeClass('exampleText');
		else if ($.trim($(this).val()) == '')
			$(this).addClass('exampleText').val($(this).attr('title'));
	}
	
	$('input[type=text][title!=""]').each(function() {
		if ($.trim($(this).val()) == '') $(this).val($(this).attr('title'));
		if ($(this).val() == $(this).attr('title')) $(this).addClass('exampleText');
	}).focus(switchText).blur(switchText);
	
	$('form').submit(function() {
		$(this).find('input[type=text][title!=""]').each(function() {
			if ($(this).val() == $(this).attr('title')) $(this).val('');
		});
	});
	
}); 
