	$(document).ready(function(){
		$("ol#categoria").hide();
		$("#coluna h2#cat").click(function(){
			$("ol#categoria").toggle('slow');
		});
		$("#form-comment").hide();
		$("#i-comment").click(function( e ){
			e.preventDefault();
			$("#form-comment").show('slow');
		});
		
		$("#overlay-j").live('click',function(){
			$( this ).remove();
			$('#banner_flutuante').remove();
			$('body').css({overflow: 'auto'});
		});
	});
	function hora(){
		var now = new Date();
		var hours = now.getHours();
		var minutes = now.getMinutes();
		var seconds = now.getSeconds();
		
		if (hours <=9) hours="0"+hours;
		if (minutes<=9) minutes="0"+minutes;
		if (seconds<=9) seconds="0"+seconds;
		var cdate = hours+":"+minutes+":"+seconds;
		
		document.getElementById('clock').innerHTML = cdate;
		setTimeout('hora()',1000);
	}
	function overlay_j( opac, body_height, color, zindex )
	{
		var lay = document.createElement('div');
		$( lay ).attr( {id : 'overlay-j'} );
		$( lay ).css( {background: color} );
		$( lay ).css( {'z-index': zindex} );
		$('body').after( lay );
		
		$( lay ).css({height: body_height+'px', opacity: opac});
	}
	
	
	/* floater */
	function id( id )
	{
		return document.getElementById( id );
	}
	function mover( ele, qnto )
	{
		var top = parseInt( id( ele ).style.top );
		var left = parseInt( id( ele ).style.left );

		var body_width = document.body.clientWidth - id( ele ).width;
		var body_height = id('cobaia').offsetTop*2 - id( ele ).height;

		var new_top = dimensao( h, body_height, qnto, top );
		var new_left = dimensao( w, body_width, qnto, left );	

		if( top<0 ) h = 0;
		if( left<0 ) w = 0;

		id( ele ).style.top = new_top;
		id( ele ).style.left = new_left;

		h++;
		w++;
		window.setTimeout("mover( '"+ele+"', 2, '"+q+"' )", 20);
	}
	function dimensao( count, dimensao, qnto, direcao )
	{
		if( count<dimensao/qnto )
			return parseInt(direcao)+qnto+'px';
		else
			return parseInt(direcao)-qnto+'px';
	}
	function createFloater( el, id, top, src )
	{
		var floater = document.createElement( el );
		
		if( el=='img' )
			floater.src = src;
		floater.id = id;

		if ( document.all )
			floater.style.position = 'absolute';
		else
			floater.style.position = 'fixed';
		floater.style.top = top;
		floater.style.left ='0';
		floater.style.cursor ='pointer';
		floater.style.zIndex ='100';
		
		document.body.appendChild( floater );
	}