function attachMailTo() {
   var mailAdr = document.getElementsByTagName('a');
   for (var CountMail=0;CountMail<mailAdr.length;CountMail++) {
      if (mailAdr[CountMail].className != 'mailto') continue; 
	  var email = mailAdr[CountMail].innerHTML.split("").reverse().join("");
      mailAdr[CountMail].innerHTML = email;
	  mailAdr[CountMail].href = 'mailto:' + email; 	  
   }
}
window.onload = attachMailTo;

// var onLastSlide = false;
// jQuery(function() {	
// 	$("#tabs_panes").scrollable({ circular: true, mousewheel: true, activeClass: "active" }).autoscroll({interval: 2000});
// });
// jQuery(function() {
//	$("#index_accord").accordion({ autoHeight: false });
// });
$(document).ready(function() {
	$('table').removeAttr('style').removeAttr('prevstyle');
	$('td').removeAttr('style').removeAttr('prevstyle');
	$('tr').removeAttr('style').removeAttr('prevstyle');
});
jQuery(function() {
	$("#form_anfrage #form_submit").click(function() {
		$.post('/processor&action=processor_forms', $('#form_anfrage').serialize(), function(data) {
			$('#result').html(data);
		});
	});
});
jQuery(function() {
	$("#indexwrap_spt").click(function() {
		window.location.href = "/Stimm-_Praesentationstraining/Der_Ton_macht_die";
	});		
});
jQuery(function() {
	$("#indexwrap_mediation").click(function() {
		window.location.href = "/Mediation/Was_ist_Mediation";
	});		
});
function slideSwitch(switchSpeed) {
	var $active = $('#slideshow div.active');
	if ( $active.length == 0 )
		$active = $('#slideshow div:last');
		var $next = $active.next().length ? $active.next()
		: $('#slideshow div:first');
		$active.addClass('last-active')
		.animate({opacity : 0.0}, 1000);
		$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
}


function slideSwitchIndex(switchSpeed) {
	var $active = $('#slideshow_index div.active');
	if ( $active.length == 0 )
		$active = $('#slideshow_index div:last');
		var $next = $active.next().length ? $active.next()
		: $('#slideshow_index div:first');
		$active.addClass('last-active')
		.animate({opacity : 0.0}, 1000);
		$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
}

$(function() {
    setInterval ( "slideSwitchIndex(1000)", 5000 );    
	setInterval ( "slideSwitch(1000)", 5000 );    
});
