 
 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(){	
	 //sr_feuser_registration	
	 
	if( $('.tx-srfeuserregister-pi1').length )
	{     
	    defaultOptionA = '<option value="">Select the group you belong to</option>';
		$('#tx-srfeuserregister-pi1-usergroup option:first').before(defaultOptionA);	
		
	    defaultOptionB = '<option value="">Select your country</option>';
		$('#tx-srfeuserregister-pi1-static_info_country option:first').before(defaultOptionB);	
	}
							
					
	$("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');	
		
	}
	
	
	// 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");		
		
});
