function openGoogleMap(query, type)
{
	window.open('/projects/googlemap.html?query='+encodeURIComponent(query)+(typeof type != 'undefined'?'&type='+type:''), 'googlemap', 'height=600px,width=800px,centerscreen=yes');
}
function searchUsers()
{
	var query = $('search-box').value;	
	if(query != '')
		query = '&query='+encodeURIComponent(query);
	$('search-box-spinner').show();
	new Ajax.Updater('managing-table', '/cat/mailings.php?action=search'+query,
	{
		onSuccess: function(){$('search-box-spinner').hide();}
	}
	);
}
function updateSubscription(userId, type, value)
{
	$('sp-'+userId+'-'+type).show();
	new Ajax.Request('/cat/mailings.php?action=updateSubscription', 
		{
			method: 'post',
			parameters: {'user_id': userId, 'type': type, 'value': value},
			onSuccess: function(){$('sp-'+userId+'-'+type).hide();}
		}
	);
}