function doSubmit(id){
	if (validateForm(id))
		document.getElementById(id).submit();
}

function reorderCatalog(params,update){
	var elem_html = update.html();

	w = update.width();
	h = update.height();
	if (h<20) h = 240;
	if (w<20) w = 100;
	temp_div = "<div style='width:" + w + "px;height:" + h + "px;background:transparent url(/img/loading.gif) no-repeat center center;'></div>";
	update.html(temp_div);

	$.ajax({
		type: "POST",
		url: "/handlers/reordercatalog.php",
		data: params,
		success: function(msg){
			aux = msg.split('|');
			switch (aux[0]){
				case 'ok':
					update.hide('fast');
					update.html(aux[1]);
					if (aux[1]!='')
						update.show('fast');
				break;
				
				default:
					update.html(elem_html);
					break;
			}
		}
	});
}
