function askfirst(text, url)
{
	var answer = confirm (text);
	
	if (answer)
		window.location=url;
}

//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 getAdminProductList(target, category)
{
	if($(target).firstChild)
	{
		//if there is a child in the target, remove the innerHTML content
		$(target).innerHTML = '';		
	}
	else
	{	
		//else we are 'opening'. get the product list.
		var url = '/wp-content/plugins/cs-products_data.php';
		var pars = 'action=adminproductlist&category=' + category + '&ts=' + getTimestamp();	
	
		var myAjax = new Ajax.Updater(target, url, { method: 'get', parameters: pars, evalScripts: true }); 
	}
}