// Not sure whether this file should be available to ALL sites (ie, in the central directory), since it includes some jquery (and hence any pages calling it should have it also)

// function called at the end of validate form routine to disable all buttons in that form
function DisableEnableButtons(xForm,xHow){
	$('#'+xForm+' :button, #'+xForm+' :submit, #'+xForm+' :reset').attr('disabled', xHow);
}

// run at the top of every page
$(document).ready(function () {

	// polls panel processing script
	if($('.pollVoteButton').size()>0) {
		$('.pollVoteButton')
			.button()
			.click(function() {
				var pollID = $(this).val();
				$('#poll'+pollID+'_DIV').hide('normal', function() {
					$(this).blur();
					if($('#poll'+pollID+'_DIV input[name=poll'+pollID+']:checked').size()==0) { return; }
					var questionID = $('#poll'+pollID+'_DIV input[name=poll'+pollID+']:checked').val()
					$('#poll'+pollID+'_DIV').load('/central/scripts/cast_poll_vote.asp', { questionID: questionID }, function() {
						  $('#poll'+pollID+'_DIV').show('normal');
					});
				});
			});
	}

});
