 
 function create_icon(icon)
 {
	return '<img src="layout/img/'+icon+'.gif" class="link-icon" />';
 }

	// animated forms
jQuery.fn.getMoreContainer = function() {	
		// get checkbox id
	var id = $(this).attr('id');
		// return 'child'-container object
	return $('#more-'+id);
}; 
 
 
 $(document).ready(function(){	
							
		// on page: anmeldung
	if($("body#b6").length == 0 ) {
		
			// checkboxes width class 'more' and 'child'-container named #more-+id of the parent checkbox
			// e.g. checkbox: #certrfle, 'child'-container: #more-certrfle
		$('input.more').each(function() {
			if(!this.checked) {				
				$(this).getMoreContainer().hide();
			}
		});			
			// all checkboxes width class more toggle their 'child'-containers
		$('.more').click(function(){				 
				$(this).getMoreContainer().slideToggle('normal');
		});

	}
							
					
	$("img[src$='tel.gif']").addClass("tel");
	$("a:has(img)").addClass("img");
	$("a[href^='javascript:linkTo_UnCryptMailto']").addClass("email");
	if($("body#b6").length == 0) // on search page do not display link icons 
	{
		// link icons: because of the IE multiline problem do not use css classes
		$("a[href$='.rtf']").not("[class='img']").append(create_icon('doc'));
		$("a[href$='.doc']").not("[class='img']").append(create_icon('doc'));
		$("a[href*='.pdf'], a[href*=':PDF']").not("[class='img']").append(create_icon('pdf'));	
		
		$("a[href$='.rtf']").attr('target','_blank');
		$("a[href$='.doc']").attr('target','_blank');
		$("a[href*='.pdf'], a[href*=':PDF']").attr('target','_blank');		

		
		// $("#content a:not([href^=http])").not("[href^=index.php?eID]").not("[href^=#]").not("[class='email']").not("[href$='.pdf']").not("[href$='.doc']").not("[id^='c']").not("[class='thickbox']").prepend("» ");	
		}
	
		/* $("a[href^='http']").not("[class='img']").not("[class='noicon']").not("[href*='.pdf'], [href*=':PDF']").each(function(){	
			// external link with » at the begining looks like an internal link.				
			if($(this).html().indexOf('»') == -1){
				 $(this).append(create_icon('link_extern'));		   
			}
		});
		*/		
	
	// if ther follows a , or a . or a ) the link, img will get class link-icon2
    // IE has it's own html() 
	$("p a img.link-icon").parents('p').each(function(){
		// alert($(this).html());
        var expr = /link-icon([^>]*)><\/a>([,\.\)]{1})/gi;
		var repl = 'link-icon2$1></a>$2';
		$(this).html($(this).html().replace(expr,repl));	
	});	
	
	// alert($("a[href^='http']:not('GMP')").html());	
	
	// open external links with target _blank	
	$("a[href^='http']").attr('target','_blank');
	$(".search_result a[href^=http]").attr('target','_self');
	
	
		//zebra table
	$("tr:odd").addClass("odd");
	// $("td:nth-child(1)").addClass("td1");	
	$("td:first-child").addClass("td1");		
		
});