//used in delegatesmailingcontent.php

var updateProductList = function(e)
{
	
	//e.preventDefault();
	dojo.xhrPost({
		url: "/productfinderlist.php",
		form: "ajaxform",
		handle: function(data,args){
			if (typeof data == "error") {
				//console.warn("error!", args);
				//alert("error! " + data + args);
			}
			else {
				//console.log(data);
				dojo.byId("ajaxcontent").innerHTML = data;
				//alert("error! " + data + args);
			}
		}
		
	});
};

dojo.addOnLoad(function() {
	var theForm = dojo.byId("ajaxform");
	if (theForm != null) {
		var es = theForm.getElementsByTagName("input");
		for (var j = 0; j < es.length; j++) {
			if (es[j].className == "ajaxaction") {
				dojo.connect(es[j],"onclick", updateProductList);
			}
		}
	}
});