function showTooltipZitate(text) {
    Tip(text, TITLEPADDING, 7, DELAY, 0, FONTFACE, 'helvetica, arial, verdana', EXCLUSIVE, true, FOLLOWMOUSE, false, PADDING, 7, WIDTH, 150, BGCOLOR, '#00a7ed', BORDERWIDTH, 1, BORDERCOLOR, '#fff', FONTCOLOR, '#fff', SHADOW, false);
}

function hideTooltip() {
    UnTip();
}

function searchCitations() {
	var searchField = $('#dscZitateDb_searchField');
	if(searchField.val() == '... oder hier Suchbegriff eingeben') searchField.val('');
	//var doSearch = false;
	//$$('.dscZitateDb_searchCategory').each(function(item) {
	//	if(item.getElement('input[type=checkbox]').checked) doSearch = true;
	//});
	//if(searchField.value != '') doSearch = true;
	//if(doSearch) {
		showLoadingDiv($('#dscZitateDb_search'));
		tx_dsczitatedbshowCitationsAction(xajax.getFormValues(document.forms.dsczitatedb_form));
	//}
}

function showLoadingDiv(el, small) {
	var loadingDiv;
	if($('#loadingDiv').length > 0) {
		loadingDiv = $('#loadingdiv').clone();
		$('#loadingDiv').remove();
	}
	else {
		loadingDiv = $('<div id="loadingDiv"></div>');
	}
	if(small) loadingDiv.set('className', 'small');
	if(loadingDiv) {
		loadingDiv.appendTo('body');
		el = $(el);
		if(el != null) {
			var sourcePosition = el.offset();
			loadingDiv.css({
				'top': sourcePosition.top + "px",
				'left': sourcePosition.left + "px",
				'width': el.width() + "px",
				'height': el.height() + "px",
				'display': 'block'
			});
		}
	}
}

function hideLoadingDiv() {
	if($('#loadingDiv')) $('#loadingDiv').remove();
}

function toggleClipClap(id) {
	var el = $('#' + id);
	var nexDiv = el.parent().next('div');
	var height;
	if(el.attr('class') == 'closed') {
		el.attr('class', 'open');
		nexDiv.slideDown("slow");
//		fx.addEvent('onComplete', function() {
//			nexDiv.setStyle('height', 'auto');
//		}.bind(nexDiv));
//		fx.start('height', 0, height);
	}
	else {
		el.attr('class', 'closed');
		height = nexDiv.height();
		nexDiv.slideUp("slow");
//		fx.addEvent('onComplete', function() {
//			nexDiv.setStyle('height', 'auto');
//			nexDiv.set('class', nexDiv.get('class').replace(/open/i, 'closed'));
//		}.bind(nexDiv));
//		fx.start('height', height, 0);
	}
}
