/*================= Myview3 ============================
This is the view after the php file has been processed. The
user has the possibility to place another order.*/

var Myview3 = function(aModel, aController)
{

// inheritance from the Abstractclass

	this.inheritFrom = Abstractclass;
  	this.inheritFrom(aModel, aController);
  	
  	var md = aModel;
  	var cd = aController;
	
// Textfield for the message

	var formResultText = document.getElementById("formMes");
	
// Imageholder for a success or failed image

	var formResultImg = document.getElementById("formSuccess");
	
// Button to place another order

	var anotBut = document.getElementById("anotherBut");
	anotBut.onclick = function (event)
	{
  		EventBus.dispatch (event.type, cd, event);
	}
	
// update function overrides the function from the Abstractclass

	this.update = function (event)
	{
		evType = event.type;
		if(evType == "resultForm")
		{
		
// All values come from the Model class.

			formResultText.value = md.mmes.getMes();
			formResultImg.src = md.mobj.getObject();
		}
	}
}