function noemailspam(adrs,dmain,nme,clss) {      	

    // Function made by Henrik Wissing
    
    first = 'ma';
    second = 'il';
    third = 'to:';
    
    myresult = '<a href="' + first + second + third + adrs + '&#64' + dmain + '">';
    
    // Check: Insert Style-Class? PART 1
    if(clss != ''){
        myresult = myresult+'<span class="'+clss+'">';    
    }
    
    // ### Check: Show E-Mail or Name? ###
    if(nme != ''){
        myresult = myresult+nme;
    } else {
        myresult = myresult+adrs+'&#64'+dmain;
    }    
    
    // Check: Insert Style-Class? PART 2
    if(clss != ''){
        myresult = myresult+'</span>';
    }
    
    // ### FINISH IT ###    
    myresult = myresult+'<\/a>';
    document.write(myresult);
}     

$(document).ready(function() {
	
	$(".arrow").addClass("arrow_right");
	
	// Hoch & runter scrollen
	$(".slidein_link").bind("click",function(event){
		event.preventDefault();
		
		// Ziel-ID aus href nehmen
		var TargetId = $(this).attr("href");
		
		alert($(this).class());
		
		
		// Schliessen der TargetID per Slide-Up
		if( $(TargetId).is(':visible') ) {
			$(TargetId).slideUp("slow");
			
			
			
		}
		// Oeffnen der TargetID per Slide-Down
		else {
			$(TargetId).slideDown("slow");	
			
			

			
		}
		
	});
	
	
	function slideToggle(el, bShow){
	  var $el = $(el), height = $el.data("originalHeight"), visible = $el.is(":visible");
	  
	  // if the bShow isn't present, get the current visibility and reverse it
	  if( arguments.length == 1 ) bShow = !visible;
	  
	  // if the current visiblilty is the same as the requested state, cancel
	  if( bShow == visible ) return false;
	  
	  // get the original height
	  if( !height ){
	    // get original height
	    height = $el.show().height();
	    // update the height
	    $el.data("originalHeight", height);
	    // if the element was hidden, hide it again
	    if( !visible ) $el.hide().css({height: 0});
	  }
	
	  // expand the knowledge (instead of slideDown/Up, use custom animation which applies fix)
	  if( bShow ){
	    $el.show().animate({height: height}, {duration: 800 , easing: 'easeInOutExpo'});
	  } else {
	    $el.animate({height: 0}, {duration: 800, easing: 'easeInOutExpo', complete:function (){
	        $el.hide();
	      }
	    });
	  }
	}
	
	
	$(".slidein_link_new").bind("click",function(event){
			event.preventDefault();
			var TargetId = $(this).attr("href");
			slideToggle(TargetId);
	});
	

	
	$(".arrow").bind("click",function(event){
			if ($(this).hasClass("arrow_right")){
				$(this).addClass("arrow_down");	
				$(this).removeClass("arrow_right");	
			} else {
				$(this).addClass("arrow_right");	
				$(this).removeClass("arrow_down");	
			}
	});
	
	
	// .animate({opacity:'0'}, 500);
	if ($('.quote').is(":visible")){
		setInterval(function(){
			$('.quote').filter(':visible').fadeOut(1000,function(){
				if($(this).next('.quote').size()){
					$(this).next().fadeIn(1000);
				}
				else{
					$('.quote').eq(0).fadeIn(1000);
				}
			});
		},7000);
	}
	
	
});
