function removeImage(n, image)
{
	var url = '/services/removeimage.php';
	var pars = 'i=' + image + '&ts=' + getTimestamp();	
	
	var myAjax = new Ajax.Updater( 'attachment_'+n, url, { method: 'get', parameters: pars, evalScripts: true}); 	
}

//provide a random timestamp with each call to foil caching
function getTimestamp()
{
	var t = new Date();
	var r = "" + t.getFullYear() + t.getMonth() + t.getDate() + t.getHours() + t.getMinutes() + t.getSeconds(); 

	return(r);
}

function rateStore(store_id, rating)
{	
	var url = '/services/ratestore.php';
	var pars = 'p=' + store_id + '&r=' + rating + '&ts=' + getTimestamp();

	var stars = $('stars_'+store_id);	
	stars.innerHTML = '<center><blink>Updating</blink></center>';
	stars.style.display = "";
	
	var myAjax = new Ajax.Updater( 'stars_'+store_id, url, { method: 'get', parameters: pars, evalScripts: true}); 
}

function replyToComment(object_type, object_id, comment_id, parent_id, comment)
{	
	var url = '/services/reply.php';
	var pars = 'o=' + object_type + '&i=' + object_id + '&c=' + comment_id + '&p=' + parent_id + '&t=' + escape(comment) + '&ts=' + getTimestamp();	
	
	var myAjax = new Ajax.Updater( 'content_reply_'+comment_id, url, { method: 'post', parameters: pars, evalScripts: true}); 
}

function updateMiniSearch()
{
	if(!$('mini_searchresults'))
		return false;
	
	var url = '/services/minisearch.php';
	//todo add other fields to this search
	var pars = 'q=' + $F('name') + '&ts=' + getTimestamp();	
	
	Element.show('thinking');

	var myAjax = new Ajax.Updater('mini_searchresults', url, { method: 'get', parameters: pars, evalScripts: true }); 
}

function addTags(tags, product_id, product_type)
{	
	if(!product_type)
		product_type = "s";

	if(!tags)
		return false;

	var url = '/services/addtags.php';
	var pars = product_type + '=' +  product_id + '&t=' + tags + '&ts=' + getTimestamp();

	var tags = $('taglist');	
	tags.innerHTML = 'Updating...';
	tags.style.display = '';
	
	var myAjax = new Ajax.Updater( 'taglist', url, { method: 'get', parameters: pars, evalScripts: true}); 
	
	$('tags').value = '';
}