var zahnlexikon_active;

function autoFill(id, v){
	$(id).css({ color: "#000000" }).attr({ value: v }).focus(function(){
		if($(this).val()==v){
			$(this).val("").css({ color: "#000000" });
		}
	}).blur(function(){
		if($(this).val()==""){
			$(this).css({ color: "#000000" }).val(v);
		}
	});

}


$(document).ready(function() {

	// $("a[href^='http://']").attr('target','_blank');
	$("a[href^='http://']").addClass('extern');

	$("a:has(img)").addClass('fancybox');
	$("table.tablesorter").tablesorter();

	$('dl.faq dt').each(function() { 
		$(this).html( "► " + $(this).html());
	});
	$('dl.faq dd').each(function() { 
		$(this).hide();
	});


    $("dl.faq dt").click(
    function(){          
		if ($(this).is(".down")) {
			$(this).removeClass("down");
			$(this).html( "► " + $(this).html().substr(2));
			$(this).next().slideUp();
		} else {
			$(this).html( "▼ " + $(this).html().substr(2));
			$(this).next().slideDown();
			$(this).addClass("down");
		}
	});



	$('ul.nav ul ul > li.active > a').html($('ul.nav ul ul > li.active > a').html()+" ►");		

	if ( ($('ul.nav > li > ul > li.active ul').children('li.active').size() > 0) ) {
		$('ul.nav > li > ul > li.active > a').html("▼ " + $('ul.nav > li > ul > li.active > a').html());
	} else {
		$('ul.nav > li > ul > li.active > a').html($('ul.nav > li > ul > li.active > a').html()+" ►");		
	}

	if ( ($('ul.nav > li.active ul').children('li.active').size() > 0) ) {
		$('ul.nav > li.active > a').html( "▼ " + $('ul.nav > li.active > a').html());
	} else {
		$('ul.nav > li.active > a').html($('ul.nav > li.active > a').html()+" ►");		
	}



	$('div.jobformular legend').each(function() { 
		$(this).html( "▼ " + $(this).html());
	});
/*
	var height_element= new Array();
	for(i=0;i<$("div.jobformular").length;i++)
	{
	  height_element[i] = $("div.jobformular").eq(i).height();        
	}

	$('div.jobformular').css('height', '60px');

	$('div.jobformular legend').each(function() { 
		$(this).html( "▼ " + $(this).html());
	});

    $("div.jobformular #form_formular legend").click(
    function(){          

		if ($(this).parents('div.jobformular').is(".down")) {
			$(this).parents('div.jobformular').removeClass("down");
			$(this).html( "▼ " + $(this).html().substr(2));
			$(this).parents('div.jobformular').animate({ height: "60px" }, 1000, function() {});
		} else {
			$(this).html( "► " + $(this).html().substr(2));
			$(this).parents('div.jobformular').animate({height: height_element[$('div.jobformular').index($(this).parents('div.jobformular'))] }, 1000, function() {});
			$(this).parents('div.jobformular').addClass("down");
		}

	}
  );
*/


	//$("a[href^='http://'],div.box a").each(function(){ $(this).html($(this).html()+" ►"); });
	// $('#sidebar ul.nav li.active').parent('li').css('content', 'x');
	//autoFill($("#f_login_input1"), "");
	//autoFill($("#f_login_input2"), "");
	// $('a[href^="http://"]').attr("target", "_blank");
	
	
	
	
	/*
		Zahnlexikon
	*/
	
		
	$('#zahnlexikon>li>a').click(function(){
		return false;
	});
	
	zahnlexikon_active = $('#zahnlexikon li.active');
	
	
	$('#zahnlexikon>li').hover(function(){
		$('#zahnlexikon li').removeClass('active');
	},function(){
		zahnlexikon_active.addClass('active');
	});
	
	/*
	$('#zahnlexikon ul a').click(function(){
		$('#zahnlexikon li').removeClass('active');
		zahnlexikon_active = $(this).parent().parent().parent();
		
		$(this).parent().parent().parent().addClass('active');
		var myclass=$(this).attr('class');
		$('#zahnlexikon-entries *').hide();	
		$('#zahnlexikon-entries .'+myclass+','+'#zahnlexikon-entries .'+myclass+' *').fadeIn(300);
		$(this).trigger('blur');
		//return false;
	});
	$('#zahnlexikon ul:eq(0) a:eq(0)').trigger('click');	
	*/	
	
	
});













