// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function notify(type)
{
	// jQuery: reference div, load in message, and fade in


	//Event.observe(window, 'load', function() {
		
		var lNoticeDiv = $("flash-" + type);
		Effect.Appear("flash-" + type, {'duration':0.5});
		
		if(type == 'error') return;
		setTimeout(function() {
			Effect.Fade("flash-" + type, {'duration':0.5, 'afterFinish':function() {
				lNoticeDiv.hide();
			}});
			
			}, 3000);
	//});		
			
			
}



function selectFriend(fieldId, id, name, url) {
	var el = new Element('div', {'class':'friend-select-item'});
	el.appendChild(new Element('img', {'src':url}));
	el.appendChild(new Element('span').update(name))

	$('friend-select-selected').update(el);
	$(fieldId).value = name;
	$('friend-select').hide();

}