function onClickOnCircle(node){
	//clean the page
	removeFromFieldset(title_input_id);
	removeFromFieldset(select_input_id);
	removeFromFieldset(label0_id);
	removeFromFieldset(label1_id);
	while(divDiscussion.hasChildNodes()){
		divDiscussion.removeChild(divDiscussion.lastChild);
	}
	//redraw the <fieldset>
	switch(node.constructor.name){
	case 'Argument':
		textarea.placeholder= 'Please enter your question';
		var answer = answersMap.get(node.parent);
		if(answer != undefined){
			var question = questionsMap.get(answer.parent);
			if(question!= undefined){
				drawDivision(0, question, 1);
				drawDivision(1, answer, 2);
			}
		}
	case 'Publication':		
		form.action 		= ('/watson/display?type=question&id='+node.pubId);
		var title 			= document.createElement('input');
		title.name 			= 'title';
		title.type 			= 'text';
		title.placeholder 	= 'Please enter a title';
		title.id			= title_input_id;
		textarea.placeholder= 'Please enter your question';
		var select 			= document.createElement('select');
		select.id			= select_input_id;
		select.name			= 'category';
		for(var [key, value] of categories){
			var option = document.createElement('option');
			option.value = value;
			option.text = value;
			select.appendChild(option);
		}
		fieldset.insertBefore(select, textarea);
		fieldset.insertBefore(title, select);
		break;
	case 'Question':
		form.action = ('/watson/display?type=answer&id='+node.pubId);
		textarea.placeholder= 'Please enter your answer';
		break;
	case 'Answer':
		form.action 		= ('/watson/display?type=argument&id='+node.pubId);
		var radio			= document.createElement('input');
		radio.type			= 'radio';
		radio.name			= radio.value = 'agree';
		var label 			= document.createElement('label');
		label.id			= label0_id;
		label.innerHTML 	= 'I agree';
		label.appendChild(radio);
		fieldset.insertBefore(label, textarea);
		var radio1 			= document.createElement('input');
		radio1.type			= 'radio';
		radio1.name			= 'agree';
		radio1.value 		= 'disagree';
		radio1.checked 		= true;
		var label1 			= document.createElement('label');
		label1.id			= label1_id;
		label1.innerHTML 	= 'I disagree';
		label1.appendChild(radio1);
		fieldset.insertBefore(label1, label);
		textarea.placeholder= 'Please enter your argument';
		var parent = questionsMap.get(node.parent);
		if(parent != undefined){
			drawDivision(0, parent, 1);
		}
		break;
	}
	//draws the discussion stream
	addDiscussionStream(node);
}
/**
 * Called when a node is clicked
 * @param node (Publication) publication wrapped inside the RelNode wrapped inside the clicked node
 */
Called when a node is clicked
@param node (Publication) publication wrapped inside the RelNode wrapped inside the clicked node
Called when a node is clicked @param node ( Publication ) publication wrapped inside the RelNode wrapped inside the clicked node
function onClickOnCircle(node){
	removeFromFieldset(title_input_id);
	removeFromFieldset(select_input_id);
	removeFromFieldset(label0_id);
	removeFromFieldset(label1_id);
	while(divDiscussion.hasChildNodes()){
		divDiscussion.removeChild(divDiscussion.lastChild);
	}
	switch(node.constructor.name){
	case 'Argument':
		textarea.placeholder= 'Please enter your question';
		var answer = answersMap.get(node.parent);
		if(answer != undefined){
			var question = questionsMap.get(answer.parent);
			if(question!= undefined){
				drawDivision(0, question, 1);
				drawDivision(1, answer, 2);
			}
		}
	case 'Publication':		
		form.action 		= ('/watson/display?type=question&id='+node.pubId);
		var title 			= document.createElement('input');
		title.name 			= 'title';
		title.type 			= 'text';
		title.placeholder 	= 'Please enter a title';
		title.id			= title_input_id;
		textarea.placeholder= 'Please enter your question';
		var select 			= document.createElement('select');
		select.id			= select_input_id;
		select.name			= 'category';
		for(var [key, value] of categories){
			var option = document.createElement('option');
			option.value = value;
			option.text = value;
			select.appendChild(option);
		}
		fieldset.insertBefore(select, textarea);
		fieldset.insertBefore(title, select);
		break;
	case 'Question':
		form.action = ('/watson/display?type=answer&id='+node.pubId);
		textarea.placeholder= 'Please enter your answer';
		break;
	case 'Answer':
		form.action 		= ('/watson/display?type=argument&id='+node.pubId);
		var radio			= document.createElement('input');
		radio.type			= 'radio';
		radio.name			= radio.value = 'agree';
		var label 			= document.createElement('label');
		label.id			= label0_id;
		label.innerHTML 	= 'I agree';
		label.appendChild(radio);
		fieldset.insertBefore(label, textarea);
		var radio1 			= document.createElement('input');
		radio1.type			= 'radio';
		radio1.name			= 'agree';
		radio1.value 		= 'disagree';
		radio1.checked 		= true;
		var label1 			= document.createElement('label');
		label1.id			= label1_id;
		label1.innerHTML 	= 'I disagree';
		label1.appendChild(radio1);
		fieldset.insertBefore(label1, label);
		textarea.placeholder= 'Please enter your argument';
		var parent = questionsMap.get(node.parent);
		if(parent != undefined){
			drawDivision(0, parent, 1);
		}
		break;
	}
	addDiscussionStream(node);
}
function onClickOnCircle ( node ) { removeFromFieldset ( title_input_id ) ; removeFromFieldset ( select_input_id ) ; removeFromFieldset ( label0_id ) ; removeFromFieldset ( label1_id ) ; while ( divDiscussion . hasChildNodes ( ) ) { divDiscussion . removeChild ( divDiscussion . lastChild ) ; } switch ( node . constructor . name ) { case 'Argument' : textarea . placeholder = 'Please enter your question' ; var answer = answersMap . get ( node . parent ) ; if ( answer != undefined ) { var question = questionsMap . get ( answer . parent ) ; if ( question != undefined ) { drawDivision ( 0 , question , 1 ) ; drawDivision ( 1 , answer , 2 ) ; } } case 'Publication' : form . action = ( '/watson/display?type=question&id=' + node . pubId ) ; var title = document . createElement ( 'input' ) ; title . name = 'title' ; title . type = 'text' ; title . placeholder = 'Please enter a title' ; title . id = title_input_id ; textarea . placeholder = 'Please enter your question' ; var select = document . createElement ( 'select' ) ; select . id = select_input_id ; select . name = 'category' ; for ( var [ key , value ] of categories ) { var option = document . createElement ( 'option' ) ; option . value = value ; option . text = value ; select . appendChild ( option ) ; } fieldset . insertBefore ( select , textarea ) ; fieldset . insertBefore ( title , select ) ; break ; case 'Question' : form . action = ( '/watson/display?type=answer&id=' + node . pubId ) ; textarea . placeholder = 'Please enter your answer' ; break ; case 'Answer' : form . action = ( '/watson/display?type=argument&id=' + node . pubId ) ; var radio = document . createElement ( 'input' ) ; radio . type = 'radio' ; radio . name = radio . value = 'agree' ; var label = document . createElement ( 'label' ) ; label . id = label0_id ; label . innerHTML = 'I agree' ; label . appendChild ( radio ) ; fieldset . insertBefore ( label , textarea ) ; var radio1 = document . createElement ( 'input' ) ; radio1 . type = 'radio' ; radio1 . name = 'agree' ; radio1 . value = 'disagree' ; radio1 . checked = true ; var label1 = document . createElement ( 'label' ) ; label1 . id = label1_id ; label1 . innerHTML = 'I disagree' ; label1 . appendChild ( radio1 ) ; fieldset . insertBefore ( label1 , label ) ; textarea . placeholder = 'Please enter your argument' ; var parent = questionsMap . get ( node . parent ) ; if ( parent != undefined ) { drawDivision ( 0 , parent , 1 ) ; } break ; } addDiscussionStream ( node ) ; }
Called when a node is clicked
 @param node (Publication) publication wrapped inside the RelNode wrapped inside the clicked node
Called when a node is clicked @param node ( Publication ) publication wrapped inside the RelNode wrapped inside the clicked node
//clean the page //redraw the <fieldset> //draws the discussion stream