var clip = null;
	
function init() {
	// Enable Rich HTML support (Flash Player 10 Only)
	ZeroClipboard.setMoviePath( 'ZeroClipboard10.swf' );
	
	// Create our clipboard object as per usual
	clip = new ZeroClipboard.Client();
	clip.setHandCursor( true );
	
	clip.addEventListener('mouseOver', function (client) {
		// update the text on mouse over
		clip.setText( $('#url_encurtada').val() );
	});
	
	clip.addEventListener('complete', function (client, text) {
		debugstr(text);
	});
	
	clip.glue( 'copiar' );

}

function debugstr(url_msg) {
	var divSucessHtml = '<div id="sucessCopy">Link copiado: '+url_msg+'</div>'
	$('body').prepend(divSucessHtml);
	$('#sucessCopy').slideUp(5000).delay(100).fadeIn(1000);
	$('#sucessCopy').slideUp(400).delay(6000).fadeOut(14000);

}

function twit() {
	var texto = $('#txt').val();
	texto = texto.replace('#','');
	window.location = 'http://twitter.com/home?status='+unescape(texto);
}
