/*
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 */
 
jQuery(function ($) {
	/* You can safely use $ in this code block to reference jQuery */

$(document).ready(function() {

	$("a[target!='_blank']").tooltip({
		showURL: false,
		track: true,
	    delay: 400
	});

	/* EXCLUDE URL
	----------------------------------------------------------------------------------------------------  */
	// DE
	$("a[target='_blank']").each(function(){
    	$(this).attr('title', 'Link zu: '+$(this).attr('title')+' - (&ouml;ffnet in neuem Fenster)');
		$(this).tooltip({
			showURL: !$(this).hasClass('noUrl'),
			extraClass: "extern",
			showBody: "-"
		});
	});
	
	// EN
	/*$("body.en a[target='_blank']").each(function(){
    	$(this).attr('title', 'link to: '+$(this).attr('title')+' - (opens in a new window)');
		$(this).tooltip({
			showURL: !$(this).hasClass('noUrl'),
			extraClass: "extern",
			showBody: "-"
		});
	});*/

	/* MAIL
	----------------------------------------------------------------------------------------------------  */
	// DE
	$("a[href*='mailto:']").each(function(index) {
		var email = $(this).attr('href').substr($(this).attr('href').indexOf(':')+1);
    	$(this).attr('title', 'E-Mail: '+email);
 	});

	// EN
	/*$("body.en a[href*='mailto:']").each(function(index) {
		var email = $(this).attr('href').substr($(this).attr('href').indexOf(':')+1);
    	$(this).attr('title', 'Email: '+email);
 	});*/

	// COMMON
	$("a[href*='mailto:']").tooltip({
		showURL: false,
		track: true,
		extraClass: "email",
	    delay: 400
	});
	
	/* TOGGLER
	----------------------------------------------------------------------------------------------------  */
	// DE
	$(".toggler").each(function(index) {
    	$(this).attr('title', 'auf-/zuklappen');
 	});
	
	// EN
	/*$("body.en .toggler").each(function(index) {
    	$(this).attr('title', 'open/close');
 	});*/
	
	// COMMON
	$(".toggler").tooltip({
		showURL: false,
		track: true,
	    delay: 400
	});

});

});
