$( function() {
	$( '#bloggers' ).tabs( {/*fx: { opacity: 'toggle' }*/} ).tabs( 'rotate', 4000 );
	var doc_height = 0;
	$( document.body ).css( { 'height': $( document ).height() } );

	$.fn.qtip.styles.clg = {
		padding: 0, textAlign: 'left', color: '#fff', background: 'transparent', border: { width: 0 },
		title: { padding: 0, position: 'relative', background: 'transparent' },
		button: { float: 'none', position: 'absolute', 'right': 0 }
	};
	$( 'div.it' ).each( function() {
		$( this ).qtip( {
			content: { url: $( this ).attr( 'data-href' ), title: { text: '', button: 'x' } },
			position: { corner: { target: 'topMiddle', tooltip: 'bottomMiddle' } },
			show: { solo: true, when: { event: 'click' }, effect: 'fade' },
			hide: { fixed: true, when: { event: 'unfocus' }, effect: 'hide' },
			style: { name: 'clg', width: { min: 310, max: 310 }, classes: { tooltip: 'task-details-tip' } }
		} );
	} );

	$( 'a.button-provocare' ).each( function() {
		$( this ).qtip( {
			content: { url: $( this ).attr( 'href' ), title: { text: '', button: 'x' } },
			position: { target: $( document.body ), corner: 'center' },
			show: { when: 'click', solo: 'true' },
			hide: { when: 'unfocus' },
			style: { name: 'clg', width: { min: 378, max: 378 }, classes: { tooltip: 'task-add-modal' } }
		} ).click( function() { return false; } );
	} );

	$( 'div.task-rating a.button' ).each( function() {
		$( this ).qtip( {
			content: { url: $( this ).attr( 'href' ), title: { text: '', button: 'x' } },
			position: { target: $( document.body ), corner: 'center' },
			show: { when: 'click', solo: 'true' },
			hide: { when: 'unfocus' },
			style: { name: 'clg', width: { min: 378, max: 378 }, classes: { tooltip: 'task-add-modal' } }
		} ).click( function() { return false; } );
	} );


} );

function showBadge(sid) {
	$( '#provocare-' + sid ).qtip( 'hide' );
	$( 'body' ).qtip( {
		content: { url: "/2/badge.php?sid=" + sid, title: { text: '', button: 'x' } },
		position: { target: $( document.body ), corner: 'center' },
		show: { when: false, ready: true, solo: true },
		hide: { when: 'unfocus' },
		style: { name: 'clg', width: { min: 378, max: 378 }, classes: { tooltip: 'task-add-modal' } }
	} );
}
