$.fn.prepareTabs = function() {
	return this.each(function() {
		var obj = $(this).prepend( $( '<ul />' ) ).find( 'ul:first-child' );
		if( obj[0] ) {
			var ul = obj[0];
			$( 'h2:has(a[href])', $( this ) ).each( function() {
				obj.append( $( '<li />' ).html( $( this ).html() ) );
			} ).remove();
		}
	});
};
$.fn.prepareTableSorter = function( params ) {
	if( !params ) {
		params = {};
	}
	if( params.sortList ) {
		params.defSortList = params.sortList;
		params.sortList = null;
	}
	params.widgets = ['cookie'];
	return this.each( function() {
		$(this).addClass('tablesorter').find( 'thead th' ).each( function() {
			var txt = $(this).html();
			$(this).html( $( '<span></span>' ).html( txt ) ); 
		} );
	} ).tablesorter( params );
};
function zapyt_setup( obj, n ) {
	obj.id = "zapyt" + n;
	obj.cnt = $(obj).html();
	if( obj.cnt == "" ){
		$(obj).remove();
		return;
	}
	$(obj)
		.html( '&nbsp;' )
		.css( {cursor: "hand", display:"inline"} )
		.hover( function() { JT_show(this.cnt,this.id,this.name,400) },
				function() { $('#JT').remove() } );
}
$.fn.zapyt_setup = function( params ) {
	if( !params ) {
		params = 0;
	}
	return this.each( function( n ) {
		zapyt_setup( this, params + n );
	});
}