$(document).ready(function() {
	$('#search_input').focus(function() {
		var $callObj = $(this);
		var inputValue = $callObj.val();
		if (inputValue == "Suche"){
			$callObj.val('');
		}
	});

	$('#search_input').blur(function() {
		var $callObj = $(this);
		var inputValue = $callObj.val();
		if (inputValue == '')
		{
			$callObj.val("Suche");
		}
	});
	// add extra class to be able to add different background-image for first element in IE6
	$('#col2 .inner_content:first').addClass('fst');

	// upload-form validation
	if($("#tx_neofileshare_pi1").length != 0){
		$("#tx_neofileshare_pi1").validationEngine('attach');
	}

	function alignVertical(elRef,elTarget){
		$('div.align-vertical').each(function(index){
			var refElHeight = $(this).find(elRef+':first').height();
			var elementsCount = $(this).find(elTarget+':first').children().length;

			if (elementsCount == 1){
				var innerHeight = $(this).find(elTarget+':first').children(':first').height();
			} else{
				var innerHeight = $(this).find(elTarget+':first').height();
			}

			if(refElHeight > innerHeight){
				var paddingTop = (refElHeight-innerHeight)/2;
				$(this).find(elTarget).css('padding-top',paddingTop);
			}
		});
	}
	alignVertical('img','div.csc-textpic-text');
});

