//
$(function(){
	$("body").removeClass("noscript");
	$("body").addClass("script");
	$('a[rel=external]').attr('target','_blank');
	$('a[rel=top]').attr('target','_top');
	$("#content").hide().fadeIn(2000);
	$("#page > section article").hide().fadeIn(900);
	$('table').parent().parent().addClass('table');
	$('#acco').parent().addClass('acco');
	$('#acco').parent().children('h3').addClass('acco');
//	$('ul.col1').before('<p>Test</p>');
	$(".fon").before("<span>fon: </span>");
	$(".fax").before("<span>fax: </span>");
	$(".net").before("<span>net: </span>");
	$(".mail").before("<span>email: </span>");
//	$(".email").before("<span>email: </span>");
//	$(".before b").css("width","45px").css("display","block").css("float","left").css("font-weight","500");

	$('ul#example li p').hover(function() {

	var checkElement = $(this).next();

	if(checkElement.is(':visible')) {
		checkElement.slideUp('normal');
		return false;
	}

	if(!checkElement.is(':visible')) {
		$('ul#example li ul:visible').slideUp('normal');
		checkElement.slideDown('normal');
		return false;
	}
});

	$("div.link").hover(
		function () {
		$(this).animate({top:'+=20'},{ queue: true });
		},
		function () {
		$(this).animate({top:'-=20'},{ queue: true });
		}
	);


});

$(function(){

  $('.email').each(function(i){

    var protectedEmail = $(this).html();
    protectedEmail = protectedEmail.replace(" [at] ","@");
    protectedEmail = protectedEmail.replace(" [dot] ",".");

    $(this)
      .html(protectedEmail)
      .replaceWith("<a href=\"mailto:"+$(this).text()+"\">"+$(this).text()+"</a>");

  });

});
$(function(){

  $('.emaili').each(function(i){

    var protectedEmail = $(this).html();
    protectedEmail = protectedEmail.replace(" [at] ","@");
    protectedEmail = protectedEmail.replace(" [dot] ",".");

    $(this)
      .html(protectedEmail)
      .replaceWith("<a class=\"mail\" title=\"E-mail\" href=\"mailto:"+$(this).text()+"\"><span>"+$(this).text()+"</span></a>");

  });

});
$(function(){

  $('.emailo').each(function(i){

    var protectedEmail = $(this).html();
    protectedEmail = protectedEmail.replace(" [at] ","@");
    protectedEmail = protectedEmail.replace(" [dot] ",".");

    $(this)
      .html(protectedEmail)
      .replaceWith("<a href=\"mailto:"+$(this).text()+"\">"+$(this).text()+"</a>");

  });

});
$(function(){
//

// div.flex
	$('.flex > h3').click(function() {
		$(this).parent().parent().parent().addClass('off');
		$('.flex > h3').removeClass('on');
		$('.flex > div').slideUp(750).addClass('ul');

		if($(this).next().is(':hidden') == true) {
			$(this).addClass('on');
			$(this).next().fadeIn(750);
		}

	});

	$('.flex > h3').mouseover(function() {
		$(this).addClass('over');
	}).mouseout(function() {
		$(this).removeClass('over');
	});

	$('.flex > div').hide();
	$('.flex > h3').addClass('cursor');
// ENDE div.flex
// div.flexlist
	$('.flexlist > h3').click(function() {
		$(this).parent().parent().parent().addClass('off');
		$('.flexlist > h3').removeClass('on');
		$('.flexlist > ul').slideUp(750).addClass('ul');

		if($(this).next().is(':hidden') == true) {
			$(this).addClass('on');
			$(this).next().fadeIn(750);
		}

	});

	$('.flexlist > h3').mouseover(function() {
		$(this).addClass('over');
	}).mouseout(function() {
		$(this).removeClass('over');
	});

	$('.flexlist > ul').hide();
	$('.flexlist > h3').addClass('cursor');
// ENDE div.flexlist

// div.flextable
//	$('.flextable > h3').click(function() {
//		$(this).parent().parent().parent().addClass('off');
//		$('.flextable > h3').removeClass('on');
//		$('.flextable > table').fadeOut(750).addClass('ul');

//		if($(this).next().is(':hidden') == true) {
//			$(this).addClass('on');
//			$(this).next().fadeIn(750);
//		}

//	});

//	$('.flextable > h3').mouseover(function() {
//		$(this).addClass('over');
//	}).mouseout(function() {
//		$(this).removeClass('over');
//	});

//	$('.flextable > table').hide();
//	$('.flextable > h3').addClass('cursor');
// ENDE div.flexlist

// VISITENKARTE
	$('#vcard dt').click(function() {
		$(this).parent().parent().parent().parent().addClass('off');
		$('#vcard dt').removeClass('on');
		$('#vcard dd').fadeOut(900);

		if($(this).next().is(':hidden') == true) {
			$(this).addClass('on');
			$(this).next().fadeIn(900);
		}

	});

	$('#vcard dt').mouseover(function() {
		$(this).addClass('over');
	}).mouseout(function() {
		$(this).removeClass('over');
	});

	$('#vcard dd').hide();
	$('#vcard dt').addClass('cursor');
//
});
// ENDE VISITENKARTE

$(function()  {

	$('tr').hover(function(){
		$(this).addClass('hover');
	},   function()   {
		$(this).removeClass('hover');
	});
});
