
function assign_button_events() {

	jQuery('.button').each(
		function() {
			jQuery(this).mouseover(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)\.(?!.*\.)(.*)/, "$1_over.$2"));
				}
				);
			jQuery(this).mouseout(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)_.*\.(?!.*\.)(.*)/, "$1.$2"));
				}
				);
			jQuery(this).mousedown(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)_over\.(?!.*\.)(.*)/, "$1_on.$2"));
				}
				);
			jQuery(this).mouseup(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)_.*\.(?!.*\.)(.*)/, "$1_over.$2"));
				}
				);
		}
		);


}

function assign_info_events(iteration) {
	jQuery('.additionalInfo'+iteration).each(
		function() {
			jQuery(this).mouseover(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)\.(?!.*\.)(.*)/, "$1_over.$2"));
				}
				);
			jQuery(this).mouseout(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)_.*\.(?!.*\.)(.*)/, "$1.$2"));
				}
				);
			jQuery(this).mousedown(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)_over\.(?!.*\.)(.*)/, "$1_on.$2"));
				}
				);
			jQuery(this).mouseup(
				function() {
					if (jQuery(this).attr('src')) jQuery(this).attr('src',jQuery(this).attr('src').replace(/([^.]*)_.*\.(?!.*\.)(.*)/, "$1_over.$2"));
				}
				);
		}
		);
}

jQuery(document).ready(
	function(){

		jQuery('.hide').each(
			function() {
				jQuery(this).hide();
			}
			);

		assign_button_events();

		jQuery('#content-top-search .text').focus(function() {
			if (jQuery(this).attr('value')==jQuery(this).attr('defaultValue'))
				jQuery(this).attr('value', '');
		});

		jQuery('#content-top-search .text').blur(function() {
			if (jQuery(this).attr('value')=='')
				jQuery(this).attr('value', jQuery(this).attr('defaultValue'));
		});


		jQuery('a').click(function() {
			jQuery(this).blur();
		});


		jQuery('.postit').each(
			function() {
				jQuery(this).mouseover(
					function() {
						jQuery(this).css('background-position','0 0');
					}
					);
				jQuery(this).mouseout(
					function() {
						jQuery(this).css('background-position','0 -167px');
					}
					);
			}
			);

		try {
			jQuery('.column-header').each(function() {
				jQuery(this).mouseover(
					function() {
						jQuery(this).css({
							'background-position' : '0 -140px'
						});
					}
					);
				jQuery(this).mouseout(
					function() {
						jQuery(this).css({
							'background-position' : '0 0'
						});
					}
					);
			}
			);
		} catch(e){}
	}
	);

function einblenden(){
	document.getElementById('weitereTermine').style.display = "block";
	document.getElementById('einblenden').style.display = "none";
	document.getElementById('ausblenden').style.display = "block";
	return false;
}
function ausblenden(){

	document.getElementById('weitereTermine').style.display = "none";
	document.getElementById('einblenden').style.display = "block";
	document.getElementById('ausblenden').style.display = "none";
	return false;
}

function showAdditionalDateInfo(iteration){

	//alert('+' + iteration);
	document.getElementById('additionalDateInfo' + iteration).style.display = "block";
	document.getElementById('showAdditionalInfo' + iteration).style.display = "none";
	document.getElementById('hideAdditionalInfo' + iteration).style.display = "block";
	return false;
}
function hideAdditionalDateInfo(iteration){
	//alert('-' + iteration);
	document.getElementById('additionalDateInfo' + iteration).style.display = "none";
	document.getElementById('showAdditionalInfo' + iteration).style.display = "block";
	document.getElementById('hideAdditionalInfo' + iteration).style.display = "none";
	return false;
}

