counter = 0;
function addChoice(deleteButtonText, defaultText)
{
	choicesDiv = document.getElementById( 'choices' );
	counter++;
	if( !deleteButtonText ) {
	    deleteButtonText = 'Delete';
	}
	if( !defaultText ) {
	    defaultText = '';
	}
	newDiv = document.createElement('div');
	newDiv.id='choice_'+counter;
	newDiv.innerHTML =  '<input id="choiceText_'+counter+'" name="choice[]" style="width:50%" value="'+defaultText+'"/>'+
                            '<input type="button" value="'+deleteButtonText+'" class="button" id="deleteBtn" onclick="deleteChoice(\'choice_'+counter+'\');"/>';

	choicesDiv.appendChild(newDiv);
}
function deleteChoice(choiceId)
{
	choicesDiv = document.getElementById( 'choices' );
	choice = document.getElementById(choiceId);
	choicesDiv.removeChild(choice);
}
