/**
 This server side script library implements the ability to show and hide
 "DIV" sections dynamically
 
*/

function showMore(s){
document.getElementById('more' + s).style.display='block';
document.getElementById('plus' + s).style.display='none';
document.getElementById('minus' + s).style.display='block';
}

function hideMore(s){
document.getElementById('more' + s).style.display='none';
document.getElementById('plus' + s).style.display='block';
document.getElementById('minus' + s).style.display='none';
}

/**
This script confirms whether the user wants to save their comments
*/

function saveComment(){
	if(confirm("Do you want to save your comments?")){
		return true;
	}else{
		return false;
	}
	
	db=database;

	doc=db.getDocumentByID(dominoDoc.getNoteID())

	rdoc=db.createDocument();
	rdoc.appendItemValue("Form","Comment");
	rdoc.appendItemValue("DocAuthor",context.getUser().getCommonName());
	rdoc.appendItemValue("Comment", dominoDoc.getItemValue("Comment"));
	rdoc.makeResponse(doc);
	rdoc.save();

	context.reloadPage()
}
