var dot=0;
var elapsedtime=0;

function shield(button_id, cancel_id, poll_btn_text, poll_btn_text_2) {
	$('#'+button_id).attr('disabled', 'true');
	$('#'+button_id).attr('value', poll_btn_text);
	$('#'+button_id).removeClass('enabled');
	return setInterval("polling('"+button_id+"', '"+cancel_id+"', '"+poll_btn_text_2+"')",850);
}

function polling(button_id, cancel_id, poll_btn_text) {
	if (dot>3) dot=0;
	dots='';
	for (i=0; i<dot; i++) dots += '.';
	for (i=0; i<(3-dot); i++) dots += ' ';
	$('#'+button_id).attr('value', poll_btn_text+dots);
	dot++;
	elapsedtime += 850;
	if (elapsedtime > 30000 && cancel_id) $('#'+cancel_id).show();
}

