$(document).observe('dom:loaded', function() { 
	Event.observe( // observes this tag field - del.icio.us like
		$('tag'), 'keyup',function(e){
			$('tag').style.width = (30 + $F('tag').length * 4) + 'px'; // i need change this
		}
	);
	
	if($('alert')) { // show flash's messages
		$('alert').style.display = 'none';
		new Effect.Appear('alert', {duration: 3});
		setTimeout("new Effect.Fade('alert');", 10000);
	}
	
});

var Login = { // login effect. basecamp's inpired
  loginWithOpenId: function(options) {
	Effect.Parallel([
		new Effect.Puff('user_name_login'),
		new Effect.Appear('open_id_login')
	])
  },
  
  loginWithUserName: function() {
	Effect.Parallel([
		new Effect.Puff('open_id_login'),
		new Effect.Appear('user_name_login')
	])
  }
}

var ShowHide = function(div) { // toogle lines in the code. yeah, i need refactory this
	if ($('div_' + div + '_nolines').style.display == 'none') {
		$('div_' + div + '_nolines').style.display = 'block'
		$('div_' + div + '_withlines').style.display = 'none'
	}                            
	else {                       
		$('div_' + div + '_nolines').style.display = 'none'
		$('div_' + div + '_withlines').style.display = 'block'
	}
}

function clickclear(thisfield, defaulttext) { if (thisfield.value == defaulttext) { thisfield.value = "" } }
function clickrecall(thisfield, defaulttext) { if (thisfield.value == "") { thisfield.value = defaulttext; } }